1 2007-02-11 Miguel de Icaza <miguel@novell.com>
3 * cs-parser.jay (lambda_expression_body): when the body is an
4 expression add a statement of the form:
6 contextual-return expression.
8 Where `contextual-return' is similar to `return', the difference
9 being that if the delegate that the lambda will be converted to
10 has a void return type, it will check that the result is a
11 ExpressionStatement and the result is a plain ret (no return
12 values on the stack). If the return type of the delegate is of a
13 given type, this turns into a return with a value and does the
14 regular checking to check that the computed value can be
15 implicitly converted to the delegate return.
17 2007-01-30 Miguel de Icaza <miguel@novell.com>
19 * cs-parser.jay (anonymous_method_expression): move the
20 before/after productions to the start_anonymous and end_anonymous
21 methods so the code can be reused for lambda functions.
23 (lambda_expression_body): wrap expressions implicitly into a
26 (block): factor out the setup/teardown of parsing a block so we
27 can reuse that in lambda_expression_body
29 (lambda_expression): use new anonymous method helper methods.
31 2007-01-29 Miguel de Icaza <miguel@novell.com>
33 * cs-parser.jay: oob_stack make it static (am guessing that is why
34 we no longer initialize it anymore) and reuse it across
37 2007-01-28 Miguel de Icaza <miguel@novell.com>
39 * cs-parser.jay (open_parens): Introduce new non-terminal that
40 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
41 be returned in places where types are followed by identifiers
42 (this is expected in declaration, fixed, using, foreach and catch
45 Use open_parens in those places, keep OPEN_PARENS in the
48 cs-parser.jay: New grammar bits for parsing lambda expressions.
50 2007-01-28 Raja R Harinath <rharinath@novell.com>
52 Fix #80534, gtest-309.cs
53 * generic.cs (UnifyType): Rename from InferType. Make unification
54 of generic insts simpler and don't insist on inferring all generic
55 parameters in a single generic inst unification.
57 (InferGenericInstance): Remove.
58 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
60 2007-01-20 Marek Safar <marek.safar@gmail.com>
62 * cs-parser.jay: Better parameter error handling.
64 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
65 Raja R Harinath <rharinath@novell.com>
67 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
68 Note the order in which accessors are declared in the source.
70 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
72 * generic.cs (TypeParameter.FindMembers): Use the generic
73 constraints, not the constraints to check for methods (first fix
76 2006-12-30 Marek Safar <marek.safar@gmail.com>
78 * cs-parser.jay: Better syntax errors handling.
80 2006-11-21 Marek Safar <marek.safar@gmail.com>
82 * cs-parser.jay: Tiny change to work with mcs tokenizer.
84 * cs-tokenizer.cs: Remove after unification with mcs.
86 2006-10-28 Marek Safar <marek.safar@gmail.com>
89 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
92 2006-10-26 Marek Safar <marek.safar@gmail.com>
95 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
97 2006-10-25 Brian Crowell <brian@fluggo.com>
100 * generic.cs (CheckConstraints): Allow generic parameters with
101 inheritance constraints to satisfy reference type constraints.
103 2006-10-09 Martin Baulig <martin@ximian.com>
106 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
108 2006-09-25 Martin Baulig <martin@ximian.com>
110 * class.cs: Remove after unification with mcs source.
112 2006-09-24 Raja R Harinath <harinath@gmail.com>
114 * convert.cs: Remove after unification with mcs source.
116 2006-09-24 Marek Safar <marek.safar@seznam.cz>
118 * class.cs (MemberBase.VerifyClsCompliance): When method has type
119 parameters verify them as well.
121 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
122 the type parameter constraints.
123 (Generics.VerifyClsCompliance): Ditto.
125 2006-09-24 Marek Safar <marek.safar@seznam.cz>
127 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
128 for anonymous block with out argument.
130 2006-09-24 Marek Safar <marek.safar@seznam.cz>
132 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
133 not used private events only.
135 2006-09-23 Marek Safar <marek.safar@seznam.cz>
137 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
139 * cs-parser.jay: Parse correctly cast of default (T).
141 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
142 Store original type via EmptyConstantCast.
144 2006-09-22 Martin Baulig <martin@ximian.com>
146 * delegate.cs: Removed; this file is now shared with mcs.
148 * attribute.cs: Removed; this file is now shared with mcs.
150 2006-09-22 Martin Baulig <martin@ximian.com>
152 * ecore.cs: Removed; this file is now shared with mcs.
154 2006-09-21 Marek Safar <marek.safar@seznam.cz>
156 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
158 * ecore.cs (NullCast): Derives from NullConstant.
160 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
163 2006-09-21 Martin Baulig <martin@ximian.com>
165 * decl.cs: Removed; this file is now shared with mcs.
167 2006-09-21 Raja R Harinath <rharinath@novell.com>
169 * rootcontext.cs: Remove after unification with mcs source.
171 * report.cs: Remove after unification with mcs source.
172 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
174 (InitGenerics, CleanUpGenerics): Remove.
176 * support.cs: Remove after unification with mcs source.
178 2006-09-20 Raja R Harinath <rharinath@novell.com>
180 * codegen.cs: Remove after unification with mcs source.
182 2006-09-19 Martin Baulig <martin@ximian.com>
184 * expression.cs: Removed; this file is now shared with mcs.
186 2006-09-19 Martin Baulig <martin@ximian.com>
189 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
190 (TypeManager.DropGenericTypeArguments): Likewise.
191 (TypeManager.DropGenericMethodArguments): Likewise.
192 (TypeManager.GetTypeArguments): Likewise.
193 (TypeManager.HasGenericArguments): Likewise.
195 2006-09-19 Martin Baulig <martin@ximian.com>
197 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
199 2006-09-19 Martin Baulig <martin@ximian.com>
201 * typemanager.cs: Removed; this file is now shared with mcs.
203 2006-09-16 Raja R Harinath <rharinath@novell.com>
205 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
206 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
208 2006-09-16 Marek Safar <marek.safar@seznam.cz>
211 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
212 only if parent type is class.
213 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
216 2006-09-15 Marek Safar <marek.safar@seznam.cz>
219 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
221 * typemanager.cs(CSharpName): Converts NullType to null.
223 2006-09-15 Martin Baulig <martin@ximian.com>
225 * pending.cs: Removed; this file is now shared with mcs.
227 2006-09-15 Martin Baulig <martin@ximian.com>
229 * statement.cs: Removed; this file is now shared with mcs.
231 2006-09-15 Martin Baulig <martin@ximian.com>
233 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
235 * driver.cs: Removed the `--broken-cycles' argument.
237 2006-09-15 Martin Baulig <martin@ximian.com>
239 * namespace.cs: Removed; this file is now shared with mcs.
241 2006-09-15 Martin Baulig <martin@ximian.com>
243 * decl.cs (MemberName): Minor code cleanups.
245 2006-09-15 Martin Baulig <martin@ximian.com>
247 * parameter.cs: Removed; this file is now shared with mcs.
249 2006-09-15 Martin Baulig <martin@ximian.com>
251 * enum.cs: Removed; this file is now shared with mcs.
253 2006-09-15 Martin Baulig <martin@ximian.com>
255 * Makefile: Define `GMCS_SOURCE'.
257 * flowanalysis.cs: Removed; this file is now shared with mcs.
259 2006-09-15 Martin Baulig <martin@ximian.com>
261 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
262 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
263 doc.cs - they are now shared with mcs.
265 * gmcs.exe.sources: Include these files from ../mcs/.
267 2006-09-15 Martin Baulig <martin@ximian.com>
269 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
270 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
272 2006-09-14 Marek Safar <marek.safar@seznam.cz>
274 * assign.cs, ecore.cs, expression.cs: Share error message text.
275 * class.cs (FieldMember.Define): Check for variable of static type.
276 * decl.cs (check_type_parameter): Report correct type name.
277 * driver.cs (LoadAssembly): Uses error output for errors.
278 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
279 (TypeArguments.Resolve): Static class cannot be used as an argument.
280 * statement.cs (ResolveMeta): Constants cannot be generic types.
282 2006-09-12 Martin Baulig <martin@ximian.com>
284 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
286 * convert.cs (Convert.Array_To_IList): Moved here and correctly
287 implement it; fixes #79345.
289 2006-09-08 Marek Safar <marek.safar@seznam.cz>
291 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
293 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
295 * generic.cs: Improved error messages.
296 * typemanager.cs (RemoveGenericArity): Made public.
298 2006-09-08 Martin Baulig <martin@ximian.com>
300 * typemanager.cs (TypeManager.interlocked_type): New public field.
301 (TypeManager.int_interlocked_compare-exchange): New public field.
302 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
303 enumerator types here and call InitGenericCoreTypes().
304 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
305 after calling InitEnumUnderlyingTypes().
308 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
309 `classes_second_stage'.
311 2006-09-07 Marek Safar <marek.safar@seznam.cz>
313 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
315 * statement.cs (Block.Variables): Made public.
317 2006-09-07 Martin Baulig <martin@ximian.com>
320 (MainDriver): Revert r62663 from Marek; see #70506 for details.
322 2006-09-01 Martin Baulig <martin@ximian.com>
325 (TypeManager.IsIList): Also handle base classes and interfaces.
327 2006-09-01 Raja R Harinath <rharinath@novell.com>
330 * expression.cs (Invocation.MoreSpecific): Check for reference
333 2006-08-29 Miguel de Icaza <miguel@novell.com>
335 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
337 2006-08-17 Miguel de Icaza <miguel@novell.com>
339 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
340 #52019 and #79064, the use of the \uXXXX sequence in source code
341 to represent unicode characters.
343 2006-08-15 Marek Safar <marek.safar@seznam.cz>
345 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
347 * class.cs, ecore.cs, statement.cs: Merged to one error message.
349 2006-08-14 Raja R Harinath <rharinath@novell.com>
352 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
353 parameter too. This only avoids a parse error -- the semantic
354 error is caught elsewhere.
356 2006-08-13 Miguel de Icaza <miguel@novell.com>
358 * assign.cs: Catch attempts to assign to a method groups in += and
361 2006-08-13 Marek Safar <marek.safar@seznam.cz>
364 * cs-parser.jay: Don't destroy current array type by typeof of array's.
366 2006-08-12 Marek Safar <marek.safar@seznam.cz>
368 * cs-parser.jay: Check whether a constraint clause has already been
369 specified for type parameter.
370 * generic.cs (Constraints): Exposed location.
372 2006-08-12 Marek Safar <marek.safar@seznam.cz>
374 * class.cs (Method.Define): Issue a warning when generic method looks like
376 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
378 * report.cs: New warning number.
380 2006-08-09 Marek Safar <marek.safar@seznam.cz>
382 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
384 * decl.cs (MemberCache.FindMembers): When container is interface we need to
385 search all base interfaces as a member can be ambiguous.
386 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
387 Constructor member type filter.
388 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
389 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
390 reporting for returned memberinfos.
391 * report.cs: Updated.
392 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
393 version to work on all runtimes.
394 (TypeManager.RealMemberLookup): Removed members filtering.
396 2006-08-08 Raja R Harinath <rharinath@novell.com>
398 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
399 (PropertyExpr.EmitAssign): Likewise.
400 * expression.cs (Indirection.EmitAssign): Likewise.
401 (LocalVariableReference.EmitAssign): Likewise.
402 (ParameterReference.EmitAssign): Likewise.
403 (Invocation.EmitArguments): Likewise.
404 (ArrayAccess.EmitAssign): Likewise.
405 (IndexerAccess.EmitAssign): Likewise.
406 (This.EmitAssign): Likewise.
407 (ConditionalLogicalOperator.Emit): Likewise.
410 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
411 instead of ArrayList. If the hashtable has a LocalBuilder, don't
412 leave it in after returning it.
413 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
415 2006-08-06 Marek Safar <marek.safar@seznam.cz>
417 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
420 2006-08-05 Marek Safar <marek.safar@seznam.cz>
422 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
423 with different type names.
424 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
426 2006-08-03 Raja R Harinath <rharinath@novell.com>
428 Fix cs0146-3.cs and cs0146-4.cs.
429 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
430 enclosing types don't depend on the current type.
432 2006-08-02 Raja R Harinath <rharinath@novell.com>
435 * class.cs (TypeContainer.DoDefineMembers): Use
436 FindBaseMemberWithSameName on Parent, since we're interested in
437 whether we hide inherited members or not.
438 (FindBaseMemberWithSameName): Make slightly more robust.
441 * codegen.cs (IResolveContext.GenericDeclContainer): New.
442 (EmitContext): Implement new interface requirement.
443 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
444 * decl.cs (MemberCore): Likewise.
445 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
446 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
447 ec.GenericDeclContainer to check for generic parameters.
448 (SimpleName.DoSimpleNameResolve): Likewise.
449 * generic.cs (TypeParameter.DeclContainer): Remove override.
451 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
452 declspaces for doppelgangers too.
453 (UsingEntry): Implement IResolveContext.
454 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
455 'this' as the resolve context.
456 (LocalAliasEntry): Likewise.
458 Implement parts of #77403
459 * roottypes.cs (RootDeclSpace): New. Used to represent the
460 toplevel declaration space. Each namespace declaration introduces
461 a "partial" root declaretion space.
462 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
463 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
464 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
465 from 'current_namespace.SlaveDeclSpace'.
466 (namespace_declaration): Likewise.
467 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
468 check. It can't happen now.
469 * decl.cs (DeclSpace.LookupType): Likewise.
470 * driver.cs (MainDriver): Sanity check.
472 2006-08-01 Raja R Harinath <rharinath@novell.com>
474 * decl.cs (DeclSpace.FindNestedType): Remove.
475 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
476 LookupTypeContainer to get the container of the nested type.
477 * class.cs (TypeContainer.FindNestedType): Make non-override.
479 2006-07-31 Raja R Harinath <rharinath@novell.com>
481 * decl.cs (DeclSpace.PartialContainer): Move field from ...
482 * class.cs (TypeContainer.PartialContainer): ... here.
483 (TypeContainer.AddBasesForPart): New helper.
484 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
486 * cs-parser.jay (current_class): Convert to DeclSpace.
487 (struct_declaration, interface_declaration, class_declaration):
488 Use AddBasesForPart instead of .Bases directly.
489 * const.cs, iterators.cs: Update to changes.
491 2006-07-28 Raja R Harinath <rharinath@novell.com>
493 * class.cs (TypeContainer.AddMemberType): Rename from
495 (TypeContainer.AddMember): Rename from AddToMemberContainer.
496 (AddTypeContainer): New. Combine AddClassOrStruct and
498 (AddPartial): Update. Add 'is_partial' argument.
499 * roottypes.cs: Update to changes.
500 * cs-parser.jay (push_current_class): New helper for handling
501 current_container and current_class.
502 (struct_declaration, interface_declaration, class_declaration):
505 2006-07-26 Raja R Harinath <rharinath@novell.com>
507 * roottypes.cs: Rename from tree.cs.
509 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
510 * tree.cs (Tree, ITreeDump): Remove types.
511 * rootcontext.cs (tree, Tree): Remove fields.
512 (root, ToplevelTypes): New.
513 * *.cs: Update to rename.
515 * tree.cs (Tree.RecordDecl): Remove.
516 (RootTypes.AddToTypeContainer): Record the toplevel type in its
518 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
520 2006-07-23 Raja R Harinath <harinath@gmail.com>
522 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
523 DoFlowAnalysis and OmitStructFlowAnalysis here.
524 (ec.With): Rename from WithUnsafe and generalize.
525 (ec.WithCheckState): Remove. All users can be handled by 'With'.
526 (ec.WithFlowAnalyis): New.
527 * ecore.cs, expression.cs, statement.cs: Update.
529 2006-07-22 Raja R Harinath <harinath@gmail.com>
531 * statement.cs (Block.ResolveMeta): Simplify slightly.
533 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
534 multiple boolean fields. Convert InUnsafe, constant_check_state,
535 check_state to flags.
536 (CheckState, ConstantCheckState): Update.
537 (InUnsafe): New read-only property.
538 (FlagsHandle): Rename from CheckStateHandle and convert to handle
540 (WithUnsafe): New helper similar to WithCheckState.
541 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
542 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
544 2006-07-21 Raja R Harinath <rharinath@novell.com>
546 Make comparisons use the same IL irrespective of whether they're
547 in a 'checked' or 'unchecked' context: one of the issues in #78899
548 * codegen.cs (EmitContext.CheckState): Make read-only property.
549 (EmitContext.ConstantCheckState): Likewise.
550 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
551 helper that implement a save/restore stack for CheckState
552 values. This is the only way to change check-state.
553 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
554 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
555 (CheckedExpr.EmitBranchable): New forwarding method.
556 (UnCheckedExpr): Likewise.
557 * statement.cs (Block.ResolveMeta): Use WithCheckState.
558 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
559 (Checked.Resolve, checked.DoEmit): Likewise.
561 2006-07-21 Martin Baulig <martin@ximian.com>
563 * generic.cs (TypeManager.InferType): When inferring an array
564 type, also allow IList<T> and ICollection<T>. Fixes #78900.
566 2006-07-21 Martin Baulig <martin@ximian.com>
568 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
569 and allow IList`1 and all its base interfaces.
571 * convert.cs (Convert.ImplicitReferenceConversion): Allow
572 converting from an array-type of T to IList<T>.
574 2006-07-21 Martin Baulig <martin@ximian.com>
576 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
578 2006-07-20 Miguel de Icaza <miguel@novell.com>
580 * anonymous.cs: Cache the resolved anonymous delegate, and return
581 this so that the ResolveTopBlock is only triggered once, not
584 Currently we trigger ResolvetopBlock twice due to a first pass of
585 argument check compatibility, and a second pass that does the
588 2006-07-15 Marek Safar <marek.safar@seznam.cz>
590 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
592 * rootcontext.cs (Reset): Add helper_classes.
594 2006-07-15 Marek Safar <marek.safar@seznam.cz>
597 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
600 2006-07-13 Miguel de Icaza <miguel@novell.com>
602 * statement.cs (Lock): Handle expressions of type
603 TypeManager.null_type specially. Fixes #78770
605 2006-07-08 Marek Safar <marek.safar@seznam.cz>
607 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
610 2006-07-08 Marek Safar <marek.safar@seznam.cz>
612 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
613 for accessors as well.
614 * ecore.cs (EventExpr): Add AccessorTable.
616 2006-07-03 Martin Baulig <martin@ximian.com>
618 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
619 instances of value types.
621 * convert.cs (Convert.ExplicitConversion): Correctly handle
622 object->nullable conversions.
624 2006-07-01 Marek Safar <marek.safar@seznam.cz>
627 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
628 for CS0122 where appropriate.
629 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
631 (Filter): Assembly can be null in the case of top level attributes.
633 2006-06-28 Raja R Harinath <rharinath@novell.com>
636 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
637 no arguments, return 'false': nothing can be inferred.
639 2006-06-25 Marek Safar <marek.safar@seznam.cz>
643 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
644 is done at global level.
646 2006-06-24 Marek Safar <marek.safar@seznam.cz>
648 A fix for #77002, Implemented TypeForwarder support.
650 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
651 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
653 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
654 * typemanager.cs (): Add type_forwarder_attr_type.
656 2006-06-24 Marek Safar <marek.safar@seznam.cz>
658 * report.cs: Add CS0469 warning.
660 2006-06-22 Martin Baulig <martin@ximian.com>
663 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
664 for interfaces; fixes #78686, which is a modification of #78380
665 with interfaces instead of classes.
667 2006-06-21 Martin Baulig <martin@ximian.com>
669 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
670 the `try'-block, so we also report CS0016 etc. there.
672 2006-06-21 Martin Baulig <martin@ximian.com>
674 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
675 handle SetAssigned() and SetMemberIsUsed() for generic types;
678 2006-06-21 Martin Baulig <martin@ximian.com>
681 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
683 2006-06-21 Martin Baulig <martin@ximian.com>
685 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
686 also report CS1686 for parameters.
688 2006-06-21 Martin Baulig <martin@ximian.com>
690 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
691 instead of an error if the value is not implicitly convertible to
692 the switch types; fixes #77964.
694 2006-06-21 Raja R Harinath <rharinath@novell.com>
697 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
698 FieldBuilder is null.
701 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
702 'left' and 'right' before error-checking.
704 2006-06-19 Martin Baulig <martin@ximian.com>
707 (Convert.ImplicitConversionStandard): Cleanup and correctly
708 implement nullable conversions.
709 (Convert.ImplicitStandardConversionExists): Likewise.
710 (Convert.ExplicitConversion): Likewise.
712 2006-06-19 Martin Baulig <martin@ximian.com>
715 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
716 methods; make the ctors protected.
718 2006-06-19 Martin Baulig <martin@ximian.com>
720 Fixed #78380; added gtest-273.cs.
723 (Expression.ResolveAsBaseTerminal): Move the constraint checking
724 into ResolveAsTypeTerminal().
727 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
728 TypeManager.FindMembers() to check for the default ctor.
730 2006-06-18 Marek Safar <marek.safar@seznam.cz>
732 * generic.cs: Fixed NullableInfo accessibility.
734 2006-06-16 Martin Baulig <martin@ximian.com>
737 (Constraints.InflatedConstraints.inflate): Correctly inflate
738 generic types; fixes #78400.
740 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
742 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
744 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
745 (FieldExpr.DoResolve): likewise.
746 (PropertyExpr.InstanceResolve): likewise.
747 (EventExpr.InstanceResolve): likewise.
749 2006-06-15 Martin Baulig <martin@ximian.com>
752 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
753 argument; always allow a `null' label if true.
754 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
755 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
756 we have a `null' label and mark the new `null_target' label;
757 default to the `default' label.
758 (Switch.Resolve): Add support for nullable types. Fixes #78630.
760 2006-06-15 Martin Baulig <martin@ximian.com>
762 * class.cs (Operator.Define): Allow an implicit/explicit operator
763 to convert to/from a nullable value of the enclosing type.
765 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
766 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
769 (Convert.ImplicitStandardConversionExists): Add support for lifted
770 implicit/explicit conversions.
771 (Convert.ImplicitConversionStandard): Likewise.
773 2006-06-13 Martin Baulig <martin@ximian.com>
775 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
776 type arguments and create a ConstructedType if necessary. Fixes #78400.
778 2006-06-04 Marek Safar <marek.safar@seznam.cz>
780 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
781 attribute applicable tests for attribute argument.
783 2006-06-02 Raja R Harinath <rharinath@novell.com>
786 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
787 (Binary.OverloadResolve_PredefinedIntegral): New.
788 (Binary.OverloadResolve_PredefinedFloating): New.
789 (Binary.OverloadResolve_PredefinedString): New.
790 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
791 Follow the standard more closely, and treat numeric promotions in
792 terms of overload resolution.
793 (Binary.CheckShiftArguments): Simplify.
795 2006-06-01 Raja R Harinath <rharinath@novell.com>
797 * flowanalysis.cs (MyBitVector): Simplify representation.
798 (MyBitVector.Clone): Avoid allocating BitArray.
799 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
800 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
801 (*): Update. Change all references to MyBitVector.And and
802 MyBitVector.Or to &= and |=.
804 2006-05-31 Raja R Harinath <rharinath@novell.com>
806 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
807 Use bne.un instead of ceq+brfalse.
810 * typemanager.cs (IsUnmanagedType): Disallow generic types and
813 2006-05-29 Raja R Harinath <rharinath@novell.com>
816 * cs-parser.jay (formal_parameter_list): Extend the pattern below
817 to param arguments too.
819 2006-05-26 Miguel de Icaza <miguel@novell.com>
821 * cs-parser.jay: Catch another parsing form for arglist being
822 followed by other arguments. Fixes #78313.
824 2006-05-25 Raja R Harinath <rharinath@novell.com>
827 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
828 also when one of the operands is a null literal.
829 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
830 to improve clarity, and generate slightly better code.
832 2006-05-24 Raja R Harinath <rharinath@novell.com>
834 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
835 checking of out parameters to ...
836 (FlowBranchingToplevel.Merge): ... here.
837 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
838 set, propagate the origin upward, and only complain if there was
840 (FlowBranchingException.AddContinueOrigin): Likewise.
841 (FlowBranchingException.AddReturnOrigin): Likewise.
842 (FlowBranchingException.AddGotoOrigin): Likewise.
844 2006-05-23 Raja R Harinath <rharinath@novell.com>
846 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
847 unreachable, skip it.
848 (FlowBranchingException.Merge): Always propagate jumps, even if
849 the finally block renders subsequent code unreachable.
851 2006-05-18 Raja R Harinath <rharinath@novell.com>
854 * statement.cs (Goto.Resolve): Move responsibility for resolving
855 'goto' to FlowBranching.AddGotoOrigin.
856 (Goto.SetResolvedTarget): New. Callback to set the
857 LabeledStatement that's the target of the goto.
858 (Goto.DoEmit): Use Leave instead of Br when crossing an
859 unwind-protect boundary.
860 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
861 LookupLabel and adjust to new semantics.
862 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
863 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
864 Goto.SetResolvedTarget to update target.
865 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
866 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
867 AddBreakOrigin & co. Delay propagation until ...
868 (FlowBranchingException.Merge): ... this.
870 * statement.cs (Block.Resolve): Always depend on flow-branching to
871 determine unreachability. Kill workaround that originally emitted
872 only one statement after an "unreachable" label (see infloop in
875 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
876 This is still "wrong", but anything better would probably need a
877 multi-pass algorithm.
878 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
879 usage vector. Force current usage vector to be reachable, to
880 optimistically signify backward jumps.
881 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
883 (FlowBranchingLabeled.Merge): New. If no backward jump was
884 detected, return the original salted-away usage vector instead,
885 updated with appropriate changes. Print unreachable warning if
887 * statement.cs (Block.Resolve): Don't print unreachable warning on
890 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
892 * driver.cs: Pass filename without path to AssemblyBuilder's
893 AddResourceFile. Fixes bug #78407.
895 2006-05-17 Raja R Harinath <rharinath@novell.com>
897 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
898 * flowanalysis.cs (FlowBranchingLabeled): ... here.
899 (FlowBranching.MergeChild): Overwrite
900 reachability information from Labeled branchings too.
902 2006-05-16 Raja R Harinath <rharinath@novell.com>
904 * statement.cs (Goto.Resolve): Merge jump origins here ...
905 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
907 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
908 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
909 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
910 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
912 * statement.cs (Goto.Resolve): ... not here.
913 (Goto.Emit): Remove CS1632 check.
915 2006-05-14 Marek Safar <marek.safar@seznam.cz>
917 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
920 2006-05-11 Raja R Harinath <rharinath@novell.com>
922 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
923 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
924 (FlowBranchingException.Label): Likewise.
926 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
928 (MyBitVector.Or): Use it to avoid losing information (Count).
929 (FlowBranching.MergeOrigins): Likewise.
931 * flowanalysis.cs (UsageVector.IsDirty): Remove.
932 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
933 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
934 (UsageVector.ToString): Simplify.
935 (UsageVector.MergeSiblings): Move here from ...
936 (FlowBranching.Merge): ... here.
937 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
940 2006-05-10 Raja R Harinath <rharinath@novell.com>
942 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
943 null bitvector is treated as all-true.
945 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
946 (MyBitVector): Rationalize invariants. 'vector != null' implies
947 that we have our own copy of the bitvector. Otherwise,
948 'InheritsFrom == null' implies all inherited bits are true.
950 2006-05-09 Marek Safar <marek.safar@seznam.cz>
952 * statement.cs (LocalInfo): Add IsConstant.
953 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
954 local variable for constants.
956 2006-05-09 Raja R Harinath <rharinath@novell.com>
958 * flowanalysis.cs (MyBitVector.Empty): New.
959 (MyBitVector): Don't allow InheritedFrom to be null.
960 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
961 (UsageVector, FlowBranching): Update to changes.
963 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
964 recursion. The 'Parent == null' condition isn't sufficient for
966 (FlowBranching.AddBreakOrigin): Likewise.
967 (FlowBranching.AddContinueOrigin): Likewise.
968 (FlowBranching.AddReturnOrigin): Likewise.
969 (FlowBranching.StealFinallyClauses): Likewise.
970 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
971 (FlowBranching.CheckOutParameters): Likewise.
972 (FlowBranchingToplevel): Terminate all the above recursions here.
973 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
974 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
976 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
978 (FlowBranchingToplevel): New. Empty for now.
979 (FlowBranching.MergeTopBlock): Update.
980 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
981 branching for the anonymous delegate.
982 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
984 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
985 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
986 information at the start of the merge. Reorganize.
988 2006-05-07 Marek Safar <marek.safar@seznam.cz>
990 * class.cs (MethodData.Define): Method cannot implement interface accessor.
992 2006-05-07 Marek Safar <marek.safar@seznam.cz>
994 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
995 to newly introduced ctor.
997 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
998 message to one place.
999 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1002 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1004 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1006 * ecore.cs (Expression.ResolveAsConstant): Updated.
1008 * statement.cs (ResolveMeta): Updated.
1010 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1012 * cs-parser.jay: __arglist cannot be used in initializer.
1014 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1017 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1020 2006-05-05 Raja R Harinath <rharinath@novell.com>
1022 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1023 (LabeledStatement): Add 'name' parameter.
1024 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1025 (Block.AddLabel): Update to changes.
1026 * cs-parser.jay (labeled_statement): Likewise.
1028 * flowanalysis.cs (BranchingType.Labeled): New.
1029 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1030 (FlowBranchingLabeled): New. Does nothing for now, but will
1031 eventually handle 'goto' flows.
1032 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1033 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1034 that's terminated ...
1035 (Block.Resolve): ... here.
1037 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1038 (UsageVector.MergeFinallyOrigins): Likewise.
1039 (FlowBranching.InTryOrCatch): Likewise.
1040 (FlowBranching.AddFinallyVector): Likewise.
1041 (FlowBranchingException): Update to changes.
1044 * statement.cs (Return.Resolve): Move error checking to ...
1045 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1046 (FlowBranchingException): Handle return origins like break and
1048 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1050 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1053 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1056 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1059 * class.cs (MethodData.Define): Do public accessor check only when method
1060 implements an interface.
1062 2006-05-04 Raja R Harinath <rharinath@novell.com>
1064 Remove special handling of 'break'
1065 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1066 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1067 (UsageVector.Break): Remove.
1068 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1070 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1072 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1073 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1075 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1078 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1079 be the interface member.
1081 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1084 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1085 for emitting small (int) values.
1087 2006-05-03 Raja R Harinath <rharinath@novell.com>
1090 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1091 control-flow passes through the 'finally' after merging-in all the
1092 control-flows from 'try' and the 'catch' clauses.
1094 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1095 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1096 always true at the only non-recursive entry point.
1097 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1098 FlowBranchingBreakable.
1099 (FlowBranchingLoop): Remove.
1100 * statement.cs (Return.DoResolve): Update to changes.
1103 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1104 (FlowBranching.CreateBranching): Handle it: create a
1105 FlowBranchingContinuable.
1106 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1107 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1108 except that it handles the 'continue' command.
1109 (FlowBranching.UsageVector.MergeOrigins): Rename from
1111 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1112 except that it overrides AddContinueOrigin.
1113 (FlowBranchingException): Override AddContinueOrigin, similar to
1115 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1116 Create a new branching around the embedded statement.
1117 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1118 control flow after the embedded statement.
1119 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1121 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1122 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1123 FlowBranchingBreakable.
1124 (FlowBranchingSwitch): Remove.
1127 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1128 error reporting to ...
1129 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1130 Rename from 'AddBreakVector'. Add new location argument. Return
1131 a bool indicating whether the 'break' crosses an unwind-protect.
1132 (FlowBranchingException.AddBreakOrigin): Add.
1133 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1134 flowbranching after updating with the effects of the 'finally'
1136 (FlowBranchingBreakable): New common base class for
1137 FlowBranchingLoop and FlowBranchingSwitch.
1139 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1141 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1143 2006-05-02 Raja R Harinath <rharinath@novell.com>
1145 * statement.cs (Do.Resolve): If the loop is infinite, set the
1147 (While.Resolve, For.Resolve): Set a barrier after the embedded
1148 statement. There's no direct control flow that goes from the end
1149 of the embedded statement to the end of the loop.
1150 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1151 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1152 above ensure that the reachability is correctly computed.
1154 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1155 (UsageVector.MergeBreakOrigins): If the current path is
1156 unreachable, treat it as if all parameters/locals are initialized.
1157 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1158 infinite loops before merging-in break origins.
1160 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1161 (Reachability.Reachable): Split part into ...
1162 (Reachability.Unreachable): ... this. Simplify.
1163 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1165 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1166 (Reachability.SetThrowsSometimes): Likewise.
1167 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1168 TriState.Always, use corresponding property.
1169 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1170 (Block.Resolve): Likewise. Remove some redundant checks.
1172 2006-05-02 Raja R Harinath <harinath@gmail.com>
1174 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1175 (Reachability.Meet): Don't bother checking AlwaysThrows --
1176 barrier is always set.
1177 (FlowBranchingBlock.Merge): Likewise.
1179 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1181 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1182 defined, so it's references should also compile only for NET_2_0
1183 (as occurs in mcs version)
1185 2006-05-01 Raja R Harinath <harinath@gmail.com>
1187 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1188 checks for unreachable.
1190 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1193 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1195 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1196 whether field is really assigned.
1198 2006-04-30 Raja R Harinath <harinath@gmail.com>
1200 * flowanalysis.cs (Reachability): Make 4-argument constructor
1202 (Reachability.Meet): Rename from 'And'. Remove static variant.
1203 (Reachability.Always): Rename from the highly misleading
1204 'Reachability.Never'.
1205 (FlowBranching.Merge): Update to changes. Mark an impossible
1206 situation with a 'throw'.
1207 (*): Update to changes.
1209 2006-04-29 Raja R Harinath <harinath@gmail.com>
1211 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1213 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1214 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1215 (*): Update to changes.
1216 * statement.cs: Update to changes.
1218 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1221 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1223 2006-04-28 Raja R Harinath <harinath@gmail.com>
1225 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1228 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1229 argument to two arguments: an usage-vector and a bool. Move call
1230 to FlowBranching.Merge () ...
1231 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1233 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1234 handling of loop and switch reachability to ...
1235 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1237 2006-04-27 Raja R Harinath <harinath@gmail.com>
1239 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1240 handling to FlowBranchingLoop.InLoop.
1241 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1243 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1246 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1247 anonymous method is allowed from AnonymousContainer here.
1249 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1251 2006-04-24 Raja R Harinath <rharinath@novell.com>
1254 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1256 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1259 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1260 (DoubleConstant.Reduce): Ditto.
1262 2006-04-23 Raja R Harinath <rharinath@novell.com>
1264 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1265 Remove 'lvalue_right_side' argument. Move parts to ...
1266 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1267 (LocalVariable.DoResolveLValue): ... these.
1269 2006-04-21 Raja R Harinath <rharinath@novell.com>
1272 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1273 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1274 (LocalVariableReference.DoResolveBase): Use it to implement new
1276 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1277 (Argument.Resolve): Simplify. Move CS1510 check ...
1278 * ecore.cs (Expression.ResolveLValue): ... here.
1279 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1280 (PropertyExpr.DoResolveLValue): Likewise.
1281 (FieldExpr.Report_AssignToReadonly): Likewise.
1282 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1283 LValueMemberAccess or LValueMemberOutAccess on instance depending
1285 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1286 DoResolve as appropriate.
1288 2006-04-20 Raja R Harinath <rharinath@novell.com>
1291 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1292 implicit conversions on 'out' and 'ref' arguments.
1294 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1295 improve clarity. Remove dead code.
1298 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1299 (Catch.Resolve): Resolve VarBlock if it exists.
1301 2006-04-19 Miguel de Icaza <miguel@novell.com>
1303 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1304 twice, this was some residual code, the enumerator was emitted
1305 properly in the two branche of if later.
1309 Thanks to Martin for finding the source of the problem
1311 2006-04-19 Raja R Harinath <rharinath@novell.com>
1313 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1314 cast is never an lvalue.
1315 (Cast.DoResolve, Cast.ResolveRest): Combine.
1316 (Argument.Emit): Simplify slightly. Move 'Expr is
1317 IMemoryLocation' check ...
1318 (Argument.Resolve): ... here.
1319 (Argument.Error_LValueRequired): Remove. Inline into only user.
1321 Simplifications. Fix cs0191-2.cs
1322 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1323 CS1649 and CS1651 to ...
1324 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1325 the actual selection of the error code and message to a lookup
1326 table. Add a dummy return value to simplify callsites.
1327 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1328 readonly fields of other instances of the same type. Move CS0197
1330 * expression.cs (Argument.Resolve): ... here. Simplify code.
1331 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1332 resolution of an out or ref argument. The code simplification
1333 above uses this invariant.
1335 2006-04-18 Raja R Harinath <rharinath@novell.com>
1337 Possibly fix #77752. Fix cs1690-[4-7].cs.
1338 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1339 CheckMarshallByRefAccess. Drop parameter.
1340 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1342 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1344 * report.cs (AllWarnings): Add CS1690.
1345 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1347 (LocalVariableReference.DoResolveBase): Update.
1349 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1351 * class.cs (MethodOrOperator): Moved common parts from method class.
1352 detect obsolete attributes.
1353 (Method.Define): Simplified as it reuses code from base.
1354 (Constructor.ValidAttributeTargets): Fixed issue found during
1356 (Destructor.ValidAttributeTargets): Fixed issue found during
1358 (Operator): Finished refactoring set off by #78020. Operator class is now
1359 ordinary method class.
1361 * anonymous.cs: Updated.
1363 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1365 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1367 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1369 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1370 detect obsolete attributes.
1371 (Method.CreateEmitContext): Moved to MethodOrOperator.
1373 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1376 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1377 customized exception to make crash detection easier.
1378 (MethodOrOperator): Started to work on new base class for methods and
1380 (Method): Derives from MethodOrOperator.
1381 (Constructor.Emit): Emits its own attributes.
1382 (AbstractPropertyEventMethod.Emit): Ditto.
1383 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1385 (Operator.Emit): It's temporary more tricky than should be.
1387 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1389 * report.cs (InternalErrorException): Add ctor with inner exception.
1391 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1394 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1397 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1400 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1403 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1405 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1406 attribute is present and Guid not.
1407 (Interface.ApplyAttributeBuilder): Ditto.
1409 * attribute.cs: Add error message.
1411 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1415 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1416 sources (it's composite) so hold them in extra array as they are used in
1417 Emit phase only. It worked in the previous versions by mistake.
1418 (Attribute.Emit): Emit attribute for more owners when exist.
1420 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1421 it has now different behaviour.
1423 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1425 * constant.cs (Constant.IsDefaultInitializer): New method.
1427 * class.cs: Updated.
1429 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1430 re-initialize default values. It saves KBs almost for every assembly.
1431 Thanks Zoltan for the idea.
1432 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1433 (ArrayCreation.DoResolve): Resolve only once.
1434 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1435 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1437 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1439 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1442 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1444 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1445 in an embedded statement too.
1447 2006-04-01 Raja R Harinath <rharinath@novell.com>
1450 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1454 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1457 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1458 arguments before checking whether a type is reflected or not.
1461 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1462 definition doesn't take part in overload resolution.
1463 (Invocation.IsParamsMethodApplicable): Likewise.
1464 (Invocation.OverloadResolve): When replacing a reflected override
1465 method with its base definition, ensure that type arguments are
1468 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1472 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1475 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1477 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1479 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1482 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1483 LocalTemporary change.
1485 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1487 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1488 initializers optimization.
1489 (ClassOrStruct.TypeAttr): Moved from modifiers.
1490 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1491 (FieldBase.ResolveInitializer): Resolves initializer.
1492 (FieldBase.HasDefaultInitializer): New property.
1494 * cs-parser.jay: Removed message.
1496 * expression.cs (CompilerGeneratedThis): New specialization.
1498 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1500 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1502 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1504 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1506 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1507 be now EnumConstants only.
1509 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1511 * attribute.cs, driver.cs: Reset more caches.
1513 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1515 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1517 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1519 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1520 for easier reuse. Updated all overrides.
1521 (IntegralConstant): New base class for all integral constants.
1522 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1523 of the constant range, report custom error.
1524 (UIntConstant.Reduce): Fixed uint conversion.
1526 * ecore.cs, literal.cs: Reduce updates.
1528 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1532 * class.cs (Constructor.Define): Removed extra if for default ctors.
1533 A patch from Atsushi Enomoto.
1535 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1537 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1538 GetAttributableValue.
1540 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1543 * convert.cs (ImplicitConversionRequired): Error message moved to
1546 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1547 automatic implicit conversion of an output value.
1548 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1550 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1552 (TypeOf.GetAttributableValue): Add extra handling for object type.
1554 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1555 special error message.
1557 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1559 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1561 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1562 compatible with MS runtime.
1564 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1566 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1567 attribute arguments here.
1569 * class.cs (Indexer.Define): The check was moved to attribute class.
1571 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1573 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1575 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1577 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1579 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1582 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1584 * doc-bootstrap.cs : fix build.
1586 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1588 * expression.cs (StringConcat.Append): Issue a warning when empty string
1591 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1593 * assign.cs (CompoundAssign.ResolveSource): Removed.
1595 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1598 * class.cs (TypeContainer.FindMethods): Removed.
1599 (TypeContainer.CheckMemberUsage): Made static.
1601 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1603 * constant.cs (CheckRange): Removed unused type argument.
1604 (CheckUnsigned): Removed unused type argument.
1606 * cs-parser.jay: Updated after MemberAccess clean up.
1607 Uses Length for empty string test.
1609 * cs-tokenizer.cs: Uses Length for empty string test.
1610 (IsCastToken): Made static.
1611 (is_hex): Made static.
1612 (real_type_suffix): Made static.
1614 * decl.cs (SetupCache): Made static.
1615 (OnGenerateDocComment): Removed unused ds argument.
1617 * delegate.cs (VerifyDelegate): Removed unused argument.
1619 * doc.cs: Uses Length for empty string test.
1621 * driver.cs: Uses Length for empty string test.
1623 * enum.cs (IsValidEnumType): Made static
1625 * expression.cs (EnumLiftUp): Removed unused argument.
1626 (ResolveMethodGroup): Ditto.
1627 (BetterConversion): Ditto.
1628 (GetVarargsTypes): Ditto.
1629 (UpdateIndices): Ditto.
1630 (ValidateInitializers): Ditto.
1631 (MemberAccess.ctor): Ditto.
1632 (GetIndexersForType): Ditto.
1634 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1636 * iterators.cs: Updated after MemberAccess clean up.
1638 * location.cs: Uses Length for empty string test.
1640 * namespace.cs: Uses Length for empty string test.
1642 * report.cs (CheckWarningCode): Made static.
1644 * statement.cs (LabeledStatement): Removed unused argument.
1646 * typemanager.cs (FilterNone): Removed.
1648 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1650 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1653 * class.cs: Updated.
1655 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1657 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1659 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1663 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1665 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1666 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1667 Add more error reporting; Fixed issue with params.
1669 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1671 * cs-parser.jay: AnonymousMethod requires host container.
1673 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1675 2006-03-18 Raja R Harinath <harinath@gmail.com>
1677 * class.cs: Change 'TypeContainer ds' constructor argument to
1678 'DeclSpace parent'. Some classes were missed below due to
1679 different naming convention.
1681 * class.cs (MemberCore.Parent): Delete. This makes the
1682 ParentContainer changes below enforceable by the compiler.
1684 Treat pointers to enclosing declaration space as 'DeclSpace', not
1686 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1687 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1689 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1691 (Block.AddThisVariable): Likewise.
1692 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1693 (AbstractPropertyEventMethod.Emit): Likewise.
1694 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1695 (GetMethod.Define, SetMethod.Define): Likewise.
1696 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1697 (DelegateMethod.EmitMethod): Likewise.
1699 Fix regression test-partial-13.cs.
1700 Rationalize use of PartialContainer. Ensure that the partial
1701 class semantics can be tied to type-correctness, i.e., any
1702 violation will cause a compile error.
1703 * class.cs, const.cs: Access all fields that belong to class
1704 TypeContainer via ParentContainer. Arguments of EmitContexts and
1705 Resolve()-like functions still use 'Parent'.
1707 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1708 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1709 (PropertyMethod.CheckModifiers): Remove unused argument.
1710 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1713 2006-03-28 Raja R Harinath <rharinath@novell.com>
1715 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1717 2006-03-17 Raja R Harinath <harinath@gmail.com>
1719 Make semantics of PartialContainer simpler.
1720 * decl.cs (DeclSpace.IsPartial): Remove.
1721 * class.cs (TypeContainer.IsPartial): Likewise.
1722 (TypeContainer..ctor): Set PartialContainer to point to self.
1723 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1724 (TypeContainer.FindNestedType): Likewise.
1725 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1727 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1729 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1731 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1733 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1736 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1738 * class.cs (Operator.Define): An error for base conversion was not
1741 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1743 A fix for #77593, #77574.
1745 * class.cs (MethodCore.CheckBase): Another if for operator.
1747 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1751 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1752 reporting, it's more tricky than I thought.
1754 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1756 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1759 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1760 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1763 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1766 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1770 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1771 (Event.Define): ditto
1772 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1774 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1775 Removed redundant code and set NewSlot for Invoke method too.
1777 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1778 (Parameters.MergeGenerated): New method. Use this method when you merge
1779 compiler generated argument with user arguments.
1781 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1783 * attribute.cs (ResolveAsTypeTerminal): Removed.
1785 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1786 specialization for predefined types; 30% speed up.
1787 Finally placed obsolete check to right place.
1788 (Expression.ResolveType): Removed.
1790 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1791 Updated after ResolveType was removed.
1793 * expression.cs (Cast.ctor): Check void cast.
1794 (Binary.ResolveAsTypeTerminal): Is never type.
1795 (Conditional.ResolveAsTypeTerminal): Is never type.
1797 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1799 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1801 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1803 2006-03-23 Martin Baulig <martin@ximian.com>
1805 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1806 type check if either of the types is an open generic type.
1808 2006-03-23 Martin Baulig <martin@ximian.com>
1811 (Convert.ExplicitTypeParameterConversion): New method; implement
1812 explicit type parameter conversions.
1814 2006-03-23 Martin Baulig <martin@ximian.com>
1816 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1817 blindly allow all conversions if we do not have any constraints.
1819 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1821 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1822 these two separated members to simplify the code.
1823 (Attribute.Resolve): Refactored to use new fields and methods.
1824 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1825 implemented obsolete attribute checking.
1826 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1827 implemented obsolete checking again. It look line never ending quest ;-)
1828 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1830 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1832 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1834 *class.cs (Property.Define): Add RegisterProperty call.
1836 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1837 argument groups (only 2).
1839 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1840 encoding expression to arguments.
1841 (Expression.ExprClassToResolveFlags): Just turned to property.
1843 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1844 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1845 optimized as well as implemented support for zero-length attributes.
1847 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1848 Add caching of PropertyInfo's.
1850 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1852 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1853 error multiple times.
1855 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1857 New partial class implementation.
1858 A fix for #77027, #77029, #77403
1860 * attribute.cs (Attributable): Made attributes protected.
1862 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1863 the replacements of ClassPart and PartialContainer.
1864 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1865 (TypeContainer.AddInterface): Ditto.
1866 (TypeContainer.AddPartial): The main method for partial classes. It checks
1867 for errors and merges ModFlags and attributes. At the end class is added to
1869 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1871 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1872 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1873 from the rest of partial classes.
1874 (TypeContainer.GetClassBases): Simplified.
1875 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1877 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1878 (TypeContainer.HasExplicitLayout): Uses Flags now.
1879 (PartialContainer): Removed.
1880 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1881 (StaticClass): Was merged with Class.
1882 (Class.GetClassBases): class and static class bases are verified here.
1883 (Class.TypeAttr): Added static attributes when class is static.
1884 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1885 (MemberBase): In some cases we need to call parent container for partial
1886 class. It should be eliminated but it's not easy now.
1888 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1890 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1891 partial classed to accumulate class comments.
1892 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1894 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1896 * driver.cs (MainDriver): Tree.GetDecl was removed.
1898 * modifiers.cs (Modifiers): Add partial modifier.
1900 * tree.cs (Tree.decl): Removed.
1901 (RootTypes): Started to use this class more often for root types
1904 2006-03-23 Raja R Harinath <rharinath@novell.com>
1906 * generic.cs (TypeParameter.UpdateConstraints): Update
1907 'constraints' if null.
1909 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1913 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1914 external interface does not have an attribute.
1916 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1918 Another prerequisites for new partial classs implementation.
1920 * attribute.cs (Attribute.Equal): Implemented.
1921 (Attribute.Emit): Changed as attributes can be applied more than twice.
1922 (Attributes.Emit): Check for duplicate attributes here.
1924 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1925 as a parameter, clean-up.
1927 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1931 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1932 contains obsolete attribute check which can in some cases look for base
1933 type of current class which is not initialized yet.
1934 (TypeContainer.BaseType): Replacement of ptype.
1936 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1938 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1940 First of prerequisites for new partial classs implemention.
1942 * attribute.cs (Attributable): Extended by ResolveContext;
1943 Attributes finally have correct context for resolving in all cases.
1944 (AttachTo): Attribute owner is assigned here.
1946 * codegen.cs (IResolveContext): Introduce new interface to hold
1947 all information needed in resolving phase.
1948 (EmitContext): Implements IResolveContext; more clean-up needed here.
1950 * decl.cs (MemberCore): Implemented IResolveContext.
1952 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1953 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1954 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1955 Refactored to use new IResolveContext instead of EmitContext; cleanup
1957 2006-03-22 Raja R Harinath <rharinath@novell.com>
1959 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1960 mcs to keep code differences small.
1961 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1962 * typemanager.cs (parameter_default_value_attribute_type): New.
1963 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1966 2006-03-22 Martin Baulig <martin@ximian.com>
1969 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1972 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1973 instead of the normal `NullLiteral'.
1975 2006-03-21 Martin Baulig <martin@ximian.com>
1978 * generic.cs (TypeManager.InferType): If `pt' is a generic
1979 parameter, don't check whether `pt == at'.
1981 2006-03-20 Raja R Harinath <rharinath@novell.com>
1984 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1985 (TypeParameter.Resolve): Update to change.
1986 (ConstraintChecker.CheckConstraints): Resolve type-argument
1987 constraints before use.
1989 2006-03-16 Martin Baulig <martin@ximian.com>
1992 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1993 and don't have any instance constructors, also lookup in the base class.
1994 (TypeManager.IsNullableValueType): New public method.
1996 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1997 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1998 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2000 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2001 instead of just TypeManager.IsNullableType() to determine whether
2002 a lifted operator exists.
2003 (UnaryMutator.DoResolve): Likewise.
2004 (Conditional.DoResolve): Likewise.
2005 (Binary.DoResolve): A lifted operator only exists if both operands
2006 are valuetypes and at least one of them is a nullable type.
2008 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2010 * iterator.cs : yield break is allowed in try statement which has
2011 catch clauses. Fixed bug #77767.
2013 2006-03-12 Martin Baulig <martin@ximian.com>
2015 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2016 private IsSignatureEqual() to compare types; see the comment in
2017 that method; fixes #77674.
2019 2006-03-10 Raja R Harinath <rharinath@novell.com>
2021 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2022 (Expression.ResolveAsTypeTerminal): Likewise.
2023 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2024 * expression.cs, generic.cs, iterators.cs: Likewise.
2025 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2027 2006-03-09 Martin Baulig <martin@ximian.com>
2029 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2030 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2032 2006-03-09 Martin Baulig <martin@ximian.com>
2034 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2035 `prepared' flag is set.
2037 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2038 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2039 issues; see gtest-254.cs.
2041 2006-03-07 Martin Baulig <martin@ximian.com>
2043 * generic.cs (TypeManager.InferType): Allow infering
2044 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2046 2006-03-06 Martin Baulig <martin@ximian.com>
2049 (TypeManager.InferType): Fix gtest-250.cs.
2052 (TypeManager.IsSubclassOf): Also check the base class.
2055 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2058 2006-03-01 Raja R Harinath <rharinath@novell.com>
2061 * expression.cs (ParameterReference.DoResolveBase): Change return
2063 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2067 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2070 * typemanager.cs (GetFullNameSignature): Don't nullref on
2071 protected accessors.
2073 2006-02-16 Martin Baulig <martin@ximian.com>
2076 (TypeManager.GetGenericFieldDefinition): New public method; use it
2077 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2079 2006-02-14 Martin Baulig <martin@ximian.com>
2081 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2083 2006-02-14 Martin Baulig <martin@ximian.com>
2086 (TypeManager.DropGenericMethodArguments): New public method; don't
2087 use GetGenericMethodDefinition() on something which is not a
2090 2006-02-14 Martin Baulig <martin@ximian.com>
2093 (ConstraintChecker.CheckConstraints): If a type parameter has the
2094 `struct' constraint, the type must be a non-nullable valuetype.
2096 2006-02-10 Martin Baulig <martin@ximian.com>
2099 (TypeManager.IsOverride): Make this work for instantiated methods
2100 in a generic class; fixes #77509.
2101 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2102 rather than calling it directly; fixes #77488.
2104 2006-02-08 Martin Baulig <martin@ximian.com>
2106 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2107 reporting into CheckConstraint() so we can use the correctly
2110 2006-02-08 Martin Baulig <martin@ximian.com>
2112 * expression.cs (BaseAccess): Add support for generic methods.
2114 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2115 the new MethodGroupExpr.
2117 2006-02-07 Martin Baulig <martin@ximian.com>
2119 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2120 also reference types; fixes #77483.
2122 2006-02-07 Martin Baulig <martin@ximian.com>
2125 (TypeManager.IsGenericMethod): We now return whether something is
2126 an instantiated generic method (and not a generic method def).
2127 (TypeManager.IsGenericMethodDefinition): New public method.
2130 (TypeManager.CSharpSignature): Only include type arguments for
2131 "real" generic methods, not for any instantiated method.
2132 (TypeManager.GetMethodName): Likewise, but also allow generic
2133 method definitions here.
2135 2006-02-06 Miguel de Icaza <miguel@novell.com>
2137 * codegen.cs (EmitScopeInitFromBlock): check here the
2138 capture_context, there is no need to make two calls to the
2141 * anonymous.cs: Add some debugging messages that might help me
2142 track other instances of this problem in the future (the
2143 regression of test 467).
2145 * cs-parser.jay: track the variable block, as we need to initalize
2146 any captured variables declared in this block for the "catch"
2147 portion of the "Try" statement.
2149 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2150 scope initialization for captured variables.
2152 Also, move the emit for the variables after the block location has
2155 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2157 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2159 2006-02-06 Martin Baulig <martin@ximian.com>
2161 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2162 `TypeManager.value_type' as parent type to
2163 ModuleBuilder.DefineType(). Fixes #77358.
2165 2006-02-02 Miguel de Icaza <miguel@novell.com>
2167 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2168 commit yesterday, the initialization for the roots is necessary.
2169 What is not necessary is the scope activation.
2171 2006-02-02 Raja R Harinath <rharinath@novell.com>
2173 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2174 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2176 (Argument.Resolve): Remove CS0206 checks.
2178 2006-02-01 Miguel de Icaza <miguel@novell.com>
2180 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2181 scopes for all the roots, the scopes will now be emitted when the
2182 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2184 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2185 code. This reduces a lot of existing cruft.
2187 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2188 that the ScopeInfo is generated as we enter the scope, not at the
2189 time of use, which is what we used to do before.
2191 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2192 every time a Block is about to be emitted if we have a
2195 2006-02-01 Raja R Harinath <rharinath@novell.com>
2197 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2198 attribute for mscorlib too.
2200 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2202 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2204 * typemanager.cs (cons_param_array_attribute): Make private.
2205 (Reset): Set it to null.
2206 (InitCoreHelpers): Don't initialize it.
2207 (ConsParamArrayAttribute): New. Initialize it as needed.
2208 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2210 2006-01-31 Miguel de Icaza <miguel@novell.com>
2212 * expression.cs: There might be errors reported during the
2213 selection of applicable methods. If there are errors, do not
2214 continue execution as it will lead the compiler to crash.
2216 2006-01-30 Miguel de Icaza <miguel@novell.com>
2218 * expression.cs: Member access is not allowed on anonymous
2219 methods. Fixes #77402.
2221 2006-01-30 Raja R Harinath <rharinath@novell.com>
2224 * cs-parser.jay (VariableDeclaration): Don't set
2225 current_array_type to null.
2226 (field_declaration, event_declaration, declaration_statement):
2227 Set it to null here.
2229 2006-01-29 Raja R Harinath <harinath@gmail.com>
2232 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2234 2006-01-28 Raja R Harinath <harinath@gmail.com>
2236 * typemanager.cs (GenericParameterPosition): New.
2239 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2241 * doc.cs : To process "include" elements, first we should create
2242 another list than XmlNodeList, because it could result in node
2243 removal, which could result in that the XmlNodeList gives up
2246 2006-01-25 Miguel de Icaza <miguel@novell.com>
2248 * expression.cs: Introduce an error report that we were not
2249 catching before. Gonzalo ran into it.
2251 2006-01-23 Miguel de Icaza <miguel@novell.com>
2253 A fix for bug: #76957
2255 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2256 ComputeMethodHost before creating the method, this is a new
2259 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2260 that this method references (RegisterScope). The actual scope
2261 where the method is hosted is computed with the ComputeMethodHost
2262 before we create the method.
2264 Moved the Deepest routine here.
2266 (AnonymousContainer.ComputeMethodHost): New routine used to
2267 compute the proper ScopeInfo that will host the anonymous method.
2269 (ScopeInfo): Deal with multiple roots. The problem was that we
2270 did not have a unique root where all ScopeInfos could be hanged
2271 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2274 Remove AdjustMethodScope which is now computed at the end. Remove
2275 LinkScope which did a partial link, instead link all ScopeInfos
2276 before code generation from the new "LinkScopes" routine.
2278 Simplify all the Add* routines as they no longer need to maintain
2279 the tree, they just need to record that they are using variables
2282 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2283 routines to produce the forest of ScopeInfo trees.
2285 * class.cs (TypeContainer.AppendMethod): This is just like
2286 AddMethod, but ensures that an interface implementation method
2287 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2288 methods, but at the end.
2290 We use this functionality to ensure that the generated MoveNext
2291 method in the iterator class is resolved/emitted before the
2292 enumerator methods created.
2294 This is required because the MoveNext method computes the right
2295 ScopeInfo for the method. And the other methods will eventually
2296 need to resolve and fetch information computed from the anonymous
2300 2006-01-23 Raja R Harinath <rharinath@novell.com>
2302 Improve implementation of section 14.4.2.2 (Better function member).
2303 * expression.cs (Invocation.MoreSpecific): Compare all type
2304 arguments before deciding if one type is more specific than
2305 another. Handle array types too. Return the more specific type.
2306 (Invocation.BetterFunction): Add more tie-breaking rules from
2307 section 14.4.2.2. Perform "more specific" check after
2308 other tie-breaking rules. Compare all parameter types before
2309 choosing the "more specific" method.
2311 2006-01-21 Raja R Harinath <harinath@gmail.com>
2312 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2315 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2317 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2318 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2320 2006-01-18 Martin Baulig <martin@ximian.com>
2322 * class.cs (TypeContainer.AddToMemberContainer): Use
2323 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2326 2006-01-18 Martin Baulig <martin@ximian.com>
2328 Fix #76417: a generic class may now have methods which may unify
2329 for some type parameter substitutions.
2331 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2332 for methods which may unify anymore.
2334 * expression.cs (Invocation.MoreSpecific): New private static
2335 method; checks whether one method is more specific than another
2336 according to 14.4.2.2 of the spec.
2337 (Invocation.BetterFunction): Implement the tie-breaking rules from
2338 14.4.2.2 of the spec: if two methods unify for some type parameter
2339 substitution, we need to pick the more specific one.
2341 2006-01-18 Raja R Harinath <rharinath@novell.com>
2343 Fix #76656, cs0231-2.cs.
2344 * cs-parser.jay (formal_parameter_list): Make error case catch
2346 (parenthesized_expression_0): Add CS1026 check.
2347 (invocation_expression): Remove unused { $$ = lexer.Location }.
2349 2006-01-17 Raja R Harinath <rharinath@novell.com>
2352 * cs-parser.jay (statement_expression): Don't list out the
2353 individual statement-expressions. Convert syntax error into
2356 2006-01-16 Raja R Harinath <rharinath@novell.com>
2359 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2360 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2361 CheckIntermediateModification.
2362 (FieldExpr.DoResolve): Add new two-argument version that
2363 allows us to resolve the InstanceExpression as an lvalue.
2364 The one-argument variant is now just a wrapper.
2365 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2366 Resolve the lhs as an lvalue if the it has a value type.
2367 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2368 from Assign.DoResolve.
2369 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2370 resolved as an lvalue.
2371 (PropertyExpr.DoResolve): Update.
2372 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2373 has a value type. Move CS1612 check here from
2374 CheckIntermediateModification.
2375 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2376 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2377 'right_side' of a ResolveLValue on an 'out' argument.
2378 (EmptyExpression.LValueMemberAccess): New. Used as the
2379 'right_side' of a propagated ResolveLValue on a value type.
2380 (LocalVariableReference.DoResolveBase): Recognize
2381 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2383 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2384 EmptyExpression.Null.
2386 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2388 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2389 Type.IsGenericParameter(). Fixed bug #77183.
2390 * doc.cs : it is now identical to doc.cs in mcs.
2392 2006-01-16 Martin Baulig <martin@ximian.com>
2394 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2396 2006-01-16 Martin Baulig <martin@ximian.com>
2398 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2399 ctors; fixes #77250.
2401 2006-01-12 Miguel de Icaza <miguel@novell.com>
2403 This fixes the problem where we used ldfld instead of ldflda to
2404 load the "THIS" pointer on captured parameters, when THIS is a
2405 value type. See bug #77205.
2407 * iterators.cs (CapturedThisReference.Emit): Pass false to
2408 EmitThis (we do not need the address).
2410 * codegen.cs (EmitThis): it needs to know whether we need the
2411 address of `this' or not. This is used by value types.
2413 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2414 every other call passes false.
2416 2006-01-12 Raja R Harinath <rharinath@novell.com>
2419 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2421 * expression.cs (Invocation.OverloadResolve): Update.
2422 (Invocation.DoResolve): Avoid double resolution of invocation.
2424 2006-01-11 Raja R Harinath <rharinath@novell.com>
2427 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2428 unary negation of floating point types as 0-expr; negation cannot
2429 overflow in floating point types.
2432 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2433 on operands of 'void' type.
2436 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2437 and ExclusiveOr for boolean constants too.
2439 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2441 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2443 2006-01-12 Miguel de Icaza <miguel@novell.com>
2445 * cs-tokenizer.cs (Position): New class used to save and restore
2446 the position state in the tokenizer. Before this patch the save
2447 and restore was not complete enough so the line and columns would
2448 start to drift and the debugger and stack traces will get the
2451 2006-01-10 Martin Baulig <martin@ximian.com>
2454 (TypeParameter.InflateConstraints): New public method.
2456 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2457 constraints; fixes #77042.
2459 2006-01-10 Martin Baulig <martin@ximian.com>
2461 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2462 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2465 2006-01-09 Raja R Harinath <rharinath@novell.com>
2468 * expression.cs (Invocation.OverloadResolve): Replace reflected
2469 override methods with their base virtual methods, rather than
2471 * typemanager.cs (TypeManager.GetOverride): New.
2473 2005-12-21 Miguel de Icaza <miguel@novell.com>
2475 * driver.cs: Report the case of no source files and no -out:
2478 2005-12-20 Raja R Harinath <rharinath@novell.com>
2481 * expression.cs (ComposedCast.GetSignatureForError): Define.
2483 2006-01-05 Jb Evain <jbevain@gmail.com>
2485 * class.cs (Property.Define, Indexer.Define): do not tag the
2486 properties as SpecialName | RTSpecialName.
2488 2006-01-04 Miguel de Icaza <miguel@novell.com>
2490 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2491 doing a low-level comparission of parameter types. It was lacking
2492 a check for __argslist.
2494 2005-12-30 Miguel de Icaza <miguel@novell.com>
2496 * expression.cs (ParameterReference.DoResolveBase): Allow
2497 reference parameters if they are local to this block.
2499 This allows the ref and out parameters of a delegate to be used in
2500 an anonymous method, for example:
2502 delegate void set (out int x);
2504 set s = delegate (out int x){
2508 This is used by functionality introduced late in the C# language.
2510 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2511 method that take ref and out parameters.
2513 Fixes #77119 which was a late change in the spec.
2515 2005-12-23 Miguel de Icaza <miguel@novell.com>
2517 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2518 parent if its the same scope. Fixes #77060.
2520 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2522 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2524 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2526 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2527 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2528 that doesn't contain the full public key. This is a update of the
2529 friend assemblies in .Net 2.0 release.
2531 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2535 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2536 ListDictionary, to contain the ExternAliasEntry entries (in
2537 addition to the NamespaceEntry.aliases hashtable). This field is
2538 shared between the original entry and its doppelganger (bodyless
2540 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2541 extern_aliases field.
2542 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2543 lookup in extern_aliases.
2545 2005-12-16 Raja R Harinath <rharinath@novell.com>
2548 * class.cs (TypeContainer.Mark_HasEquals): New.
2549 (TypeContainer.Mark_HasGetHashCode): New.
2550 (ClassPart): Override them.
2551 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2553 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2554 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2558 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2559 'parent' argument to the base constructor.
2561 Remove all mention of TypeContainer from decl.cs.
2562 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2563 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2564 (DeclSpace.DeclSpace): Likewise.
2565 (DeclSpace.DefineMembers): Remove unused argument.
2566 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2567 debugging check -- we don't care if the debug code throws an
2568 InvalidCastException instead of an InternalErrorException.
2569 * class.cs (TypeContainer.DefineMembers): Update to changes.
2570 (TypeContainer.DoDefineMembers): Likewise.
2571 (TypeContainer.GetMethods): Likewise.
2572 (PropertyMember.Define): Likewise.
2573 (MemberBase.Parent): New property that forwards to
2574 MemberCore.Parent, but ensures that we get a TypeContainer.
2575 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2576 (RootContext.PopulateTypes): Likewise. Remove special case code
2577 for !RootContext.StdLib: DefineMembers is idempotent.
2579 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2581 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2583 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2585 * doc.cs : The search for referenced namespace was insufficient to
2586 get global one as it used to do. Fixed bug #76965.
2588 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2590 * doc.cs : check name in cref in the last phase that whether it is
2593 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2595 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2598 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2600 * doc.cs : so it turned out that we cannot skip override check for
2601 interface members. Fixed bug #76954.
2603 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2605 * cs-tokenizer.cs : fixed bug #75984:
2606 - #warning and #error should not be handled when the source line
2608 - #line is not checked strictly when the source line is disabled.
2609 - #define and #undef is on the other hand checked strictly at any
2612 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2614 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2617 2005-12-15 Raja R Harinath <rharinath@novell.com>
2619 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2621 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2624 2005-12-14 Martin Baulig <martin@ximian.com>
2626 * typemanager.cs (TypeManager.GetFullName): Make this public;
2627 `Type.Fullname' now never returns null.
2629 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2630 explicit interface implementations; we're now using the same
2631 naming convention than csc does.
2633 2005-12-14 Miguel de Icaza <miguel@novell.com>
2635 * convert.cs (ExplicitConversionCore): Check the return value from
2636 ExplicitConversionCore which can return null on failure. Fixes #76914
2638 2005-12-09 Raja R Harinath <rharinath@novell.com>
2640 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2641 instead of IsGenericInstance.
2642 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2643 code that's now covered by the more general test.
2644 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2646 * generic.cs (DropGenericTypeArguments): New. Captures the common
2647 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2648 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2649 * generic.cs, report.cs, typemanager.cs: Likewise.
2651 2005-12-08 Martin Baulig <martin@ximian.com>
2653 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2655 * typemanager.cs (TypeManager.CSharpSignature): Include type
2656 arguments in the signature of a generic method.
2658 2005-12-07 Martin Baulig <martin@ximian.com>
2660 Add support for custom attributes on type parameters.
2662 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2664 * generic.cs (TypeParameterName): New public class; we use this
2665 instead of a `string' to store the name of a type parameter, so we
2666 can also have `Attributes'.
2667 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2668 array instead of a `string[]' array.
2669 (TypeParameter.ctor): We now also take an `Attributes' argument.
2670 (TypeParameter.EmitAttributes): New public method; emit our
2671 `OptAttributes' here.
2672 (GenericMethod.EmitAttributes): New public method; emit the custom
2673 attributes on all our type parameters.
2675 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2676 our type parameters.
2677 (MethodData.Define): If we're a generic method, call
2678 EmitAttributes() on it.
2680 2005-12-07 Martin Baulig <martin@ximian.com>
2683 (ConstraintChecker): New public abstract class; move the
2684 constraint checking here from `ConstructedType' and also do
2685 constraint checking for generic methods here.
2687 * expression.cs (Invocation.OverloadResolve): Use
2688 ConstraintChecker.CheckConstraints() if we resolved to a generic
2691 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2693 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2695 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2697 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2698 (FieldBase.Initializer): Initializer is now optional.
2699 (EventField.Define): Only event field can have initializer.
2701 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2703 * const.cs (Const): Reuse initializer.
2705 * cs-parser.jay: Updated after FieldBase changes.
2706 Added current_array_type to simplify array initializers.
2708 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2710 * expression.cs, iterators.cs: Updated.
2712 * namespace.cs (NamespaceEntry): Made UsingFound private.
2714 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2716 * parameterCollection.cs: Obsolete, removed.
2717 * parser.cs: Obsolete, removed.
2719 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2722 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2724 * enum.cs (Enum.Define): Set obsolete context here.
2726 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2729 - FindDocumentedMember() now expects 1) paramList as null
2730 when "we don't have to check the number of parameters" and
2731 2) Type.EmptyTypes when "there is no arguments".
2732 - Introduced FoundMember struct to hold the exact type which was
2733 used to find the documented member (the above change broke
2734 test-xml-044; it might be better just to use DeclaringType than
2735 what MS does, like this change does, but it depends on usage.)
2737 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2739 * doc.cs : documented member might be from DeclaringType for nested
2740 types. Fixed bug #76782.
2742 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2744 * anonymous.cs: Have the param code handle leaving copies on the
2745 stack etc. Allows anonymous params to take part in the assignment
2746 code (++, +=, etc). Fixes bug #76550
2748 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2749 it down to the anon code.
2751 * iterators.cs: Use dummy var here
2753 * codegen.cs: Handle new vars
2755 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2758 * class.cs (MethodData.Define): Set proper Obsolete context.
2760 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2762 (FieldExpr.DoResolve): Ditto.
2764 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2767 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2768 parent is not obsolete.
2770 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2772 * doc.cs : (FindDocumentedMember) find parameterless members first
2773 and get CS0419 in the early stage. Fixed first case of bug #76727.
2775 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2778 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2779 no error was reported.
2781 *expression.cs (Binary.DoResolve): left can be null.
2783 2005-12-06 Raja R Harinath <rharinath@novell.com>
2785 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2786 abstract method and all overrides.
2787 * support.cs (ParameterData.GenericConstraints): Delete.
2788 (ReflectionParameters.type_params): Delete.
2789 (ReflectionParameters.ReflectionParameters): Make private.
2790 (ReflectionParameters.GetConstaints): New factory method.
2791 * generic.cs (TypeParameterDefineType): Use it.
2792 (TypeManager.GetTypeParameterConstraints): Likewise.
2794 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2797 * class.cs (MethodData.Emit): Parameters should be labeled first.
2799 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2802 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2804 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2806 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2808 * class.cs (MethodCore): Parameter clean up.
2809 (IMethodData): Added ParameterInfo.
2810 (MethodData): Parameter clean up.
2811 (Indexer.Define): Parameter clean up.
2823 * typemanager.cs: Parameter clean up.
2825 * delegate.cs (Define): Get rid of duplicated code.
2827 * expression.cs (ParameterReference): Removed useless parameters
2829 (Invocation): Ditto.
2831 * parameter.cs (ParamsParameter): New class, params specialization.
2832 (ArglistParameter): Attemp to separate arglist.
2833 (Parameter): Refactored to be reusable and faster.
2834 (Parameter.Modifier): Made understandable.
2835 (Parameters): Changed to be used as a class for `this' assembly
2836 parameters. Refactored to use new specialized classes.
2838 * support.cs (ParameterData): Added Types property.
2839 (InternalParameters): Deleted.
2841 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2843 * doc.cs : the previous patch does not actually fix the bug.
2844 PropertyInfo override check is now implemented and really fixed it.
2845 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2847 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2849 * doc.cs : apply "override filter" also to properties.
2852 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2854 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2855 no need to check overrides. For classes, omit those results from
2856 interfaces since they must exist in the class. Fixed bug #76726.
2858 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2860 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2861 with different parameters. Fixed the second problem in #76685.
2863 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2865 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2866 get expected 'protected' access in CheckValidFamilyAccess()).
2869 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2871 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2872 Fixed bug #76705. CS1569 was incorrectly commented out.
2874 2005-11-23 Martin Baulig <martin@ximian.com>
2876 * generic.cs (Constraints.Define): Removed.
2877 (TypeParameter.DefineConstraints): Removed.
2878 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2879 on the GenericTypeParameterBuilder here.
2881 2005-11-23 Martin Baulig <martin@ximian.com>
2883 * typemanager.cs (TypeManager.GetProperty): Make this public.
2885 * generic.cs (Nullable.NullableInfo.ctor): Use
2886 TypeManager.GetProperty() rather than using reflection directly.
2888 2005-11-17 Martin Baulig <martin@ximian.com>
2890 * expression.cs (Indexers.GetIndexersForType): Added support for
2891 generic parameters; fixes #76587.
2893 2005-11-17 Martin Baulig <martin@ximian.com>
2896 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2897 inherit the scope from our parent. Fixes #76653.
2899 2005-11-15 Martin Baulig <martin@ximian.com>
2901 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2902 instead of `ScopeTypeBuilder' to refer to the "current" type.
2903 (AnonymousMethod.CreateScopeType): Correctly create the helper
2904 class if we're inside a generic type definition.
2906 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2908 * doc.cs : use Invocation.IsOverride() to do real override check.
2909 * expression.cs : made Invocation.IsOverride() internal.
2911 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2913 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2914 TypeBuilder.FindMembers() and filter overriden base members out.
2917 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2919 * doc.cs : ref/out parameters are represented as '@' (instead of
2920 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2922 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2924 * doc.cs : when there was no '.' in cref to methods in doc comment,
2925 then parameters were missing in the output. Fixed bug #76691.
2927 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2929 * driver.cs : don't output docs when there is an error.
2932 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2935 Now it should detect indexers. Fixed primary concern in bug #76685.
2936 Fixed CS0419 message to not show the identical member signature in
2939 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2941 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2942 instead of Type.FindMembers() since it does not handle events.
2945 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2947 * codegen.cs: Fixed typo (speficied -> specified).
2949 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2952 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2954 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2956 * attribute.cs: Changed error message.
2958 * cs-tokenizer.cs: One more check.
2960 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2962 * statement.cs (Block.Resolve): Ignore empty statement.
2964 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2966 * report.cs: Made error/warning methods more strict to avoid
2969 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2970 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2971 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2972 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2974 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2976 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2977 Use the more explicit AssemblyName.FullName instead of
2978 AssemblyName.Name to report errors.
2980 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2982 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2985 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2995 * report.cs: Fixed error reporting and typos.
2997 * generic.cs (TypeParameter.GetSignatureForError): New method.
2998 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3000 * typemanager.cs (GetFullName): Refactored.
3002 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3004 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3005 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3007 * class.cs (TypeContainer.IsComImport): New property.
3008 (Constructor.Define): Create proper ctor for ComImport types.
3010 * expression.cs (New.CheckComImport): Fixed.
3012 2005-11-07 Miguel de Icaza <miguel@novell.com>
3014 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3015 that a parameter has been captured does not mean that we do not
3016 have to do the rest of the processing. This fixes the second part
3017 of #76592. If there was another anonymous method capturing
3018 values in the past, the Scope would never be set for the second
3019 method that captured the same parameter.
3021 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3022 properly manipulate the stack. Second part of fix for #76592.
3024 * expression.cs (New): Add support for invoking "new" on
3025 interfaces that have been flagged with the ComImport attribute and
3026 the CoClass. Fixes #76637
3028 * statement.cs (Try.DoEmit): When a variable is captured, do not
3029 try to emit the vi.LocalBuilder variable as it has been captured.
3030 Create a temporary variable and store the results on the
3031 FieldBuilder. Fixes #76642
3033 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3035 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3037 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3039 * expression.cs (Binary.DoResolve): Added && optimalization.
3041 * typemanager.cs (AddUserType): Removed useless argument.
3043 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3045 * statement.cs (Block.variables): Uses ListDictionary.
3047 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3050 * class.cs (PartialContainer.EmitType): Customized to emit
3051 security attributes.
3052 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3053 for partial classes.
3055 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3058 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3059 access has to be fixed.
3061 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3063 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3066 * ecore.cs (NullCast.Reduce): Implemented.
3068 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3071 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3073 (Foreach.Resolve): Catch null properly.
3075 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3077 * cs-tokenizer.cs: Warning text fix.
3079 * driver.cs: AllWarningNumbers exposed on public interface.
3081 * report.cs (): Reviewed warning numbers.
3082 (IsValidWarning): Use binary search.
3084 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3086 * driver.cs: Implemeted resource visibility.
3087 (Resources): New class for code sharing between /res: and
3090 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3092 decl.cs (CurrentTypeParameters): Fixed to be public.
3094 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3096 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3098 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3100 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3102 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3104 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3106 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3108 Add friend assembly access support.
3109 * typemanager.cs: assembly_internals_vis_attrs
3110 cache for friend assembly access.
3111 (TypeManager.IsFriendAssembly): New method for
3112 checking friend assembly access.
3113 (TypeManager.Error_FriendAccessNameNotMatching): New
3115 (TypeManager.CompareKeyTokens): Likewise.
3116 (TypeManager.Filter): Handle friend accessible
3119 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3120 friend accessible types.
3122 * ecore.cs (Expression.IsAccessorAccessible): Handle
3123 friend accessible properties.
3125 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3128 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3131 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3134 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3137 * ecore.cs (NullCast): Child is contant only.
3139 * literal.cs (NullLiteral.Reduce): null can be converted to any
3142 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3144 * driver.cs: Use Encoding.Default as default code page instead
3147 2005-10-27 Raja R Harinath <rharinath@novell.com>
3150 * expression.cs (Invocation.Error_InvalidArguments): Handle
3151 __arglist parameters.
3152 (Invocation.VerifyArgumentsCompat): Likewise.
3153 * support.cs (ReflectionParameters.GetSignatureForError): Print
3154 __arglist parameters.
3155 (InternalParamters.GetSignatureForError): Likewise.
3156 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3158 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3160 * attribute.cs (GetPropertyValue): Made public.
3162 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3164 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3166 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3169 * driver.cs: Reflect method name change.
3171 * statement.cs (Try.Resolve): Warn when try has both general
3174 * typemanager.cs: runtime_compatibility_attr_type new predefined
3177 2005-10-26 Raja R Harinath <harinath@gmail.com>
3180 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3181 treat it as an empty parameter list.
3183 2005-10-26 Raja R Harinath <rharinath@novell.com>
3186 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3187 ResolveAsTypeStep silent.
3188 * statement.cs (Block.AddConstant): Mark block as used.
3189 (Block.ResolveMeta): Avoid piling on error messages
3190 if a constant initializer resolution fails.
3192 2005-10-25 Raja R Harinath <rharinath@novell.com>
3194 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3196 (NamespaceEntry.VerifyAllUsing): New.
3197 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3198 behaviour. Delegates actual resolution of alias to ...
3199 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3200 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3202 * driver.cs (Driver.MainDriver): Update.
3204 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3205 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3207 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3209 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3210 RootNamespace.DefineNamespacesForAll.
3212 2005-10-24 Raja R Harinath <harinath@gmail.com>
3214 * typemanager.cs (assemblies, external_aliases, modules)
3215 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3216 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3217 overhead. Move resposibility ...
3218 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3219 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3221 2005-10-23 Raja R Harinath <harinath@gmail.com>
3223 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3224 cached_namespaces. Improve usage.
3225 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3226 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3227 Move from GlobalRootNamespace and simplify.
3228 (RootNamespace.Global): Make instance variable.
3229 (RootNamespace.RootNamespace): Add "alias name" parameter.
3230 (GlobalRootNamespace): Simplify drastically.
3231 (Namespace.Lookup): Don't use GetNamespace.
3232 * typemanager.cs (GetRootNamespace): Rename from
3233 ComputeNamespaceForAlias.
3234 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3236 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3238 * anonymous.cs (AnonymousContainer): Don't crash when container
3241 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3243 * expression.cs (Binary.DoResolve): Warn when comparing same
3246 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3249 * expression.cs (Binary.DoResolve): It looks like there are no
3250 convetsion rules in enum context.
3252 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3254 Add support for extern alias qualifiers.
3255 * typemanager.cs: Move some LookupTypeReflection code
3256 to namespace.cs, to have cleaner code. Added some methods
3257 to help us keep track of the extern aliased references.
3258 * driver.cs: Add suport for extern alias assemblies on command
3259 line and check for their warnings/errors. Also keep track of the
3260 extern aliased assemblies.
3261 * namespace.cs: Move the global functionality of Namespace
3262 to GlobalRootNamespace/RootNamespace. Now the global namespace
3263 is GlobalRootNamespace.Globa. Also the code moved from
3264 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3265 Finally added LocalAliasEntry (AliasEntry before) and
3266 ExternAliasEntry, to handle alias statements.
3267 * cs-parser.jay: Add support in the grammar for extern alias
3269 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3270 Update callings to Namespace (now in GlobalRootNamespace).
3272 2005-10-25 Martin Baulig <martin@ximian.com>
3274 * convert.cs (ImplicitTypeParameterConversion): Make base
3275 interfaces actually work; fixes #76557.
3277 2005-10-25 Martin Baulig <martin@ximian.com>
3280 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3281 all the type parameters; fixes #76551.
3283 2005-10-25 Martin Baulig <martin@ximian.com>
3288 (GenericMethod.ctor): Added `Expression return_type' and
3289 `Parameters parameters' arguments.
3290 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3291 parameter and return types to check their constraints if they're
3294 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3297 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3298 constraints of a generic type if `ec.ResolvingGenericMethod'.
3300 * class.cs (MethodCore.DoDefineParameters): Set
3301 `ec.ResolvingGenericMethod' if we're a generic method.
3302 (MemberBase.MemberType): Likewise.
3304 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3306 * typemanager.cs (TypeManager): Added
3307 TypeManager.internals_visible_attr_type to cache
3308 S.R.CompilerServices.InternalsVisibleToAttribute.
3310 * codegen.cs (AssemblyClass): Added checks for
3311 InternalsVisibleToAttribute in new method
3312 CheckInternalsVisibleAttribute () and also cache the
3313 AssemblyName in AssemblyClass.Name.
3315 2005-10-24 Martin Baulig <martin@ximian.com>
3318 (TypeManager.ExpandInterfaces): Added overloaded version which
3319 just takes a `Type[]' array.
3322 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3323 just use the interfaces which were explicitly specified and not
3324 the interfaces they inherit. Fixes #76482.
3325 (TypeParameter.FindMembers): Expand the interfaces here.
3327 2005-10-21 Martin Baulig <martin@ximian.com>
3330 (Constraints.Resolve): Also resolve the actual types here.
3331 (Constraints.ResolveTypes): Just check the constraints here.
3332 Fixes #76363; see gtest-218.cs.
3334 2005-10-21 Martin Baulig <martin@ximian.com>
3337 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3338 instead of a `BoxedCast'; fixes gtest-217.cs.
3340 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3342 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3343 1) "new()" is specified as generic parameter constraint and 2) the
3344 type is TypeBuilder and 3) the type is abstract even if it has a
3345 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3347 2005-10-20 Martin Baulig <martin@ximian.com>
3350 (GenericConstraints.TypeParameter): New public property.
3351 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3352 (TypeParameter.DeclSpace): New public property.
3353 (TypeParameter.DefineType): Inflate the constraints if our
3354 `DeclSpace' is an `Iterator'.
3356 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3358 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3359 GenericMethod argument to compare methods' generic type arguments.
3362 2005-10-19 Martin Baulig <martin@ximian.com>
3364 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3365 not ResolveType() when resolving the base type, so we're not
3366 checking the constraints here.
3367 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3370 2005-10-19 Martin Baulig <martin@ximian.com>
3372 * generic.cs (ConstructedType.CheckConstraints): Committing
3373 untested fix for #76441.
3375 2005-10-18 Raja R Harinath <rharinath@novell.com>
3378 * class.cs (TypeContainer.DefineType): Move updating of
3379 topological sort earlier in the code.
3380 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3382 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3385 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3387 * constant.cs (Constant.TryReduce): Moved from Cast class.
3388 (Reduce): Made little bit more OO and fixed missing conversions.
3390 * ecore.cs (Reduce): Implemented.
3391 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3393 * literal.cs (Reduce): Implemented.
3395 * class.cs: Reverted Miguel's wrong commit.
3397 2005-10-14 Miguel de Icaza <miguel@novell.com>
3399 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3401 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3403 * cs-parser.jay, expression.cs : CS0214 was missing error location
3404 for constants. Fixed bug #76404.
3406 2005-10-10 Raja R Harinath <rharinath@novell.com>
3408 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3410 (PropertyExpr.EmitCall): Likewise.
3411 * expression.cs (Invocation.EmitArguments): Handle case where
3413 (Invocation.EmitCall): Avoid allocating temporary variable if
3414 there are no arguments.
3416 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3419 * convert.cs (ExplicitConversionCore): Fixed object->enum
3422 2005-10-07 Raja R Harinath <rharinath@novell.com>
3425 * convert.cs (ImplicitConversionStandard): Move conversion of
3426 void* to arbitrary pointer types ...
3427 (ExplicitConversionStandard): .. here.
3428 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3429 error to always print typenames.
3431 2005-10-07 Raja R Harinath <rharinath@novell.com>
3433 * convert.cs (GetConversionOperator): Rename from
3434 GetConversionOperators. Move operator selection code from ...
3435 (UserDefinedConversion): ... here.
3437 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3439 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3442 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3444 * assign.cs (Assign.DoResolve): Error method changed.
3446 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3448 * const.cs (ResolveValue): Reset in_transit immediately.
3450 * constant.cs: Error method changed.
3452 * convert.cs: Removed useless location parameter.
3453 (ExplicitNumericConversion): Don't do double enum check.
3454 (ExplicitConversionCore): Renamed from ExplicitConversion.
3455 (ExplicitUnsafe): Extracted from ExplicitConversion.
3456 (ExplicitConversion): Uses for error reporting.
3458 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3460 (ResolveBoolean): Uses common error method.
3461 (CastToDecimal): Get rid of ec.
3462 (CastFromDecimal): Optimized.
3463 (ConvCast): Get rid of ec.
3465 * enum.cs (ResolveValue): Reset in_transit immediately.
3466 (Emit): Return after first error.
3468 * expression.cs: Convert changes.
3470 * literal.cs: Error method changed.
3472 * statement.cs: Error method changed.
3474 2005-10-06 Raja R Harinath <rharinath@novell.com>
3476 Fix gtest-131.cs and gtest-211.cs.
3477 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3478 Only emit code for a label if it is used. Unreachable code can
3479 violate ECMA evaluation stack invariants.
3481 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3483 * anonymous.cs: Implemented ExprClassName.
3485 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3488 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3491 * class.cs (StaticClass.DefineContainerMembers): Report protected
3494 * codegen.cs: if(ed) PRODUCTION.
3496 * convert.cs (Error_CannotImplicitConversion): Better error
3499 * cs-parser.jay: More error checks.
3501 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3503 * driver.cs (CSCParseOption): Enabled wrong option check.
3505 * ecore.cs (Expression.ExprClassName): Turned to property.
3506 (MemberExpr.CheckIntermediateModification): For checking boxed
3507 value types modification.
3509 * statement.cs (Fixed.Resolve): Expression type must be
3510 convertible to fixed type.
3511 (CollectionForeach.GetEnumeratorFilter,TryType):
3512 Small refactoring for easier error checking.
3514 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3516 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3519 * class.cs (GeneratedBaseInitializer): New class for customization
3520 compiler generated initializers.
3521 (MemberBase.DoDefine): Check Obsolete attribute here.
3522 (FieldMember.DoDefine): Ditto.
3524 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3527 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3528 (MemberCore.GetObsoleteAttribute): Removed argument.
3529 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3530 (MemberCore.CheckObsoleteType): New helper.
3534 * statement.cs: Updates after MemberCore changes.
3536 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3537 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3539 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3540 obsolete attribute for compiler construct.
3541 (As.DoResolve): Cache result.
3543 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3545 2005-10-01 Miguel de Icaza <miguel@novell.com>
3547 * expression.cs (Probe): instead of having a "Type probe_type"
3548 keep the extra information as a TypeExpr probe_type_expr since the
3549 "As" operator needs to perform some type checks.
3551 * (As.DoResolve): If the type is a type parameter, ensure that it
3552 is constrained by a class.
3554 2005-09-22 Miguel de Icaza <miguel@novell.com>
3556 * statement.cs (Lock): Use the TemporaryVariable class instead of
3557 manually using local variables as those do not work when variables
3560 * ecore.cs: Moved the TemporaryVariable class from being a nested
3561 class inside Foreach to be a public class that can be employed in
3564 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3566 * cs-parser.jay: interface_accessors replaced by
3567 accessor_declarations.
3569 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3572 * statement.cs (GotoCase.Resolve): Convert null constant to
3574 (SwitchLabel.ResolveAndReduce): Ditto.
3575 (SwitchLabel.NullStringCase): Custom null stamp.
3576 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3578 typemanager.cs (CSharpSignature): Don't skip first argument
3581 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3583 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3584 expression.cs, iterators.cs, literal.cs: Store constants and
3587 * class.cs (MemberBase.ShortName): Pass location.
3589 * cs-parser.jay: Some location fixes.
3591 * ecore.cs (Expression.Location): Made virtual.
3593 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3596 * const.cs (Const.ResolveValue): Check for assigning non-null
3597 value to reference type.
3599 2005-09-26 Raja R Harinath <rharinath@novell.com>
3602 * expression.cs (This.VerifyFixed): In a value type T, the type of
3603 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3604 value type R, 'this' is treated as a value parameter.
3606 2005-09-05 Miguel de Icaza <miguel@novell.com>
3608 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3609 if the underlying types are the same, otherwise we need to produce
3610 code that will do the proper cast.
3612 This was exposed by Marek's constant rewrite which produced
3613 invalid code for the call site:
3616 void Method (X v) {}
3620 This fixes test-49.cs
3622 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3624 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3625 Type/Object should be allowed as well. Fixed bug #75968.
3627 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3629 * expression.cs : (Binary.DoResolve): when one is enum constant and
3630 another is constant 0, then return enum one *as enum type*.
3633 2005-10-04 Martin Baulig <martin@ximian.com>
3635 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3636 `SetMemberIsUsed()' work for generics, too.
3638 2005-10-04 Martin Baulig <martin@ximian.com>
3640 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3641 for corlib. Fixes #75691.
3643 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3646 * driver.cs: Fix compilation files with full root path.
3648 2005-09-25 Miguel de Icaza <miguel@novell.com>
3650 * report.cs (SymbolRelatedToPreviousError): Format the output so
3651 it does not use an open parenthesis that is never closed.
3653 * driver.cs: Follow coding guidelines
3655 2005-09-18 Miguel de Icaza <miguel@novell.com>
3657 * driver.cs: Set InEmacs based on the environment variable EMACS.
3659 * location.cs (InEmacs): in this mode, do not report column
3660 location as it confuses Emacs.
3662 2005-10-03 Raja R Harinath <rharinath@novell.com>
3664 * support.cs (SeekableStreamReader.Position): Don't error out when
3665 the requested position is just beyond the end of the current
3668 2005-09-28 Raja R Harinath <rharinath@novell.com>
3670 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3671 try to keep in sync with the byte count of the underlying Stream.
3672 However, this limits us to a window size of 2048 characters: i.e.,
3673 the maximum lookahead of our lexer/parser can be 2048 characters.
3675 2005-09-22 Martin Baulig <martin@ximian.com>
3677 * driver.cs: Removed a debugging FIXME.
3679 2005-09-21 Raja R Harinath <rharinath@novell.com>
3681 * cs-parser.jay (type_arguments): Add CS1644 check.
3682 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3684 2005-09-15 Raja R Harinath <rharinath@novell.com>
3686 * Makefile (PROGRAM): Make profile specific.
3687 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3688 the current directory.
3691 * expression.cs (Invocation.EmitCall): Remove optimization on
3692 this_call since it doesn't handle 'this' being a value type.
3694 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3696 * driver.cs: Ensure file handles are closed after parsing
3698 2005-09-05 Miguel de Icaza <miguel@novell.com>
3700 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3701 if the underlying types are the same, otherwise we need to produce
3702 code that will do the proper cast.
3704 This was exposed by Marek's constant rewrite which produced
3705 invalid code for the call site:
3708 void Method (X v) {}
3712 This fixes test-49.cs
3714 2005-09-05 Martin Baulig <martin@ximian.com>
3716 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3717 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3719 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3721 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3723 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3724 to be a pointer type due to the spec 25.2, so check if declaring
3725 type is generic type definition. Fixed bug #75772.
3727 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3730 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3731 both types are not defined by methods.
3732 * expression.cs : (Invocation.IsApplicable): it should work when
3733 the argument type is equal to the parameter type, not only when
3734 ImplicitConversionExists() returns true.
3736 2005-09-02 Raja R Harinath <rharinath@novell.com>
3738 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3742 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3743 flow-branching for LocalVariableReferences in case we were invoked
3744 from a MemberAccess.
3745 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3747 (LocalVariableReference.DoResolveBase): ... this.
3748 (MemberAccess.Resolve): Do the check that was disabled during
3751 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3754 (PartialContainer.Create): check abstract/sealed/static strictly
3755 but abstract/sealed can exist only at one side. Fixed bug #75883.
3757 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3760 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3761 specified, don't default to UnmanagedType.I4.
3763 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3765 * expression.cs : conditional operator should check possibly
3766 incorrect assign expression. Fixed bug #75946.
3768 2005-08-30 Raja R Harinath <rharinath@novell.com>
3771 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3772 (ScopeInfo.EmitScopeType): Use it to construct field names from
3773 names of captured locals.
3776 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3777 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3778 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3779 (ExplicitConversion): Remove enum cases already handled by
3780 implicit conversion. Move implicit conversion check to the beginning.
3781 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3782 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3783 Don't treat System.Enum as a struct.
3785 2005-08-30 Jb Evain <jbevain@gmail.com>
3787 * attribute.cs: handles as expression in parameters.
3789 2005-08-30 Raja R Harinath <rharinath@novell.com>
3792 * class.cs (TypeContainer.VerifyClsName): Don't use a
3793 PartialContainer when verifying CLS compliance.
3794 (AbstractPropertyEventMethod): Set Parent here, ...
3795 (PropertyMethod): ... not here.
3797 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3799 * attribute.cs : escaped attribute name should not be allowed to be
3800 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3802 2005-08-29 Raja R Harinath <rharinath@novell.com>
3805 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3806 when converting a long constant to unsigned long.
3807 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3808 detect where IsApplicable and VerifyArgumentsCompat disagree.
3810 2005-08-29 Raja R Harinath <rharinath@novell.com>
3811 and Carlos Alberto Cortez <carlos@unixmexico.org>
3814 * class.cs (TypeContainer.CanElideInitializer): New helper.
3815 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3816 can safely emitting the initializer of a field.
3818 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3820 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3821 allowed inside a switch (without loop). Fixed bug #75433.
3823 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3825 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3826 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3828 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3830 * driver.cs : kinda reverting the default encoding changes (not exact
3831 revert since I noticed that "codepage:reset" might not work fine).
3833 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3835 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3836 Location. Now getter and setter store location correctly.
3837 (errors/cs0111-12.cs now reports the expected location.)
3839 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3841 * driver.cs : Use default encoding on the environment.
3842 Removed (now that) extra parameter for SeekableStreamReader.
3843 * support.cs : (SeekableStreamReader) third .ctor() argument for
3844 StreamReader is not required (always true). preamble size could
3845 be acquired in simpler and safe way.
3847 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3849 * cs-parser.jay: report CS0642 at warning level 3
3850 and report CS0642 for an if else statement also
3851 fixes bug #74745. Patch by John Luke (and a bit
3853 Removed extra CS0642 warning check for "while",
3855 * statement.cs: In Block.Resolve(), CS0642 check
3856 is reimplemented to check a sequence of an empty
3857 statement and a block.
3859 Both fix bug #66777.
3861 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3863 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3864 detection until I fix it.
3866 * cs-tokenizer.cs: Changed error message.
3868 * cs-parser.jay: Fixed 2 error locations.
3870 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3871 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3874 * enum.cs (GetSignatureForError): Fixed.
3876 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3880 * typemanager.cs (RegisterProperty): Removed.
3882 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3884 2005-08-24 Raja R Harinath <rharinath@novell.com>
3887 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3888 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3890 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3892 * expression.cs : tiny fix is required for not warning positive ulong.
3895 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3897 * expression.cs : add CS0652 check for constant and integral
3898 expression. Fixed bug #53974.
3900 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3902 * expression.cs : in DoNumericPromotions(), check if there is implicit
3903 conversion overload for string (to check CS0034). Fixed bug #52492.
3905 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3907 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3909 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3911 * ecore.cs : report location when it is *not* Null.
3913 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3919 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3920 correctly. Fixed bug #75721.
3922 2005-08-23 Raja R Harinath <rharinath@novell.com>
3924 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3925 loop that performs 'min (pos, char_count)'.
3928 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3929 converted value in Operator.OnesComplement.
3931 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3933 * anonymous.cs: If the anon method is pulled into a helper class,
3934 it needs to be `internal' not `private'. Fixes runtime behavior on
3937 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3940 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3943 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3945 The big constants rewrite
3946 Fix #75746, #75685 and more
3947 As a side effect saved 1MB for MWF ;-)
3949 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3950 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3951 enum based for corlib compilation.
3953 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3956 * class.cs (FixedField.Define): Use ResolveAsConstant.
3958 * const.cs (IConstant): Interface constants and enums.
3959 (Const.ResolveValue): New method for constant resolvning.
3960 (ExternalConstant): Constants from imported assemblies.
3962 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3963 conversion; like enums.
3964 (Constant.ToType): Converts this constant to different type.
3965 (Constant.Increment): Adds 1.
3967 * convert.cs (ImplicitConversionRequired): Simplified.
3969 * cs-parser.jay: Create EnumMember directly.
3971 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3973 * doc.cs (GenerateEnumDocComment): Removed.
3975 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3976 (ConvertIntLiteral): Removed.
3977 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3979 * enum.cs (EnumMember): Implement IConstant.
3980 (Enum.IsValidEnumConstant): Removed.
3981 (Enum.GetNextDefaultValue): Removed.
3982 (Enum.FindMembers): Updated.
3983 (Enum.GenerateDocComment): Iterate enum members.
3985 * expression.cs (Cast.TryReduce): Handle enums correctly.
3986 (New.Constantify): Made public.
3987 (MemberAccess.DoResolve): Removed contant specific if(s).
3989 * literal.cs (NullLiteral): Implement new abstract methods.
3991 * statement.cs (GotoCase.Resolve): Use new constant methods.
3992 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3994 * typemanager.cs (LookupEnum): Removed.
3995 (IsEnumType): Fixed to work with corlib.
3996 (RegisterConstant): Removed.
3997 (LookupConstant): Removed.
3998 (GetConstant): Changed to work with IConstant.
4000 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4002 * location.cs : Fixed overflown (>255) column number.
4004 2005-08-03 Raja R Harinath <rharinath@novell.com>
4006 First cut of the qualified-alias-member feature.
4007 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4009 * cs-parser.jay (DOUBLE_COLON): New token.
4010 (namespace_or_type_name): Add rule for recognizing
4011 qualified-alias-members.
4012 (primary_expression): Likewise.
4013 (element_access): Allow QualifiedAliasMember as a possible
4014 type-bearing expression.
4015 (local_variable_type, local_variable_pointer_type): Likewise.
4016 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4017 aliases in the current and enclosing namespace declarations.
4018 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4019 * decl.cs (MemberName.is_double_colon): New.
4020 (MemberName.MemberName): Add new constructor for alias-member.
4021 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4022 * expression.cs (QualifiedAliasMember): New expression type.
4024 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4026 * location.cs : it borked when no argument was specified.
4028 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4030 * location.cs : tiny ToString() format fix.
4032 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4034 * statement.cs : oops, it was missing.
4036 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4038 A set of fixes for precise line/column location.
4041 "token" field now holds a file/line "delta", a line number offset
4042 from the segment, and a column number. See also:
4043 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4044 December/009508.html
4045 Removed static IsNull. Use instance IsNull property instead.
4047 For some tokens it stores Location. For Identifier it stores
4048 LocatedToken which is a pair of string name and location.
4049 Column numbers are adjusted only at getChar().
4051 Use Location.ToString() for reporting (it now contains column).
4053 Largely modified to use LocatedToken instead of
4054 string (IDENTIFIER), and to acquire Location from some tokens.
4055 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4056 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4058 Now MemberName holds Location. DeclSpace.ctor() receives Location
4059 as a parameter. Removed extra parameters to all derived classes.
4060 Replaced Location.IsNull() with instance property.
4061 * assign.cs, expression.cs :
4062 Added .ctor() overload that omits Location.
4064 Added "nameEscaped" flag that indicates the identifier was escaped
4065 in the source file. This fixes bug #57047.
4067 2005-09-02 Martin Baulig <martin@ximian.com>
4069 * class.cs: Make CS3005 a warning, not an error.
4071 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4073 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4074 New method, looking for lo-case imported cls type.
4076 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4079 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4081 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4083 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4085 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4087 Optimized to save 3.5 MB for SWF compilation.
4089 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4091 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4092 (PartialContainer.Create): Moved logic AddToContainer.
4093 (PartialContainer.MarkForDuplicationCheck): Shares name.
4095 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4098 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4100 (Namespace.GetSignatureForError): New method.
4102 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4103 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4105 2005-08-01 Raja R Harinath <rharinath@novell.com>
4108 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4109 member lookup rather than qualifier_type, since qualifier_type can
4112 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4114 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4117 2005-07-31 Miguel de Icaza <miguel@novell.com>
4119 * statement.cs: Copy the local exception into the exception
4120 captured local. Fixes 75674
4122 2005-07-31 Raja R Harinath <harinath@gmail.com>
4125 * expression.cs (Invocation.OverloadResolve): Don't report error
4126 CS1501 if error CS1502 has been reported.
4127 (New.DoResolve): Delegate CS1501 reporting to
4128 Invocation.OverloadResolve.
4131 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4132 invariant-meaning-in-block property in an enclosing block if
4135 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4137 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4138 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4139 (Switch.CheckSwitch): Just save 50kb for SWF.
4141 2005-07-27 Martin Baulig <martin@ximian.com>
4143 * anonymous.cs (CaptureContext.AddField): Added
4144 `AnonymousContainer am' argument; compute its toplevel scope if
4145 it's not already computed. Fixes #75649.
4147 2005-07-26 Raja R Harinath <rharinath@novell.com>
4150 * class.cs (Constructor.Emit): Reset block to null if the block
4153 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4155 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4157 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4159 * class.cs (MethodData.Define): Check whether accessor implementing
4160 interface is public.
4162 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4164 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4167 * namespace.cs (LookupType): Moved same type check to...
4169 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4172 2005-07-21 Raja R Harinath <rharinath@novell.com>
4174 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4175 already found a typebuilder.
4176 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4177 MemberNames, not strings.
4179 * const.cs (Error_ExpressionMustBeConst):
4180 Rename from Error_EpressionMustBeConst.
4181 * const.cs, class.cs, statement.cd: Update.
4183 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4187 * const.cs (Const.LookupConstantValue): Report missing contant expression
4189 (Error_EpressionMustBeConstant): Only one error method.
4191 * class.cs, statement.c: Updated.
4193 2005-07-20 Raja R Harinath <rharinath@novell.com>
4195 * statement.cs (Block.Flags): Add back HasVarargs.
4196 (Block.flags): Make protected.
4197 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4199 * typemanager.cs (types, typecontainers, user_types): Remove.
4200 (UserTypes, TypeContainers): Likewise.
4201 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4202 (CleanUp, Reset): Update.
4203 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4204 (GetNestedType): Use Type.GetNestedType.
4205 (CoreLookupType): Take two arguments, the namespace and the
4206 basename of the type. Update to use the Namespace.Lookup
4208 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4209 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4210 string concatenation and substring matches.
4211 * class.cs, enum.cs, delegate.cs: Update to changes.
4213 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4215 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4216 Expression and made virtual.
4218 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4219 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4221 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4223 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4226 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4229 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4232 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4233 AssemblyCultureAttribute is not used on executable.
4236 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4238 2005-07-16 Raja R Harinath <rharinath@novell.com>
4241 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4242 New. Reports CS0252/CS0253.
4243 Mostly taken from preliminary patch by Duncak Mak.
4244 (Binary.DoResolveOperator): Store results of operator lookup.
4245 Use them to detect if we need to warn about unintended reference
4248 2005-07-15 Raja R Harinath <rharinath@novell.com>
4251 * namespace.cs (Namespace.Lookup): Add back location parameter.
4252 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4253 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4255 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4256 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4257 (Namespace.LookupType): ... this.
4258 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4260 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4261 purported to handle pointers.
4262 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4265 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4267 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4270 2005-07-15 Raja R Harinath <rharinath@novell.com>
4272 * namespace.cs (Namespace.Lookup): Drop location parameter.
4273 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4274 (NamespaceEntry.Lookup): ... this.
4275 (NamespaceEntry.Error_AmbiguousTypeReference):
4276 Move here from DeclSpace.
4277 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4279 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4280 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4281 Move to NamespaceEntry.
4282 * delegate.cs, expression.cs: Update to changes.
4284 2005-08-31 Martin Baulig <martin@ximian.com>
4286 Committing a patch from Atsushi Enomoto for #75850.
4288 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4289 Prefer a generic enumerator over a non-generic one.
4291 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4293 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4294 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4296 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4298 * driver.cs : reverting default encoding change as well as mcs.
4300 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4302 * driver.cs, support.cs : merged r48826.
4304 > could you integrate your mcs changes to gmcs otherwise
4305 > gmcs cannot compile some files.
4307 2005-08-20 Martin Baulig <martin@ximian.com>
4309 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4310 scope if we don't already have it.
4312 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4313 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4316 2005-07-31 Miguel de Icaza <miguel@novell.com>
4318 * statement.cs: Copy the local exception into the exception
4319 captured local. Fixes 75674
4321 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4323 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4326 2005-08-12 Martin Baulig <martin@ximian.com>
4328 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4329 for nested types here to avoid hitting the cache too early.
4331 2005-08-09 Miguel de Icaza <miguel@novell.com>
4333 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4336 2005-08-03 Martin Baulig <martin@ximian.com>
4338 Make iterators in generic methods work; see gtest-191.cs.
4341 (Constraints.Resolve): Protect against being called twice.
4344 (TypeContainer.GetClassBases): Make this `protected virtual'.
4346 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4347 (Iterator.GetClassBases): Override this and compute the base
4349 (Iterator.DefineNestedTypes): If we're a generic method, all our
4350 method type parameters become class type parameters on the proxy
4354 (ToplevelBlock.Parameters): Make this a property, not a field.
4355 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4357 2005-08-03 Martin Baulig <martin@ximian.com>
4359 * typemanager.cs (TypeManager.IsSubclassOf): Use
4360 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4361 (TypeManager.GetFullName_recursed): Improved.
4363 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4366 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4367 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4368 invocation_type == mi.DeclaringType, since the first one also checks
4369 other condition used by generic instances.
4371 2005-07-27 Martin Baulig <martin@ximian.com>
4373 * anonymous.cs (CaptureContext.AddField): Added
4374 `AnonymousContainer am' argument; compute its toplevel scope if
4375 it's not already computed. Fixes #75649.
4377 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4379 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4380 CheckAttributeType and refactored.
4381 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4382 ResolveAsTypeTerminal error handling.
4383 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4385 (GetSignatureForError): Print errors in same way.
4388 * codegen.cs: Reflect attribute GetSignatureForError change.
4391 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4393 * namespace.cs (UsingEntry): Refactored to make fields private.
4396 statement.cs: Error_UnexpectedKind has extra parameter.
4398 2005-07-14 Raja R Harinath <rharinath@novell.com>
4400 * ecore.cs (IAlias): Remove.
4401 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4402 that implement the interface.
4403 * namespace.cs (Namespace): Likewise.
4404 (Namespace.declspaces): Renamed from 'defined_names'.
4405 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4406 DeclSpace instead of an IAlias.
4407 * tree.cs (Tree.AddDecl): Update.
4409 2005-07-12 Raja R Harinath <rharinath@novell.com>
4411 * statement.cs (Block.Flags); Remove HasVarargs.
4412 (Block.HasVarargs): Move to ToplevelBlock.
4413 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4414 (Block.Variables): Make protected. Initialize variable hashtable
4416 (Block.AddVariable): Update.
4417 (Block.Resolve): Update to changes.
4418 (ToplevelBlock.HasVarargs): New boolean.
4419 (ToplevelBlock.ThisVariable): Move here from Block.
4420 (ToplevelBlock.AddThisVariable): Likewise.
4421 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4422 * expression.cs (This.ResolveBase): Update to changes.
4423 (ArglistAccess.DoResolve): Likewise.
4425 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4428 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4430 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4431 not used and not used & assigned.
4432 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4434 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4437 * expression.cs (Is.DoResolve): null is never provided type.
4439 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4442 * cs-parser.jay: Less strict event error rule to catch more errors.
4444 2005-07-11 Martin Baulig <martin@ximian.com>
4446 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4447 for the constructor constraint: we do not only have to check
4448 whether the class has a public constructor, but also ensure that
4449 it's parameterless. Fixes #75492.
4451 2005-07-11 Martin Baulig <martin@ximian.com>
4453 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4454 between type parameters if they either have the reference type
4455 constraint or the class constraint.
4457 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4459 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4461 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4464 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4465 (ExtractSecurityPermissionSet): Cope with self referencing security
4466 attributes properly.
4468 * driver.cs (SetOutputFile): Made public property OutputFile.
4470 2005-07-07 Raja R Harinath <rharinath@novell.com>
4473 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4474 has_nonstatic_fields. Make into a FieldBase pointer.
4475 (TypeContainer.AddField): Add CS0282 check.
4476 (TypeContainer.EmitType): Update.
4478 2005-07-06 Miguel de Icaza <miguel@novell.com>
4480 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4481 compare if they start with __.
4483 2005-07-06 Raja R Harinath <rharinath@novell.com>
4485 * statement.cs (Switch.SwitchGoverningType): Only look at
4486 UserCasts that don't need implicit standard conversions to one of
4487 the allowed switch types (Fixes test-322.cs).
4488 (LocalInfo.Resolve): Re-enable sanity-test.
4490 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4492 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4494 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4496 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4498 2005-07-06 Raja R Harinath <rharinath@novell.com>
4501 * ecore.cs (SimpleName.GetSignatureForError): Add.
4502 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4503 (MemberAccess.GetSignatureForError): Add.
4505 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4507 The big error and warning messages review.
4537 * typemanager.cs: Updated.
4539 * class.cs: (MethodCore.SetYields): Moved here to share.
4540 (PropertyMethod.Define): Moved iterator setup here.
4542 * iterators.cs: Add orig_method to have full access to parent
4545 2005-07-05 Raja R Harinath <rharinath@novell.com>
4547 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4548 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4549 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4550 variable of struct type.
4551 * expression.cs (Unary.ResolveOperator): Update to change.
4552 (Indirection.VerifyFixed): Likewise.
4553 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4554 (ParameterReference.VerifyFixed): Value parameters are fixed.
4555 (This.VerifyFixed): Treat 'this' as a value parameter.
4556 * statement.cs (LocalInfo.IsFixed): Remove.
4558 2005-07-01 Martin Baulig <martin@ximian.com>
4560 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4561 `ec.EmitThis ()' to get the correct scope.
4563 2005-07-01 Martin Baulig <martin@ximian.com>
4565 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4566 instance is a ParameterReference; fixes #75299.
4568 2005-06-30 Raja R Harinath <rharinath@novell.com>
4571 * expression.cs (Indexers.map): Remove.
4572 (Indexers.Append): Filter out inaccessible setters and getters.
4573 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4576 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4578 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4579 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4580 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4581 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4583 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4586 * class.cs (FieldBase.GetInitializerExpression): One more field
4589 2005-06-28 Miguel de Icaza <miguel@novell.com>
4591 * pending.cs: Do not define a proxy if the base method is virtual,
4592 it will be picked up by the runtime (bug 75270).
4594 2005-07-08 Martin Baulig <martin@ximian.com>
4596 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4597 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4599 2005-07-07 Martin Baulig <martin@ximian.com>
4601 * generic.cs (ConstructedType.CheckConstraint): Use
4602 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4603 called recursively; fixes #75329.
4605 2005-07-06 Martin Baulig <martin@ximian.com>
4607 * generic.cs (TypeManager.InferTypeArguments): Added support for
4608 anonymous methods; fixes #75461.
4610 2005-07-01 Martin Baulig <martin@ximian.com>
4612 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4613 `ec.EmitThis ()' to get the correct scope.
4615 2005-07-01 Martin Baulig <martin@ximian.com>
4617 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4618 instance is `This'; fixes #75299.
4620 2005-06-30 Martin Baulig <martin@ximian.com>
4622 * class.cs (Indexer): Implement IIteratorContainer; added support
4623 for iterators in indexers.
4626 (EmitContext.CurrentIterator): Make this a property, not a field.
4628 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4630 2005-06-28 Miguel de Icaza <miguel@novell.com>
4632 * pending.cs: Do not define a proxy if the base method is virtual,
4633 it will be picked up by the runtime (bug 75270).
4635 2005-06-28 Martin Baulig <martin@ximian.com>
4637 * cs-parser.jay (interface_method_declaration): Avoid a
4638 reduce/reduce conflict by moving some of the code into a separate
4639 `interface_method_declaration_body' rule; fixes #75368.
4641 2005-06-28 Martin Baulig <martin@ximian.com>
4643 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4644 array check after the check for TypeBuilder's.
4646 2005-06-21 Raja R Harinath <rharinath@novell.com>
4648 * convert.cs (FindMostEncompassedType): Add two trivial special
4649 cases (number_of_types == 0 || number_of_types == 1).
4650 (FindMostEncompasingType): Likewise.
4652 2005-06-17 Raja R Harinath <rharinath@novell.com>
4654 Some cleanups preparing for the fix of #75283.
4655 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4657 (EventExpr.InstanceResolve): Likewise.
4658 (EventExpr.DoResolve): Remove redundant checks.
4660 2005-06-08 Miguel de Icaza <miguel@novell.com>
4662 * class.cs: Small fix.
4664 2005-06-08 Raja R Harinath <rharinath@novell.com>
4667 * class.cs (GetPartialBases): Fix return value check of
4670 2005-06-07 Raja R Harinath <rharinath@novell.com>
4672 Ensure that partial classes are registered in their enclosing
4673 namespace. Initial part of fix of #75160.
4674 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4675 Register declspace with namespace here, not in
4676 DeclSpace.RecordDecl.
4677 * cs-parser.jay: Pass namespace to RecordDecl.
4678 * class.cs (PartialContainer.Create): Likewise.
4679 (ClassPart.DefineType): New sanity-check. Throws an exception if
4681 * decl.cs (Declspace.RecordDecl): Remove.
4682 * namespace.cs (NamespaceEntry.DefineName): Remove.
4684 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4686 * rootcontext.cs: Reset TargetExt as well.
4688 2005-06-03 Raja R Harinath <rharinath@novell.com>
4690 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4693 2005-06-02 Raja R Harinath <rharinath@novell.com>
4695 Fix #75080, cs0119.cs.
4696 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4698 (Expression.Resolve): ... this. Use it. Remove bogus code
4699 allowing ExprClass.Type and ExprClass.Namespace for
4700 ResolveFlags.VariableOrValue.
4701 (Expression.Resolve) [1-argument variant]: Change default resolve
4702 flags based on language version.
4703 (Expression.Error_UnexpectedKind): Use a simple string array
4704 rather than an ArrayList.
4705 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4707 (TypeOfVoid.DoResolve): Likewise.
4708 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4709 flags argument -- it always has the same value.
4711 2005-05-31 Raja R Harinath <rharinath@novell.com>
4714 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4715 Use it in the error message.
4716 * assign.cs, expression.cs, statement.cs: Update.
4718 2005-05-30 Raja R Harinath <rharinath@novell.com>
4721 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4722 the "almostMatchedMember" case too.
4723 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4724 that failed the accessibility checks to 'almost_match'.
4726 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4728 * attribute.cs: Use internal MethodBuilder methods to set
4729 ExactSpelling and SetLastError on PInvoke methods, instead
4730 of passing them via charset. Fixes #75060.
4732 2005-05-27 Raja R Harinath <rharinath@novell.com>
4734 * parameter.cs (Parameter): Remove TODO comment.
4735 (Parameter.DefineParameter): Remove Location parameter.
4736 (Parameters.LabelParameters): Likewise.
4737 * class.cs (Constructor.Emit): Update to change.
4738 (MethodData.Emit): Likewise.
4739 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4740 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4742 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4745 Removed Parameters.Location and added Parameter.Location instead.
4746 Removed Location parameter from Emit() and GetSignature().
4753 Modified all related calls.
4755 2005-06-21 Martin Baulig <martin@ximian.com>
4757 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4758 left-hand side is not a nullable type; fixes #75328.
4760 2005-06-21 Martin Baulig <martin@ximian.com>
4763 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4764 (TypeManager.GetFullNameSignature): Likewise.
4766 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4767 `source.FullName' and `target.FullName' to check whether there are
4768 two conflicting definitions.
4770 2005-06-21 Martin Baulig <martin@ximian.com>
4772 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4773 a BoxedCast - also for reference types - to be compatible with csc.
4775 2005-06-21 Martin Baulig <martin@ximian.com>
4777 * expression.cs (MemberAccess.DoResolve): Add support for nested
4778 types in a generic instance; fixes #75320.
4780 2005-06-20 Martin Baulig <martin@ximian.com>
4782 * generic.cs (TypeManager.InferType): Also walk the class
4783 hierarchy for generic instances; fixes #75261.
4785 2005-06-17 Martin Baulig <martin@ximian.com>
4787 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4788 to make things work for corlib.
4790 2005-06-15 Martin Baulig <martin@ximian.com>
4792 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4793 obsolete `SecurityAction' values.
4795 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4797 * rootcontext.cs: Reset TargetExt as well.
4799 2005-06-09 Martin Baulig <martin@ximian.com>
4801 * delegate.cs (Delegate.VerifyMethod): Added
4802 `MethodGroupExpr old_mg' argument; inherit its
4803 `HasTypeParameters'; fix #75085.
4805 2005-06-09 Martin Baulig <martin@ximian.com>
4807 * expression.cs (Invocation.OverloadResolve): Correctly handle
4808 generic methods for the SetMemberIsUsed(); fix #75064.
4810 2005-06-09 Martin Baulig <martin@ximian.com>
4812 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4815 2005-06-08 Martin Baulig <martin@ximian.com>
4817 * cs-parser.jay (nullable_type_or_conditional): If we put the
4818 nullable back and our `type' is a `ComposedCast', remove the
4819 nullable from it. Fixes #75156.
4821 * expression.cs (ComposedCast.RemoveNullable): New public method.
4823 2005-06-08 Martin Baulig <martin@ximian.com>
4825 The big Iterators rewrite :-)
4827 * iterators.cs: Rewrite this to use the anonymous methods framework.
4829 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4830 before the TypeContainers; see 2test-21.cs.
4833 (TypeContainer.DefineType): Don't create a new EmitContext if we
4834 already have one (this only happens if we're an Iterator).
4835 (TypeContainer.Define): Also call Define() on all our iterators.
4836 (Method.CreateEmitContext): Added support for iterators.
4839 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4840 (AnonymousContainer.CreateMethodHost): Moved here from
4841 AnonymousMethod and made abstract.
4842 (AnonymousContainer.CreateScopeType): New abstract method.
4843 (AnonymousContainer.IsIterator): New public property.
4844 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4845 get the ScopeTypeBuilder rather than manually defining it here.
4846 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4849 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4850 before RootContext.DefineTypes().
4852 * codegen.cs (EmitContext.RemapToProxy): Removed.
4853 (EmitContext.CurrentAnonymousMethod): Changed type from
4854 AnonymousMethod -> AnonymousContainer.
4855 (EmitContext.ResolveTopBlock): Protect from being called twice.
4856 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4857 (EmitContext.EmitThis): Removed the iterators hacks; use the
4858 anonymous methods framework for that.
4861 (ToplevelBlock.Container): Make this a property, not a field.
4862 (ToplevelBlock.ReParent): New public method; move the
4863 ToplevelBlock into a new container.
4864 (Foreach.TemporaryVariable): Simplify.
4866 2005-06-05 Martin Baulig <martin@ximian.com>
4868 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4869 (Block.AddTemporaryVariable): New public method; creates a new
4870 `LocalInfo' for a temporary variable.
4871 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4873 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4874 non-iterator variables.
4876 2005-06-05 Martin Baulig <martin@ximian.com>
4878 * statement.cs (Foreach.TemporaryVariable): Create the
4879 LocalBuilder in the Emit phase and not in Resolve since in some
4880 situations, we don't have an ILGenerator during Resolve; see
4881 2test-19.cs for an example.
4883 2005-06-04 Martin Baulig <martin@ximian.com>
4885 The big Foreach rewrite - Part II.
4887 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4888 with `PropertyInfo ienumerator_getcurrent'.
4890 * codegen.cs (VariableStorage): Removed.
4893 (Foreach): Derive from Statement, not ExceptionStatement.
4894 (Foreach.CollectionForeach): New nested class. Moved all the code
4895 dealing with collection foreach here.
4896 (Foreach.ForeachHelperMethods): Removed.
4897 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4899 2005-05-23 Martin Baulig <martin@ximian.com>
4901 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4902 don't need to. Fix #75014.
4904 2005-05-26 Raja R Harinath <rharinath@novell.com>
4906 Improve user-defined conversion handling.
4907 * convert.cs (GetConversionOperators): Rewrite. Return only the
4908 applicable operators.
4909 (AddConversionOperators): New. Helper for GetConversionOperators.
4910 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4911 there is only one most encompassed/encompassing type.
4912 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4913 "applicable operator" handling.
4914 (UserConversion): Move cache here from GetConversionOperators.
4915 Directly cache the chosen operator, rather than the whole
4917 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4918 case. Allow conversion of decimal to sbyte and byte too.
4919 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4920 New static methods. Used to avoid allocating EmptyExpressions in
4923 2005-05-24 Duncan Mak <duncan@novell.com>
4925 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4926 another class, used in Convert.ExplicitNumericConversion.
4927 (CastToDecimal): New class, similar to above, but casts to
4928 System.Decimal, used in Convert.ImplicitNumericConversion and also
4929 in explicit convesion from double/float to decimal.
4931 * convert.cs (ImplicitNumericConversion): Handle implicit
4932 conversions to System.Decimal.
4933 (ExplicitNumericConversion): handle explicit conversions to
4938 2005-05-20 Miguel de Icaza <miguel@novell.com>
4940 * typemanager.cs: Do not throw an exception in the TypeBuilder
4941 case, we take care of it on the TypeCode.
4943 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4945 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4948 * cs-parser.jay: Catch more lexical errors.
4950 * report.cs: Add one more Error method.
4953 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4955 2005-05-20 Martin Baulig <martin@ximian.com>
4957 * class.cs (TypeContainer.CircularDepException): Removed.
4958 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4959 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4960 (CS0146) and interface (CS0529) dependencies here.
4962 2005-05-20 Martin Baulig <martin@ximian.com>
4964 * expression.cs (New.DoResolve): Move the CS0712 check above the
4965 CS0144 check; otherwise it can never be reached.
4967 2005-05-20 Martin Baulig <martin@ximian.com>
4969 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4971 2005-05-20 Martin Baulig <martin@ximian.com>
4973 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4975 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4977 2005-05-19 Martin Baulig <martin@ximian.com>
4980 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4981 to disable error reporting.
4983 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4984 here since we don't want to report an error; see the new test-336.cs.
4986 2005-05-19 Raja R Harinath <rharinath@novell.com>
4988 * statement.cs (ToplevelBlock.GetParameterReference)
4989 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4990 Move here from class Block.
4991 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4992 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4994 2005-05-18 Martin Baulig <martin@ximian.com>
4999 (FlowBranching.Reachability): Add non-static public And() and Or()
5001 (FlowBranchingSwitch): New class; do the `break_origins' thing
5002 like in FlowBranchingLoop.
5003 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5004 reachability, not just locals and parameters.
5005 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5006 switch; MergeBreakOrigins() now takes care of that.
5008 2005-05-18 Martin Baulig <martin@ximian.com>
5010 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5011 a loop and may leave it, reset the barrier; fixes #74974.
5013 2005-05-16 Raja R Harinath <rharinath@novell.com>
5015 Fix test-382.cs. Emit values of decimal constants.
5016 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5018 (TypeContainer.AddField): ... this.
5019 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5020 with initializers to include 'Const's.
5021 (ClassPart.RegisterFieldForInitialization): Forward to
5023 * const.cs (Const.Const): Pass initializer to base class.
5024 (Const.Define): In case of decimal constants, register them for
5025 initialization in a static constructor.
5027 2005-05-14 Martin Baulig <martin@ximian.com>
5029 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5030 do not call ResolveUnreachable() on unreachable statements in
5031 here, see the comment in the source code.
5033 2005-05-13 Raja R Harinath <rharinath@novell.com>
5036 * expression.cs (BinaryResolveOperator): If one of the operands of
5037 an equality comparison is 'null' and the other is a pointer type,
5038 convert the null to a NullPointer.
5039 * convert.cs (ImplicitReferenceConversion): If the expression is a
5040 NullLiteral and the target type is a pointer type, return a
5041 NullPointer instead.
5042 (ImplicitConversionStandard): Likewise.
5044 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5046 * cs-parser.jay: Set readonly context based on special constructs.
5048 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5049 readonly variable error handling.
5051 * rootcontext.cs (EmitCode): Don't verify members when error
5054 * statement.cs (LocalInfo): Add reaodnly context information.
5055 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5057 2005-05-17 Martin Baulig <martin@ximian.com>
5059 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5062 2005-05-13 Martin Baulig <martin@ximian.com>
5064 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5065 handle unreachable blocks.
5067 2005-05-13 Martin Baulig <martin@ximian.com>
5070 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5071 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5074 2005-05-13 Martin Baulig <martin@ximian.com>
5076 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5077 instance variable, not a local. Fix #74873.
5078 (Block.ResolveUnreachable): Set it to true here.
5080 2005-05-12 Martin Baulig <martin@ximian.com>
5082 * cs-parser.jay (property_declaration): Pass the `current_class',
5083 not the `current_container' to Property's .ctor. Fixes #74912.
5085 2005-05-11 Martin Baulig <martin@ximian.com>
5087 * typemanager.cs (Closure): Copy this from MCS and merge all the
5088 GMCS-specific changes into it.
5090 2005-05-12 Raja R Harinath <harinath@gmail.com>
5093 * typemanager.cs (unmanaged_enclosing_types): New.
5094 (IsUnmanagedType): Avoid infloops by using
5095 'unmanaged_enclosing_types' to talk with recursive invocations.
5097 2005-05-11 Duncan Mak <duncan@novell.com>
5099 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5100 continuing to process for 'arg'.
5101 (handle_preprocessing_directive): Check the argument of the #endif
5102 directive and report error CS1025 if there are any trailing
5105 According to the C# spec, having even whitespace after the #endif
5106 directive is illegal; however, because we call arg.TrimEnd ()
5107 beforehand, we have the same behavior as csc, allowing whitespace
5108 after the directive.
5112 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5116 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5117 (Constructor.GetObsoleteAttribute): Implemented correctly.
5119 2005-05-10 Martin Baulig <martin@ximian.com>
5121 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5122 resolve the type; fixes #74864.
5123 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5124 in DoResolve(); fixes #74862.
5126 2005-05-10 Martin Baulig <martin@ximian.com>
5128 * support.cs (ReflectionParameters.ParameterModifier): Use
5129 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5130 and `ParameterAttributes.In'. Fixes #74884.
5132 2005-05-10 Martin Baulig <martin@ximian.com>
5134 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5135 the cache if we're just looking for `MemberTypes.NestedType' in a
5138 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5139 constraints if we're still resolving the type tree.
5140 (Expression.MemberLookup): If we're resolving the type tree, only
5141 look for `MemberTypes.NestedType' since we're only interested in
5144 * class.cs (TypeContainer.DefineType): Don't resolve the type
5145 parameters here; do this later in ResolveType() after the type
5146 tree has been resolved.
5147 (TypeContainer.ResolveType): New public method; this is called
5148 after the type tree is resolved and before the types are being
5149 populated. We resolve the generic constraints here.
5150 (TypeContainer.DoDefineMember): Check the constraints on our base
5151 class and interfaces.
5153 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5154 set the `ResolvingTypeTree' flag on the EmitContext.
5156 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5158 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5160 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5162 * expression.cs (Argument.GetParameterModifier): Turned to property.
5163 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5165 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5168 2005-05-09 Raja R Harinath <rharinath@novell.com>
5171 * decl.cs (MemberCache.AddMethods): Register override methods,
5172 rather than non-override methods.
5173 * typemanager.cs (RegisterOverride): New.
5174 (IsOverride): Update.
5176 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5178 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5180 2005-05-06 Martin Baulig <martin@ximian.com>
5183 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5184 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5186 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5190 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5191 recursive declaration.
5193 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5195 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5197 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5199 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5201 2005-05-05 Raja R Harinath <rharinath@novell.com>
5204 * decl.cs (DeclSpace.FamilyAccessible):
5205 Use TypeManager.IsNestedFamilyAccessible.
5207 Fix reopened #64812.
5208 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5211 2005-05-04 Raja R Harinath <rharinath@novell.com>
5212 Abin Thomas <projectmonokochi@rediffmail.com>
5213 Anoob V E <projectmonokochi@rediffmail.com>
5214 Harilal P R <projectmonokochi@rediffmail.com>
5217 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5218 allow access to all static members.
5220 2005-05-04 Martin Baulig <martin@ximian.com>
5222 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5224 2005-05-04 Martin Baulig <martin@ximian.com>
5228 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5229 section at the end; make things work if `default' is not the last
5232 2005-05-04 Martin Baulig <martin@ximian.com>
5236 * statement.cs (Switch): Replaced the `got_default' field with a
5237 `default_section' one.
5238 (Switch.CheckSwitch): Set `default_section' here.
5239 (Switch.Resolve): If we're a constant switch and the constant is
5240 not found, use the default section.
5242 2005-05-03 Martin Baulig <martin@ximian.com>
5244 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5246 * statement.cs (Foreach.ArrayForeach): New nested class.
5247 (Foreach.TemporaryVariable): New nested class.
5248 (Foreach.EmitArrayForeach): Removed; this is now in the new
5251 2005-05-03 Raja R Harinath <rharinath@novell.com>
5253 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5255 (VerifyPendingMethods): Revert change below.
5257 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5258 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5259 that used to trigger warning -28. Remove warning -28.
5260 * expression.cs (Invocation.OverloadResolve): Use
5261 TypeManager.IsOverride to distinguish override methods.
5264 * pending.cs (VerifyPendingMethods): If a base type implements the
5265 requested interface, don't bother checking individual methods of
5266 the base type. As a side-effect, this prevents the creation of
5267 unnecessary proxies.
5269 2005-05-02 Martin Baulig <martin@ximian.com>
5273 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5274 Also `And' the locals if the old vector is null.
5275 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5276 null; in this case we basically reset all the variables.
5278 2005-05-02 Martin Baulig <martin@ximian.com>
5282 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5283 Added `FlowBranching branching' argument; always `and' the
5284 variables instead of `or'ing them unless we're an infinite loop.
5286 * statement.cs (While.Resolve): Create a new sibling unless we're
5289 2005-05-02 Martin Baulig <martin@ximian.com>
5293 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5294 arguments; use it instead of creating a new TopLevelBlock.
5295 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5296 our ConstructorInitializer.
5299 (TopLevelBlock.TopLevelBranching): New public property.
5300 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5301 and create our `TopLevelBranching'.
5303 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5304 anonymous method host, use `block.TopLevelBranching' rather than
5305 creating a new branching.
5307 2005-04-20 Miguel de Icaza <miguel@novell.com>
5309 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5310 a ScopeInfo, if any of the current children is a child of the new
5311 entry, move those children there.
5313 2005-04-30 Martin Baulig <martin@ximian.com>
5315 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5316 at the beginning of a SwitchSection. Fix #73335.
5318 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5321 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5323 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5324 (FieldExpr.DoResolve): Obsolete members are ignored for field
5327 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5329 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5330 of arrays detection.
5332 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5334 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5336 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5339 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5341 * cs-parser.jay: Use the prefered version of -unsafe in error
5344 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5346 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5349 2005-04-20 John Luke <john.luke@gmail.com>
5351 * driver.cs: fix typo in error message, --outout to --output
5353 2005-04-30 Martin Baulig <martin@ximian.com>
5355 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5356 handle the .NET 2.x security attributes.
5358 2005-04-30 Martin Baulig <martin@ximian.com>
5361 (TypeManager.ExpandInterfaces): Don't add things twice.
5364 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5366 2005-04-29 Martin Baulig <martin@ximian.com>
5368 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5370 * anonymous.cs: Added support for anonymous generic methods.
5372 2005-04-29 Martin Baulig <martin@ximian.com>
5374 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5377 2005-04-29 Martin Baulig <martin@ximian.com>
5379 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5381 * expression.cs (New.DoResolve): Fix the CS0304 check.
5383 2005-04-29 Martin Baulig <martin@ximian.com>
5385 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5388 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5389 explicit interface implementation, compare the interface types.
5390 (MethodData.Define): Use the new naming scheme from the latest
5392 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5394 * decl.cs (MemberName.GetMemberName): Removed.
5395 (MemberName.MethodName, FullName): New properties.
5397 2005-04-25 Raja R Harinath <rharinath@novell.com>
5399 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5401 2005-04-22 Martin Baulig <martin@ximian.com>
5403 * generic.cs (GenericMethod): Create the EmitContext in the
5404 `Define()'; in `Define(MethodBuilder)', create the type parameters
5405 before calling `Define()'. Fixes #73933.
5407 2005-04-22 Martin Baulig <martin@ximian.com>
5410 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5411 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5413 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5414 ConstructedType, check its constraints.
5416 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5418 * codegen.cs (InRefOutArgumentResolving): New field.
5420 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5421 fields outside contructor.
5423 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5425 2005-04-19 Miguel de Icaza <miguel@novell.com>
5427 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5428 parameter code was not completed ever, so it was not as up-to-date
5429 as local variables. Must finish it.
5431 The bug fix was to compare the Toplevel of the block, not the
5432 current block. Thanks for Ben for pointing this out.
5434 2005-04-19 Raja R Harinath <rharinath@novell.com>
5436 * decl.cs (AddMethods): Use the declaring type of the problem
5437 method to determine if we want to squash a warning.
5439 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5441 * attribute.cs: Removed debug output.
5443 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5445 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5448 2005-04-18 Raja R Harinath <rharinath@novell.com>
5451 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5452 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5453 all null comparisons against reference types.
5455 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5458 * class.cs (TypeContainer.CircularDepException) New nested
5460 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5461 (TypeContainer.DefineType): Removed error, reset InTransit before
5463 (Class.DefineType): Throw exception when is in Transit.
5464 Catch exception and report error.
5465 (Struct.DefineType): Throw exception when is in Transit.
5466 Catch exception and report error.
5467 (Interface.DefineType): Throw exception when is in Transit.
5468 Catch exception and report error.
5470 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5471 handle nested exception handlers.
5473 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5476 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5477 InFinally and InCatch storage.
5479 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5480 (Catch.Resolve): Set and Restore ec.InCatch.
5481 (Try.Resolve): Set and Restore ec.InFinally.
5482 (Try.HasCatch): True when try has catch.
5484 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5486 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5487 for the same event member, so exclude such cases from warning 419.
5490 2005-04-16 Miguel de Icaza <miguel@novell.com>
5492 * expression.cs (Binary.ResolveOperator): Apply patch from John
5493 Luke to fix bug 59864: operators &, | and ^ on enumerations
5494 require that the same enum type on both sides.
5496 * driver.cs: Add warnings to old flag usage, this is to assist
5497 people who produce Makefiles and hope that the Makefiles will be
5500 * class.cs (TypeContainer.EmitType): Moved the definition of the
5501 special $PRIVATE$ field from the resolve phase to the Emit phase.
5502 During resolve we do not know if we are a struct with
5503 HasExplicitLayout, we know this only after the attributes for the
5506 Set the FieldOffset to zero on the dummy field that we create for
5507 the class. Fixes 74590.
5509 2005-04-16 Raja R Harinath <rharinath@novell.com>
5512 * ecore.cs (PropertyExpr.resolved): New.
5513 (DoResolve): Use it to handle a case of double resolution here.
5514 Handle a case of identical-name-and-type-name.
5515 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5516 resolution by storing the results of expression resolution back
5517 into the "probes" array.
5519 2005-04-15 Raja R Harinath <rharinath@novell.com>
5521 Fix cs0208-7.cs and cs0208-8.cs.
5522 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5523 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5524 error reporting to point out the reason a struct is not unmanaged.
5526 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5528 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5529 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5531 2005-04-13 Raja R Harinath <rharinath@novell.com>
5534 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5535 IdenticalNameAndTypeName here.
5536 (EventExpr.InstanceResolve): Likewise.
5538 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5540 C# 2.0 DefaultCharSetAttribute implementation
5542 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5543 which allows us to set GlobalNamespace for every resolve.
5544 (Attribute.ResolveArguments): Cut from Resolve.
5545 (Attribute.GetCharSetValue): Returns CharSet named argument.
5546 (Attribute.DefinePInvokeMethod): Gets default charset from
5548 (GlobalAttribute.ResolveAsTypeStep): Override.
5549 (GlobalAttribute.ResolveArguments): Override.
5551 * class.cs (TypeAttr): Is protected.
5553 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5554 (ModuleClass.DefaultCharSetType): New memeber.
5555 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5557 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5558 charset from module.
5560 * delegate.cs (TypeAttr): Override.
5561 (Delegate.DefineType): Use this TypeAttr.
5563 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5564 at very early stage (before types are defined) to resolve model
5565 module attributes. It will probably not work with corlib but it
5568 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5569 charset from module.
5571 * typemanager.cs (default_charset_type): New type.
5573 2005-04-13 Raja R Harinath <rharinath@novell.com>
5575 * decl.cs (MemberCache.AddMethods): Don't warn if
5576 System.Object.Finalize has buggy MethodAttributes.
5578 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5581 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5583 * doc.cs : detect ambiguous reference to overloaded members.
5584 Fixed bug #71603. MS 1.1 csc does not detect it.
5586 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5588 * doc.cs : delegates must not be referenced with parameters.
5591 2005-04-12 Miguel de Icaza <miguel@novell.com>
5593 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5595 2005-04-10 Miguel de Icaza <miguel@novell.com>
5597 * driver.cs (MainDriver): Stop processing if the CLS stage found
5600 (CompilerCallableEntryPoint.InvokeCompiler): Always
5601 reset after execution; Take a TextWriter argument for the
5604 * report.cs: Use the error stream instead of hardcoding stderr.
5606 2005-04-09 Miguel de Icaza <miguel@novell.com>
5608 * class.cs: Reduce code paths to test, too small of an
5609 optimization to make it worth the extra testing. Always perform
5612 2005-04-08 Raja R Harinath <rharinath@novell.com>
5615 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5616 operators that had errors reported on them.
5618 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5620 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5622 (Attribute.Resolve): Add named argument type checking.
5624 * class.cs (FixedField.Define): Use IsPrimitiveType
5626 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5628 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5629 unsafe parameter types.
5631 * statement.cs (Using.ResolveExpression): Add better error description.
5633 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5635 2005-04-08 Raja R Harinath <rharinath@novell.com>
5638 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5639 AttributeUsageAttribute in the emitcontext of the attribute class,
5640 not in the emitcontext of the attributable entity it was attached to.
5641 * cs-parser.jay: Use 'current_class', not 'current_container',
5642 when creating a GlobalAttribute.
5644 2005-04-08 Alp Toker <alp@atoker.com>
5646 * pending.cs: The fix to #58413 failed to compile methods implementing
5647 interfaces with/without params modifiers and vice versa, even though
5648 params modifiers aren't part of the signature. Make the modifier check
5649 less strict as in csc.
5651 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5652 Anoob V E <projectmonokochi@rediffmail.com>
5653 Harilal P R <projectmonokochi@rediffmail.com>
5656 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5657 modifiers of pending methods.
5658 (PendingImplementation.PendingImplementation): Initialize it.
5659 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5660 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5661 with ParameterData. Add check for modifiers.
5662 * class.cs (MethodData.Define): Update to changes.
5664 2005-04-07 Raja R Harinath <rharinath@novell.com>
5666 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5668 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5670 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5673 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5676 * typemanager.cs: Registered RequiredAttributeAttribute.
5678 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5680 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5681 Warning CS0169 is back at level 3.
5682 (IMethodData.SetMemberIsUsed): New method.
5684 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5685 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5687 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5689 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5691 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5694 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5697 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5698 to avoid the problems with nested types.
5700 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5701 Anoob V.E <projectmonokochi@rediffmail.com>
5702 Harilal P.R <projectmonokochi@rediffmail.com>
5703 Raja R Harinath <rharinath@novell.com>
5706 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5708 * typemanager (GetConstructor): Make public.
5710 2005-04-05 John Luke <john.luke@gmail.com>
5711 Raja R Harinath <rharinath@novell.com>
5714 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5715 struct too. Return false quicker in a few cases.
5716 (VerifyUnManaged): Use it.
5718 2005-04-05 Raja R Harinath <rharinath@novell.com>
5721 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5722 not 'unreachable_seen'.
5724 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5726 * attribute.cs (Attribute.GetValue): Removed unused.
5728 * codegen.cs (CodeGen.TrimExt): Removed unused.
5730 * cs-parser.jay (output): Removed unused.
5732 * cs-tokenizer.cs (hex_digits): Removed unused.
5734 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5736 * expression.cs (Indirection.LoadExprValue): Removed unused.
5737 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5739 * iterators.cs (Iterator.param_types): Removed unused.
5741 * statement.cs (Goto.block): Removed unused.
5742 (ToplevelBlock.did): Removed unused.
5743 (Switch.ResolveConstantSwitch): Removed unused.
5745 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5747 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5750 2005-04-19 Martin Baulig <martin@ximian.com>
5752 Merged r42462 from MCS and made it work for GMCS.
5754 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5756 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5758 2005-04-01 Raja R Harinath <rharinath@novell.com>
5760 Fix #74232 and cs0208-3.cs.
5761 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5762 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5763 unmanaged type. Don't use FieldBuilders when 't' is a
5764 TypeBuilder. Use ModFlags and MemberType fields.
5765 * class.cs (MemberBase.member_type): Rename from MemberType.
5766 (MemberBase.MemberType): New property. Determines member_type on
5768 (MemberBase.DoDefine): Don't initialize MemberType here.
5769 (FieldMember.Define): Likewise.
5771 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5774 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5775 Attributes are emitted there.
5777 2005-04-01 Raja R Harinath <rharinath@novell.com>
5779 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5780 keyword in 'partial enum' too.
5781 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5783 Report from Kamil Skalski <nazgul@omega.pl>.
5786 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5787 have partial containers too.
5789 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5790 in block' checks to Block.CheckInvariantMeaningInBlock.
5791 * statement.cs (Block.GetKnownVariableInfo): Make private.
5792 (Block.IsVariableUsedInChildBlock): Remove.
5793 (Block.IsVariableUsedInBlock): Likewise.
5794 (Block.CheckInvariantMeaningInBlock): New. Show location of
5795 conflicting declaration.
5796 (Block.AddVariable): Make error messages less long-winded and more
5797 specific. Show location of conflicting declaration.
5798 * parameter.cs (Parameters.Location): New readonly property.
5800 2005-03-31 Raja R Harinath <rharinath@novell.com>
5802 Clean up semantics of invoking ResolveMemberAccess.
5803 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5804 can have an instance, ensure that we pass in a non-TypeExpression
5805 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5806 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5807 argument. Update to changes and simplify.
5808 (FieldExpr.Emitinstance): Remove CS0120 check.
5809 (PropertyExpr.EmitInstance): Likewise.
5810 * expression.cs (Argument.Resolve): Likewise.
5811 (Invocation.DoResolve): Update to changes in semantics of
5814 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5817 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5820 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5822 2005-03-31 Raja R Harinath <rharinath@novell.com>
5824 Fix difference in behaviour with commandline invocation.
5825 * driver.cs (Driver.Reset): New.
5826 (CompilerCallableEntryPoint): Call it.
5828 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5829 variable" warnings if the boolean expression failed to resolve.
5831 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5833 * attribute.cs: Fix the union of several permissions when some of them
5834 are unrestricted (so the result isn't an unrestricted permission set).
5837 2005-03-30 Raja R Harinath <rharinath@novell.com>
5839 * ecore.cs (MemberExpr): New class. Convert from interface
5841 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5842 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5844 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5845 (MethodGroupExpr.IsExplicitImpl): Remove.
5846 (Expression.GetFieldFromEvent): Remove.
5847 (SimpleName.MemberStaticCheck): Remove.
5848 (SimpleName.DoSimpleNameResolve): Update to changes.
5849 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5850 (MemberAccess.IdenticalNameAndTypeName): Remove.
5851 (MemberAccess.error176): Move to MemberExpr.
5852 (MemberAccess.DoResolve): Update to changes.
5853 (BaseAccess.DoResolve): Likewise.
5855 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5857 C# 2.0 Conditional attribute class implementation
5859 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5860 Analyzes class whether it has attribute which has ConditionalAttribute
5861 and its condition is not defined.
5863 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5864 (Class.IsExcluded): New method. Search for at least one defined
5865 condition in ConditionalAttribute of attribute class.
5867 2005-03-30 Raja R Harinath <rharinath@novell.com>
5869 * ecore.cs (PropertyExpr): Derive from Expression, not
5870 ExpressionStatement.
5871 (PropertyExpr.EmitStatement): Remove.
5873 2005-03-29 Raja R Harinath <rharinath@novell.com>
5876 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5877 internal field "value__" of an enum be private. The examples for
5878 "value__" that I found on MSDN all used FieldAttributes.Private.
5880 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5881 Don't mention IL method attribute names.
5883 Fix #47991. Remove a TODO.
5884 * statement.cs (Block.Toplevel): Make into a field.
5885 (Block.Parameters): Move into ToplevelBlock.
5886 (Block.known_variables): Rename from child_variable_names.
5887 (Block.Block): Remove variants that take Parameters. Initialize
5888 'Toplevel' with the immediately surrounding toplevel block.
5889 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5890 LocalInfo parameter.
5891 (Block.GetKnownVariableInfo): New.
5892 (Block.IsVariableNameUsedInChildBlock): Update.
5893 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5894 the block, even though it may not be in scope.
5895 (Block.AddVariable): Remove Parameters parameter. Use
5896 Toplevel.Parameters instead.
5897 (Block.AddConstant): Remove Parameters parameter.
5898 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5899 (Block.IsParamaterReference): Likewise.
5900 (Block.IsLocalParameter): Likewise. Simplify a lot.
5901 (ToplevelBlock.Parameters): New. Moved from Block.
5902 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5903 initialize Parameters to a non-null value.
5904 * cs-parser.jay: Update to changes.
5905 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5906 simple names that mean different things in the same block. Use
5907 Block.IsVariableNameUsedInBlock.
5909 2005-03-28 Raja R Harinath <rharinath@novell.com>
5911 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5913 2005-03-26 Raja R Harinath <harinath@acm.org>
5916 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5917 fails to resolve, ensure that the LHS is still resolved as an
5920 2005-03-25 Raja R Harinath <harinath@acm.org>
5922 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5924 (Enum.current_ec): Remove.
5925 (Enum.LookupEnumValue): Remove EmitContext argument.
5926 Just uses the one created during DefineType.
5927 (Enum.FindMembers): Update.
5928 * expression.cs (MemberAccess.DoResolve): Update.
5930 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5932 * assign.cs (Assign.DoResolve): Check for CS1717 when
5933 source and target are same (uses Equals).
5935 * expression.cs (LocalVariableReference, ParameterReference,
5936 This): Implemented Equals, GetHashCode.
5938 * statement.cs (Block.GetParameterReference): Removed useless
5941 2005-03-22 Raja R Harinath <rharinath@novell.com>
5944 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5945 blocks before deciding whether the error is cs0136 or cs0128.
5947 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5948 (using_alias_directive, using_namespace_directive): Pass
5949 MemberName, not an expression to Namespace.UsingAlias and
5951 (MakeName): Use the MemberName of the namespace.
5952 * namespace.cs (Namespace.MemberName): New.
5953 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5954 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5956 * decl.cs (MemberName.Name): Make readonly.
5957 (MemberName.FromDotted): New "constructor".
5958 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5959 (MemberCore.Name): Compute from MemberName on demand.
5960 (MemberCore.SetMemberName): Provide a way to change the
5962 (MemberCore.AddToContainer): Don't take a fullname parameter.
5963 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5964 fully qualified name of the container to the member name.
5965 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5966 only if the type is a member of the root container.
5967 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5968 MemberName.Left rather than searching for an embedded ".".
5969 (PartialContainer.CreatePart): Update to changes in RootContext.
5970 (MemberBase.ShortName): Turn into a property. Use
5971 MemberCore.SetMemberName.
5972 (MemberBase.ExplicitInterfaceName): Remove.
5973 (MemberBase.UpdateMemberName): Remove.
5974 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5975 (PropertyBase.SetMemberName): New override.
5976 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5977 (Tree.GetDecl): New.
5978 (Tree.AllDecls): Rename from Decls.
5979 * attribute.cs, enum.cs, report.cs: Update to changes.
5980 * driver.cs (MainDriver): Use MemberName.FromDotted on
5981 RootContext.MainClass.
5983 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5985 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5988 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5990 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5992 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5993 property accessor modifiers.
5995 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5996 fixed buffer attribute (CS1716).
5997 (PropertyMethod.HasCustomAccessModifier): When property accessor
5998 has custom modifier.
6000 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6002 (PropertyExpr.DoResolveLValue): Add CS0272.
6004 2005-03-17 Miguel de Icaza <miguel@novell.com>
6006 * convert.cs: When converting to a pointer, use the proper Conv.U
6007 or Conv.I depending on the source data type.
6009 * cs-tokenizer.cs: Make the size for large decimal constants,
6012 2005-03-17 Martin Baulig <martin@ximian.com>
6014 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6015 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6017 2005-03-17 Martin Baulig <martin@ximian.com>
6019 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6020 to bool so we can return an error condition.
6021 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6024 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6026 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6029 2005-03-16 Raja R Harinath <rharinath@novell.com>
6031 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6032 Refactor to avoid traversing the list of assemblies, and to avoid
6033 string concatenation.
6034 * typemanager.cs (guid_attr_type): Remove.
6035 (negative_hits, pointers, references): Remove hashes.
6037 (GetConstructedType): New. Uses type_hash to handle constructed
6038 types (arrays, references, pointers).
6039 (GetReferenceType, GetPointerType): Use it.
6040 (GetNestedType): New. Uses type_hash to handle nested types of
6042 (LookupType, LookupTypeDirect): Remove.
6043 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6044 'types' hash and LookupTypeReflection directly.
6045 (params_string, params_object): Use GetConstructedType.
6046 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6048 (Namespace.Lookup): Use cached_types.
6049 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6050 provided by old TypeManager.LookupType.
6051 * rootcontext.cs (MakeFQN): Remove.
6052 * decl.cs (DeclSpace.MakeFQN): Likewise.
6053 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6054 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6055 TypeManager.GetConstructedType.
6056 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6058 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6060 * cs-parser.jay: Fix build.
6062 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6064 * class.cs (TypeContainer.CircularDepException) New nested
6065 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6067 * cs-parser.jay: Reports CS1527 for any namespace element.
6069 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6072 * expression.cs (ParameterReference.IsAssigned): Changed error to
6074 (Error_WrongNumArguments): Moved CS0245 detection here.
6076 * statement.cs (Return.Resolve): Add CS1622 report.
6078 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6080 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6082 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6084 * attribute.cs expression.cs: Get rid of some allocations.
6086 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6088 * doc.cs : just eliminate the latest change.
6090 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6092 * doc.cs : commented out the latest change. It breaks xml-030.cs
6094 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6096 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6097 fail. So invoke CreateType() in FindDocumentedType().
6099 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6101 * cs-tokenizer.cs : added IsKeyword().
6102 * doc.cs : Detect keyword incorrectly used as identifier.
6103 Allow identifiers prefixed by @.
6105 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6107 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6108 It caused exception in namespace resolving (again!).
6110 * class.cs (Class.ctor): Removed exit.
6111 (PropertyMethod.ctor): ditto.
6113 * codegen.cs (Codegen.Reset): Reset static data.
6114 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6116 * cs-tokenizer.cs (Cleanup): Removed.
6118 * driver.cs (GetSystemDir): Rewrote to one line command.
6119 It caused problem with unloaded dynamic modules.
6120 (UnixParseOption): Removed Exit.
6121 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6122 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6123 Now can be mcs used as library.
6125 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6128 * location.cs (Reset): Reset static data.
6130 * namespace.cs (Reset): Reset static data.
6132 * report.cs (Report.Reset): Reset static data.
6134 * rootcontext.cs (RootContext.Reset): Reset static data.
6136 * tree.cs (RootTypes.ctor): Use Location.Null
6138 * typemanager.cs (TypeManager.Reset): Reset static data.
6139 (CoreLookupType): Removed Exit.
6140 (TypeHandle.Reset): Reset static data.
6142 2005-03-10 Raja R Harinath <rharinath@novell.com>
6145 * typemanager.cs (ComputeNamespaces): Import namespaces from
6146 referenced modules too.
6148 2005-03-09 Raja R Harinath <rharinath@novell.com>
6150 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6153 2005-03-09 Raja R Harinath <rharinath@novell.com>
6155 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6156 enclosing DeclSpace. This ensures that a name-lookup populates
6157 more caches and there are fewer 'TypeExpression's. Carve out
6158 nested type lookup into ...
6159 (LookupNestedTypeInHierarchy): ... this.
6161 2005-04-15 Martin Baulig <martin@ximian.com>
6163 Merged r41590 from MCS and make it work in the generics land.
6165 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6168 * class.cs (PartialContainer.UpdateConstraints): Removed.
6169 (PartialContainer.CheckConstraints): Removed.
6170 (PartialContainer.SetParameterInfo): Store the constraints here.
6171 (PartialContainer.DefineTypeParameters): New public method;
6172 resolve the type parameter's constraints here. Note that the
6173 PartialContainer doesn't have an EmitContext anymore, so we must
6174 do this in the ClassPart.
6176 2005-03-09 Raja R Harinath <rharinath@novell.com>
6178 Clean up a few partial-class semantics.
6179 Fixes test-357.cs and cs1618-2.cs.
6180 * cs-parser.jay (struct_declaration): Use 'current_class' as
6181 parent of newly-created struct. Remove call to Register ().
6182 Use 'pop_current_class' to complete handing the current struct.
6183 (interface_declaration): Likewise.
6184 (class_declaration): Likewise.
6185 (enum_declaration): Use 'current_class' as parent of newly created
6187 (delegate_declaration): Likewise.
6188 (pop_current_class): New function. This is used to handle closing
6189 up the 'current_class' and 'current_container', and pointing them
6190 to the enclosing class/container.
6191 (CSharpParser): Initialize 'current_class' too.
6192 * decl.cs (MemberCore): Add check for invariant: a partial
6193 container is not a parsed entity, and thus does not enclose any
6195 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6196 (DeclSpace.BaseTypeExpr): Use it.
6197 (DeclSpace.LookupType): Add check for invariant.
6198 * class.cs (TypeContainer): Add check for invariant: a nested
6199 class should have the same NamespaceEntry as its enclosing class.
6200 (TypeContainer.EmitFieldInitializers): Make virtual.
6201 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6203 (TypeContainer.Register): Remove.
6204 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6205 null. Use TypeResolveEmitContext for resolving base types and
6206 interfaces. Move initialization of Parts.TypeBuilder here from
6208 (TypeContainer.DefineNestedTypes): ... here.
6209 (PartialContainer): Take a Namespace not a NamespaceEntry.
6210 (PartialContainer.Create): Don't use Register. Call the
6211 appropriate Add... function directly.
6212 (ClassPart): Take both the PartialContainer and the enclosing
6213 class as constructor arguments.
6214 (ClassPart.EmitFieldInitializers): Override.
6215 (ClassPart.PartFindNestedTypes): Remove.
6216 (FieldBase.GetInitializerExpression): Resolve the initializer
6217 expression in the emit context of the enclosing class.
6218 * tree.cs (RootTypes): Remove Register ().
6220 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6222 * cs-parser.jay: Removed CS0134.
6224 * driver.cs: Removed CS1901.
6226 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6227 for predefined types.
6229 2005-03-07 Duncan Mak <duncan@novell.com>
6231 * codegen.cs (Save): Catch UnauthorizedAccessException as
6232 well. Fixes bug #73454.
6234 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6236 * cs-tokenizer.cs (xtoken): Add CS1035.
6238 * class.cs (MethodData.Define): Add CS0683.
6239 (FieldMember.ctor): Add CS0681.
6241 2005-03-07 Raja R Harinath <rharinath@novell.com>
6243 * ecore.cs (SimpleName.DoResolve): Rename from
6244 SimpleName.DoResolveAllowStatic.
6245 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6246 Pass 'intermediate' flag to MemberStaticCheck.
6247 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6248 of "intermediate" lookups via MemberAccess.
6249 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6250 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6252 2005-03-07 Raja R Harinath <rharinath@novell.com>
6255 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6256 slipped in because of variable names that are identical to a
6257 builtin type's BCL equivalent ('string String;', 'int Int32;').
6258 (PropertyExpr.EmitInstance): Likewise.
6260 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6262 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6264 * report.cs (warning_ignore_table): Made public.
6266 2005-03-04 Raja R Harinath <rharinath@novell.com>
6269 * class.cs (MethodData.Emit): Pass 'container' to
6270 container.GetObsoleteAttribute instead of 'container.Parent'.
6272 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6274 * cs-parser.jay: Add 1534 error test.
6276 * iterators.cs (Yield.CheckContext): Add error 1629.
6277 (Iterator.ctor): Save unsafe modifier.
6278 (MoveNextMethod.DoEmit): Restore unsafe context.
6280 * namespace.cs (UsingAlias): Better error message.
6282 2005-03-03 Dan Winship <danw@novell.com>
6284 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6285 the warning message [#73219]
6287 2005-03-03 Raja R Harinath <rharinath@novell.com>
6289 Fix compile with MCS 1.0.0.0.
6290 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6291 w_restore to not depend on string constant folding.
6293 2005-03-03 Raja R Harinath <rharinath@novell.com>
6295 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6296 CS0246 check to users who passed 'silent = false'.
6297 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6299 (SimpleName.SimpleNameResolve): Update.
6300 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6301 (MemberAccess.IdenticalNameAndTypeName): Update.
6302 * doc.cs (FindDocumentedTypeNonArray): Update.
6304 2005-03-03 Raja R Harinath <rharinath@novell.com>
6306 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6307 * parameters.cs (ComputeAndDefineParameters): Remove.
6308 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6309 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6310 Use GetParameterInfo.
6312 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6314 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6316 2005-03-02 Raja R Harinath <rharinath@novell.com>
6318 Unify DeclSpace.LookupType and DeclSpace.FindType.
6319 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6320 is in charge of defining nested types on demand.
6321 (DeclSpace.LookupType): Use it when the current_type is a
6322 TypeBuilder. Use LookupTypeDirect for reflected types.
6323 (DeclSpace.FindType): Remove.
6324 (DeclSpace.LookupInterfaceOrClass): Likewise.
6325 (DeclSpace.DefineTypeAndParents): Likewise.
6326 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6327 DeclSpace.LookupType.
6328 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6329 * typemanager.cs (LookupType): Simplify.
6330 (AddUserType): Remove type from negative_hits.
6331 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6332 * class.cs (TypeContainer.FindMembers): Move handling of nested
6334 (TypeContainer.FindMembers_NestedTypes): ... here.
6335 (TypeContainer.FindNestedType): Implement override.
6336 (ClassPart.FindNestedType): Delegate to PartialContainer.
6337 (ClassPart.PartFindNestedType): Looks up the nested types of the
6340 2005-04-14 Martin Baulig <martin@ximian.com>
6342 * generic.cs (ConstructedType): Moved all the type lookup and
6343 nested class logic into SimpleName.
6344 (ConstructedType.ResolveConstructedType): Our underlying type is
6345 already fully resolved; all the type lookup stuff is in
6348 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6349 constructed types here instead of in ConstructedType.
6351 * decl.cs (MemberName.GetTypeExpression): Always create a
6352 SimpleName, not a ConstructedType.
6353 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6355 2005-03-02 Martin Baulig <martin@ximian.com>
6357 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6358 static constructor in static classes.
6360 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6362 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6363 sizeParamIndex is not specified.
6365 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6368 * report.cs (WarningMessage.IsEnabled): Missing null check.
6370 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6372 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6373 in the fields and not in the properties.
6375 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6377 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6380 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6382 * attribute.cs: Small refactoring (improved robustness).
6383 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6384 (ValidateGuid): Removed.
6385 (Resolve): Removed referenced to above mentioned.
6386 (GetAttributeUsage): Made private and changed to work without
6388 (GetIndexerAttributeValue): Don't crash.
6389 (GetConditionalAttributeValue): Ditto.
6390 (GetClsCompliantAttributeValue): Ditto.
6391 (ExtractSecurityPermissionSet): All attributes exceptions are
6393 (GetPropertyValue): New helper.
6394 (GetMethodImplOptions): New method.
6395 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6396 some missing properties.
6398 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6399 (Method.ApplyAttributeBuilder): Updated.
6401 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6404 2005-02-28 Raja R Harinath <rharinath@novell.com>
6407 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6408 non-simple types (array, pointer, reference).
6410 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6412 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6414 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6416 (Method.CheckBase): Catch wrong destructor here.
6417 (MethodData.Define): Add errors 550, 668.
6419 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6421 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6423 * pending.cs (VerifyPendingMethods): Add error 551.
6425 * typemanager.cs (CSharpName): Next error report helper.
6427 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6429 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6430 attributes. Removed useless attribute double check.
6431 It saves almost 2MBs for corlib.
6433 2005-02-25 Raja R Harinath <rharinath@novell.com>
6436 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6437 called twice in case of error.
6439 2005-02-23 Chris Toshok <toshok@ximian.com>
6441 Fix compiler portions of #72827.
6442 * statement.cs (Block.Emit): call Begin/EndScope on the
6443 EmitContext instead of the ILGenerator.
6445 * codegen.cs (EmitContext.BeginScope): new method, call
6446 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6448 (EmitContext.BeginScope): same, but EndScope and CloseScope
6450 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6451 offset and call the superclass's OpenScope(int) with it.
6452 (SymbolWriter.CloseScope): get the current il
6453 offset and call superclass's CloseScope(int) with it.
6455 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6457 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6458 CS1677 for out and ref as well.
6460 * class.cs (Method.Define): Add error CS1599 detection.
6462 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6464 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6466 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6468 * support.cs.cs (ModifierDesc): New helper method.
6470 2005-02-23 Raja R Harinath <rharinath@novell.com>
6471 Abin Thomas <projectmonokochi@rediffmail.com>
6472 Anoob V E <projectmonokochi@rediffmail.com>
6473 Harilal P R <projectmonokochi@rediffmail.com>
6476 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6477 MemberLookup (used for error reporting) actually returns a result.
6478 Fix error report number (122, not 112).
6480 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6481 Anoob V E <projectmonokochi@rediffmail.com>
6482 Harilal P R <projectmonokochi@rediffmail.com>
6485 * pending.cs (PendingImplementation.GetAbstractMethods):
6486 Find NonPublic members too.
6488 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6490 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6493 * class.cs (MethodCore.CheckMethodAgainstBase):
6494 Add error 239 report.
6496 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6498 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6500 * class.cs (Operator.Define): Add error 217 report.
6502 2005-02-21 Raja R Harinath <rharinath@novell.com>
6505 * expression.cs (Invocation.IsApplicable): Make public.
6506 (Invocation.IsParamsMethodApplicable): Likewise.
6507 * delegate.cs (Delegate.VerifyApplicability): Don't use
6508 Invocation.VerifyArgumentCompat for parameter applicability
6509 testing. Use Invocation.IsApplicable and
6510 Invocation.IsParamsMethodApplicable.
6512 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6514 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6516 * class.cs (Operator.Define): Add error 217 report.
6518 2005-02-21 Raja R Harinath <rharinath@novell.com>
6520 * namespace.cs (UsingEntry.Resolve): Undo change below.
6522 2005-02-21 Raja R Harinath <rharinath@novell.com>
6525 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6526 disable the error message when the extended MemberLookup also
6528 (Expression.MemberLookupFinal): Update.
6529 (SimpleName.DoSimpleNameResolve): Update.
6530 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6531 Don't use MemberLookupFinal.
6532 (New.DoResolve): Update.
6533 (BaseAccess.CommonResolve): Update.
6535 2005-02-21 Raja R Harinath <rharinath@novell.com>
6538 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6539 occured previously, don't resolve again.
6541 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6544 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6545 argument. Call ResolveAttributeUsage for unresolved.
6546 when types doesn't match ctor arguments.
6548 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6549 for nested attribute classes.
6550 (Class.attribute_usage): Removed.
6551 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6552 for attribute class.
6554 * ecore.cs (IsAttribute): Removed.
6556 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6558 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6560 (attribute_types): Removed.
6561 (EmitCode): Global attributes are emited as the latest.
6563 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6565 * class.cs (EmitFieldInitializers): Don't emit field initializer
6566 for default values when optimilization is on.
6568 * constant.cs (Constant.IsDefaultValue): New property.
6570 * driver.cs: Add /optimize handling.
6574 * literal.cs: Implement new IsDefaultValue property.
6576 * rootcontext.cs (Optimize): New field, holds /optimize option.
6578 2005-02-18 Raja R Harinath <rharinath@novell.com>
6580 Fix crasher in re-opened #72347.
6581 * namespace.cs (Namespace.Lookup): Return null if
6582 DeclSpace.DefineType returns null.
6585 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6587 2005-02-18 Raja R Harinath <rharinath@novell.com>
6589 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6590 now returns null if it cannot resolve to an lvalue.
6591 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6592 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6593 returned null. Remove check for SimpleName.
6594 (EventExpr.DoResolveLValue): New.
6595 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6596 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6598 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6600 (Unary.ResolveOperator): Move CS0211 check ...
6601 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6603 (Unary.DoResolveLValue): Simplify.
6604 (AddressOf.DoResolveLValue): New.
6605 (ArrayAccess.DoResolveLValue): New.
6607 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6609 * attribute.cs (Attribute.Resolve): Add arguments casting for
6610 when types doesn't match ctor arguments.
6612 2005-02-16 Raja R Harinath <rharinath@novell.com>
6614 Fix parts of #63202.
6615 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6616 lookup of operator in base type. Ensure that all checks happen
6617 when the operator resolves to an "op_..." method.
6619 2005-02-15 Raja R Harinath <rharinath@novell.com>
6622 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6623 'ignore_cs0104' parameter. Pass it to ...
6624 (NamespaceEntry.Lookup): ... this.
6625 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6626 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6627 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6628 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6629 Update. Request that cs0104 errors be ignored.
6630 (ComposedCast.ResolveAsTypeStep): Update.
6632 2005-02-14 Raja R Harinath <rharinath@novell.com>
6635 * expression.cs (Invocation.BetterFunction): Remove support for
6636 comparing virtual functions and their overrides.
6637 (Invocation.IsOverride): New.
6638 (Invocation.OverloadResolve): Don't consider 'override' functions
6639 during candidate selection. Store them in a lookaside list.
6640 If the selected method is a 'virtual' function, use the list to
6641 find any overrides that are closer to the LHS type.
6643 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6645 * expression.cs (New.DoResolve): Add complex core type reduction.
6646 (New.Constantify): Converts complex core type syntax like 'new int ()'
6649 2005-02-14 Raja R Harinath <rharinath@novell.com>
6651 * decl.cs (EntryType.EntryType): New constructor to create an
6652 updated copy of a cache entry.
6653 (MemberCache.AddMethods): Use it.
6654 (MemberCache.ClearDeclaredOnly): Remove.
6655 (MemberCache.MemberCache): Update.
6657 2005-02-11 Miguel de Icaza <miguel@novell.com>
6659 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6660 variable. This one is represents the actual low-level declaration
6661 of the method, as opposed to the semantic level `IsStatic'.
6663 An anonymous method which is hosted into a static method might be
6664 actually an instance method. IsStatic would reflect the
6665 container, while MethodIsStatic represents the actual code
6668 * expression.cs (ParameterReference): Use the new MethodIsStatic
6669 instead of IsStatic.
6671 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6672 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6673 set on the current EmitContext.
6675 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6676 resolve our casted expression as an LValue. This triggers the
6677 proper LValue processing that is later required by Assign.
6681 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6683 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6685 C# 2.0 Fixed buffer implementation
6687 * anonymous.cs: Update after RegisterHelperClass renaming.
6689 * attribute.cs (AttributeTester.fixed_buffer_cache):
6690 Cache of external fixed buffers.
6691 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6692 implementation if field is fixed buffer else null.
6695 (TypeContainer.AddField): Accept FieldMember instead of Field.
6696 (FieldBase.IsFieldClsCompliant): Extracted code from
6697 VerifyClsCompliance descendant customization.
6698 (FixedField): New class handles fixed buffer fields.
6699 (FixedFieldExternal): Keeps information about imported fixed
6701 (IFixedField): Make access to internal or external fixed buffer
6704 * cs-parser.jay: Add fixed buffer parsing.
6706 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6709 * expression.cs (Indirection): Extended implementation to accept
6711 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6712 (ElementAccess.MakePointerAccess): Get type as parameter.
6713 (DoResolve): Add fixed buffer field expression conversion.
6714 (DoResolveLValue): Ditto.
6715 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6716 (ArrayPtr): Derives from FixedBufferPtr.
6717 (ArrayPtr.Emit): Add extra emit for array elements.
6719 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6721 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6722 for compiler generated types.
6723 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6725 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6726 and consume less memory.
6727 (Fixed.Resolve): Add fixed buffer case.
6729 * typemanager.cs (compiler_generated_attr_ctor,
6730 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6731 (HasElementType): Add our own implementation to work on every
6734 2005-02-11 Miguel de Icaza <miguel@novell.com>
6736 * anonymous.cs (CaptureContext): Track whether `this' has been
6739 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6740 only captured `this' if it was implicitly done (instance
6741 methods/variables were used).
6743 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6744 `this' must be captured.
6746 2005-01-30 Miguel de Icaza <miguel@novell.com>
6748 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6749 is null it means that there has been no need to capture anything,
6750 so we just create a sibling.
6752 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6754 Just a partial fix. The other half is fairly elusive.
6756 2005-02-10 Raja R Harinath <rharinath@novell.com>
6758 Fix #52586, cs0121-4.cs.
6759 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6760 and return a hashtable.
6761 (MemberCache.ClearDeclaredOnly): New.
6762 (MemberCache.MemberCache): Update to change. Make a deep copy of
6763 the method_hash of a base type too.
6764 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6765 type methods. Overwrite entries with the same MethodHandle so
6766 that the ReflectedType is correct. The process leaves in base
6767 virtual functions and their overrides as distinct entries.
6768 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6769 matters since it was boxed in a ArrayList before.
6770 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6772 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6773 case of a virtual function and its override (choose the overload
6775 (Invocation.OverloadResolve): Avoid 'override' members during
6776 'applicable_type' calculation.
6778 2005-03-28 Raja R Harinath <rharinath@novell.com>
6780 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6781 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6782 GetTypeHandle. It is possible for a reflected type to derive from
6783 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6784 System.Array during mscorlib compilation).
6785 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6786 contain a method_hash, don't create one either. Don't create a
6787 deep copy of the base cache's method_hash.
6788 (MemberCache.SetupCache): Rename back from DeepCopy.
6789 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6790 already initialized. If we see an override function, add its
6791 underlying base virtual function to the member_hash too.
6793 2005-02-09 Raja R Harinath <rharinath@novell.com>
6795 Combine two near-redundant caches.
6796 * typemanager.cs (method_params): Rename from method_internal_params.
6797 (TypeManager.GetParameterData): New. Replace
6798 Invocation.GetParameterData.
6799 (TypeManager.LookupParametersByBuilder): Remove.
6800 * expression.cs (Invocation.method_parameter_cache): Remove.
6801 (Invocation.GetParameterData): Remove.
6803 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6806 2005-02-08 Raja R Harinath <rharinath@novell.com>
6809 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6810 TypeManager.multicast_delegate_type is null, resolve it by looking
6811 up "System.MulticastDelegate".
6812 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6814 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6815 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6816 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6819 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6820 (LabeledStatement.AddReference): New. Set 'referenced'.
6821 (Goto.Resolve): Use it.
6823 2005-02-05 John Luke <john.luke@gmail.com>
6825 * driver.cs: remove duplicate -doc line in Usage ()
6827 2005-02-04 Raja R Harinath <rharinath@novell.com>
6829 * location.cs (Location.AddFile): Fix CS2002 error report.
6831 2005-02-02 Martin Baulig <martin@ximian.com>
6833 * delegate.cs (Delegate.DefineType): Report an internal error if
6834 TypeManager.multicast_delegate_type is null. See bug #72015 for
6837 2005-02-02 Raja R Harinath <rharinath@novell.com>
6839 Fix a crasher in a variant of #31984.
6840 * const.cs (Constant.CheckBase): New override that defers the
6841 new-or-override check in case the base type hasn't been populated
6843 (Constant.Define): Ensure the new-or-override check is performed.
6845 2005-02-01 Duncan Mak <duncan@ximian.com>
6847 * const.cs (LookupConstantValue): Check that `ce' is not null
6848 before calling GetValue ().
6850 2005-02-01 Raja R Harinath <rharinath@novell.com>
6852 Fix test-334.cs (#69519).
6853 * cs-parser.jay (using_alias_directive): Pass in an expression to
6854 NamespaceEntry.UsingAlias.
6855 (using_namespace_directive): Pass in an expression to
6856 NamespaceEntry.Using.
6857 (namespace_name): Don't flatten to a string.
6858 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6859 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6861 (NamespaceEntry.UsingEntry): Likewise.
6862 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6864 (NamespaceEntry.LookupForUsing): Remove.
6865 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6867 (NamespaceEntry.Lookup): Remove support for dotted names.
6869 2005-02-01 Raja R Harinath <rharinath@novell.com>
6871 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6873 (NamespaceEntry.ImplicitParent): Compute on demand.
6874 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6875 parallels the current.
6876 (NamespaceEntry.LookupForUsing): Use it.
6877 (NamespaceEntry.Lookup): If the current namespace-entry is
6878 implicit, don't search aliases and using tables.
6880 2005-02-01 Raja R Harinath <rharinath@novell.com>
6883 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6885 (TypeContainer.BaseCache): Compute on demand.
6886 (TypeContainer.FindMembers): Define constants and types if they're
6887 not already created.
6888 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6890 * const.cs (Constant.Define): Make idempotent.
6892 2005-01-29 Miguel de Icaza <miguel@novell.com>
6894 * pending.cs: Produce better code (no nops produced by using Ldarg
6897 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6898 i - 1' it should be arg + 1.
6902 2005-01-28 Raja R Harinath <rharinath@novell.com>
6904 * attribute.cs (Attribute.CheckAttributeType): Make private
6906 (Attribute.ResolveType): Make virtual.
6907 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6908 handling of RootContext.Tree.Types.
6910 2005-01-27 Raja R Harinath <rharinath@novell.com>
6912 Update attribute-handling to use the SimpleName/MemberAccess
6914 * cs-parser.jay (attribute): Pass in an expression to the
6915 constructors of Attribute and GlobalAttribute.
6916 * attribute.cs (Attribute): Take an expression for the name.
6917 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6918 passed in attribute name expression.
6919 (Attribute.CheckAttributeType): Use it.
6920 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6921 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6922 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6923 argument to prevent error messages if the lookup fails.
6925 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6927 * expression.cs (Indirection): Implemented IVariable interface
6928 to support indirection in AddressOf operator.
6929 (PointerArithmetic.Emit): Add optimalization for case where
6930 result can be precomputed.
6932 2005-01-26 Martin Baulig <martin@ximian.com>
6934 * class.cs (TypeContainer.AttributeTargets): Return the correct
6935 AttributeTargets depending on our `Kind' instead of throwing an
6936 exception; fixes #71632.
6938 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6941 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6944 2005-03-17 Martin Baulig <martin@ximian.com>
6946 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6947 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6949 2005-03-17 Martin Baulig <martin@ximian.com>
6951 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6952 to bool so we can return an error condition.
6953 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6956 2005-03-17 Martin Baulig <martin@ximian.com>
6958 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6960 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6961 converting from an array-type of T to `IEnumerable<T>'.
6963 2005-03-16 Martin Baulig <martin@ximian.com>
6965 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6966 (Nullable.LiftedUnaryMutator): New public class.
6968 * expression.cs (UnaryMutator.DoResolve): Added support for
6971 2005-03-14 Martin Baulig <martin@ximian.com>
6973 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6975 2005-03-14 Martin Baulig <martin@ximian.com>
6977 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6978 the comparision operators `<', `>', `<=' and `>='.
6980 2005-03-13 Martin Baulig <martin@ximian.com>
6983 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6984 avoid confusion with the `NullLiteral'.
6985 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6987 2005-03-13 Martin Baulig <martin@ximian.com>
6989 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6990 comparing arbitrary types with the null literal.
6992 2005-03-13 Martin Baulig <martin@ximian.com>
6994 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6995 boolean operators '&&', '||', '&' and '|'.
6996 (Nullable.OperatorTrueOrFalse): New public class.
6998 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6999 instead of a `StaticCallExpr'; added support for nullables.
7001 2005-03-10 Martin Baulig <martin@ximian.com>
7004 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7005 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7007 2005-03-07 Martin Baulig <martin@ximian.com>
7009 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7010 it work if `expr' is not an IMemoryLocation.
7011 (Nullable.Lifted): Implement IMemoryLocation.
7012 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7015 2005-03-05 Martin Baulig <martin@ximian.com>
7017 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7018 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7019 (Nullable): Added support for lifted unary and binary operators.
7021 * expression.cs (Unary.DoResolve): Added support for nullable types.
7022 (Binary.DoResolve): Likewise.
7023 (Conditional.DoResolve): Likewise.
7025 2005-03-02 Martin Baulig <martin@ximian.com>
7027 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7029 * class.cs (ClassPart.SetParameterInfo): Override this.
7030 (PartialContainer.SetParameterInfo): Override this.
7031 (TypeContainer.CheckConstraints): New protected method.
7032 (PartialContainer.CheckConstraints): Override this and check
7033 whether the same contraints were specified in all parts of a
7034 partial generic type definition.
7035 (PartialContainer.UpdateConstraints): New public method.
7037 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7039 2005-03-02 Martin Baulig <martin@ximian.com>
7041 Committing a patch from Carlos Alberto Cortez to fix #72887.
7043 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7044 casts from `T []' to `int []'.
7046 2005-03-02 Martin Baulig <martin@ximian.com>
7048 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7050 * expression.cs (Binary.ResolveOperator): When resolving a
7051 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7052 `=='. Fixes #71866. See gen-127.cs.
7054 2005-03-02 Martin Baulig <martin@ximian.com>
7056 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7057 static constructor in static classes.
7059 2005-03-02 Martin Baulig <martin@ximian.com>
7062 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7063 (Nullable.LiftedConversion): Added support for user-defined
7066 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7068 * cs-parser.jay: Use ComposedCast everywhere instead of
7069 NullableType, so we don't need to check for NullableType
7071 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7072 case where we'll be resolved into a `parenthesized_expression_0'
7076 (Convert.UserDefinedConversion): Added nullable conversions.
7078 2005-02-28 Martin Baulig <martin@ximian.com>
7080 * generic.cs (TypeManager.IsNullableType): New static method.
7081 (Nullable): New abstract class.
7082 (Nullable.NullLiteral): New public class.
7083 (Nullable.LiftedConversion): New public class.
7085 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7086 `builtin_types opt_nullable'.
7089 (Convert.ImplicitConversionStandard): Added nullable conversions.
7090 (Convert.ExplicitConversionStandard): Likewise.
7091 (Convert.ExplicitConversion): Likewise.
7093 2005-02-26 Martin Baulig <martin@ximian.com>
7095 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7096 begin with a "?", for instance "?[]". Don't do a type lookup if
7099 2005-02-25 Martin Baulig <martin@ximian.com>
7101 The first part of Nullable Types :-)
7103 * generic.cs (NullableType): New public class.
7104 (NullCoalescingOperator): New public class.
7105 (TypeArguments.Resolve): Add a CS0306 check.
7107 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7108 (opt_nullable): New rule.
7109 (type): Added `opt_nullable' to `namespace_or_type_name',
7110 `builtin_types' and `pointer_type'.
7111 (array_type): Added `opt_nullable'.
7112 (opt_rank_specifier_or_nullable): New rule; this is the
7113 combination of `opt_rank_specifier' and `opt_nullable'.
7114 (opt_error): New rule; catch errors here.
7115 (nullable_type_or_conditional): New rule; we use this to check for
7116 nullable and still detect the conditional operator.
7117 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7118 instead `opt_rank_specifier'.
7120 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7123 2005-02-24 Martin Baulig <martin@ximian.com>
7125 * README, README.Changes: Removed; they're old and obsolete.
7127 2005-02-22 Martin Baulig <martin@ximian.com>
7129 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7130 returned an error, set `constraints' to null to avoid a crash
7132 (TypeParameter.ResolveType): Likewise.
7134 2005-02-22 Martin Baulig <martin@ximian.com>
7137 (Constraints.ResolveTypes): Protect against being called twice.
7138 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7139 (TypeParameter.ResolveType): New public method; calls
7140 constraints.ResolveTypes().
7141 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7142 into the new ResolveType().
7143 (GenericMethod.Define): Call ResolveType() on all our
7146 2005-02-21 Martin Baulig <martin@ximian.com>
7149 (TypeManager.generic_nullable_type): New static public field.
7150 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7153 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7155 2005-02-15 Martin Baulig <martin@ximian.com>
7157 * generic.cs (ConstructedType.Constraints): Correctly check
7158 constraints if the argument type is a type parameter; fixes
7161 2005-02-02 Martin Baulig <martin@ximian.com>
7163 * delegate.cs (Delegate.DefineType): Report an internal error if
7164 TypeManager.multicast_delegate_type is null. See bug #72015 for
7167 2005-01-29 Miguel de Icaza <miguel@novell.com>
7169 * pending.cs: Produce better code (no nops produced by using Ldarg
7172 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7173 i - 1' it should be arg + 1.
7177 2005-01-26 Martin Baulig <martin@ximian.com>
7179 * cs-parser.jay (indexer_declarator): Don't report an error if we
7180 have type parameters since we can be an explicit interface
7181 implementation; fixes #71449.
7183 2005-01-26 Martin Baulig <martin@ximian.com>
7185 * class.cs (TypeContainer.AttributeTargets): Return the correct
7186 AttributeTargets depending on our `Kind' instead of throwing an
7187 exception; fixes #71632.
7189 2005-01-26 Martin Baulig <martin@ximian.com>
7191 * delegate.cs (Delegate.DefineType): Correctly define our type
7192 parameters. Fixes #71483.
7194 2005-01-25 Raja R Harinath <rharinath@novell.com>
7197 * expression.cs (MemberAccess.DoResolve): Don't complain with
7198 cs0572 when the LHS of a member access has identical name and type
7201 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7204 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7206 Create custom PermissionSet only for PermissionSetAttribute.
7208 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7211 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7212 delegates in static class.
7214 2005-01-24 Martin Baulig <martin@ximian.com>
7216 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7217 merging an implicit block, just use its reachability.
7219 * statement.cs (Block.Resolve): Make the unreachable code check
7220 work wrt. implicit blocks; see test-337 from #63842.
7222 2005-01-21 Alp Toker <alp@atoker.com>
7224 * cs-parser.jay: destructor_declaration's container is PartialContainer
7225 not Class when partial types are used, so use Kind prop instead of
7228 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7230 * cs-parser.jay: Improve error reporting when an interface
7233 2005-01-20 Dick Porter <dick@ximian.com>
7235 * support.cs: SeekableStreamReader fix from Sandor Dobos
7236 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7237 chars are read. Fixes bug 70369.
7239 2005-01-20 Raja R Harinath <rharinath@novell.com>
7241 * cs-parser.jay (catch_clause): Simplify current_block handling
7244 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7246 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7247 code with ImplicitStandardConversion to handle the implicit
7248 conversion of method groups into valid delegate invocations.
7250 The problem is that in parameter handling we were using this code
7251 path. Fixes bug #64698
7253 2005-01-19 Raja R Harinath <rharinath@novell.com>
7255 * cs-parser.jay: Fix several infelicities.
7256 - Avoid assigning to the parser value stack. Code like
7257 '$3 = null' is unclean. Synthesize a value for the code block
7259 - Avoid using oob_stack for storing location information. Use ...
7260 (_mark_): ... this. New (empty) rule. Saves the current location
7262 (foreach_statement): Avoid using oob_stack for current_block
7263 handling. Use technique used in for_statement and
7264 using_statement. Synthesize a value for the code block to store
7265 additional intermediate information.
7267 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7269 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7270 of a different type is only allowed to private fields of a
7271 containing type, not on fields of a base class.
7273 See test-174.cs and error cs0122-9.cs
7275 2005-01-13 Raja R Harinath <rharinath@novell.com>
7277 Fix test-335.cs (bug #58126).
7278 * cs-parser.jay (argument): Split out non-expression parts of the
7279 rule into 'non_simple_argument'.
7280 (invocation_expression): Support parenthesized invocations with
7281 multiple arguments, and with single non-simple arguments.
7283 2005-01-13 Raja R Harinath <rharinath@novell.com>
7285 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7288 2005-01-12 Raja R Harinath <rharinath@novell.com>
7290 Fix cs0038-1.cs, cs1640-6.cs.
7291 * ecore.cs (Expression.Resolve): Remove special-case for
7292 SimpleName in error-handling.
7293 (Expression.almostMatchedMembers): Relax access permission to
7295 (Expression.MemberLookupFailed): Handle duplicates in
7296 almostMatchedMembers list.
7297 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7298 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7299 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7300 overload if the passed in MemberInfo is a MethodBase.
7302 2005-01-25 Martin Baulig <martin@ximian.com>
7305 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7307 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7310 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7311 for non-CAS & merge permission sets properly.
7313 2005-01-11 Raja R Harinath <rharinath@novell.com>
7315 Improve standard-compliance of simple name and member access
7316 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7317 * ecore.cs (FullNamedExpression): New abstract base class
7318 for Namespaces and TypeExpressions.
7319 (ResolveFlags.SimpleName): Remove.
7320 (SimpleName): Remove support for dotted names.
7321 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7322 DeclSpace.FindType and DeclSpace.LookupType.
7323 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7324 (Expression.ExprClassName): Make member function.
7325 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7326 a namespace. Remove creation of dotted "SimpleName"s.
7327 (MemberAccess.DoResolve): Likewise.
7328 * decl.cs (DeclSpace.Cache): Make private.
7329 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7330 (DeclSpace.FindType): Update.
7331 (DeclSpace.LookupType): Move here from RootContext. Return a
7332 FullNamedExpression.
7333 * namespace.cs (Namespace): Derive from FullNamedExpression
7334 so that it can be part of expression resolution.
7335 (Namespace.Lookup): Return an FullNamedExpression.
7336 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7338 * rootcontext.cs (NamespaceLookup): Remove.
7339 (LookupType): Move to DeclSpace.
7340 * attribute.cs (CheckAttributeType): Update.
7341 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7342 (FindDocumentedTypeNonArray): Likewise.
7344 2005-01-11 Raja R Harinath <rharinath@novell.com>
7346 Fix cs0509.cs, cs1632.cs.
7347 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7348 is the same as IsInterface.
7349 (TypeContainer.GetClassBases): Likewise.
7350 * statement.cs (LabeledStatement.ig): New field.
7351 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7353 (LabeledStatement.DoEmit): Check that the label was created with
7354 the same ILGenerator.
7356 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7359 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7360 accessors to its properties.
7362 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7363 from accessors to property.
7365 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7368 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7371 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7373 * attribute.cs: Check for null and empty strings.
7375 I have lost another battle to Paolo.
7377 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7380 * class.cs (PropertyMethod): Set Parent field in ctors.
7381 (SetMethod.InternalParameters): Add unsafe switch hack.
7382 Override MarkForDuplicationCheck where it is appropriate.
7384 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7385 It says whether container allows members with the same name.
7387 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7388 Removed is_method parameter.
7390 2005-01-06 Duncan Mak <duncan@ximian.com>
7392 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7393 because the previous change led to incorrect reporting of CS1032
7394 ("Cannot define/undefine preprocessor symbols after first token in
7395 file"). Instead of using `tokens_seen' as the only flag that
7396 triggers CS1040, introduce `comments_seen'. This new flag is used
7397 to signify having seen comments on the current line, so it is
7398 unset after a newline.
7400 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7402 * doc.cs : When searching for a type, find nested type too.
7403 This fixes bug #71040.
7405 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7408 - Warn missing member comment on those classes which also does not
7409 have doc comments. Fixed bug #71041.
7410 - Don't warn missing doc comment on default constructor.
7413 2005-01-06 Duncan Mak <duncan@ximian.com>
7415 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7416 comments, set `tokens_seen' to true. This allows us to detect
7417 misplaced preprocessor directives (i.e. not at the beginning of
7418 the a line, nor after whitespaces). In that case, report error
7419 CS1040. This fixes bug #56460.
7421 * cs-parser.jay (interface_member_declaration): Add checks for
7422 IsExplicitImpl, and report CS0541 error if an interface member is
7423 defined as an explicit interface declaration.
7425 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7428 * class.cs (PropertyMethod): Set Parent field in ctors.
7429 (SetMethod.InternalParameters): Add unsafe switch hack.
7431 * decl.cs (MemberCore.Parent): Cannot be readonly.
7433 2005-01-06 Raja R Harinath <rharinath@novell.com>
7435 * decl.cs (DeclSpace.ResolveType): Remove.
7436 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7437 Merge in code from ...
7438 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7439 * class.cs, enum.cs: Update to changes.
7441 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7443 * anonymous.cs: Ensure that we init the scope of our parent if it
7444 has not been initialized yet.
7446 2004-12-30 Duncan Mak <duncan@ximian.com>
7448 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7449 if field.FieldBuilder is null. Fixes #70758.
7451 * convert.cs: Fixed some typos and updated some of the comments.
7452 (ImplicitStandardConversionExists):
7453 (TryImplicitIntConversion): If `target_type' is an interface and
7454 the type of `ic' implements this interface, return true or a new
7455 BoxedCast instead of null. This fixes #70468.
7457 2004-12-29 Duncan Mak <duncan@ximian.com>
7459 * expression.cs (Argument.Emit): Check that Expr is
7460 IMemoryLocation before casting to it, and report CS1510 otherwise.
7464 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7466 * statement.cs (Block.ThisVariable): remove the recursion here, to
7467 make the --profile more sane.
7469 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7471 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7472 assembly, by JB Evain.
7474 2004-12-17 Raja R Harinath <rharinath@novell.com>
7476 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7477 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7478 "parent" refers to enclosing type/class. "base" refers to superclass.
7480 2004-12-17 Raja R Harinath <rharinath@novell.com>
7482 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7483 Ensure that we only have GlobalAttributes.
7484 * attribute.cs (Attribute.Emit): Make non-virtual.
7485 (GlobalAttribute.Emit): Remove.
7486 (Attribute.Resolve): Make virtual.
7487 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7488 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7489 the argument. Don't create one.
7490 (Attribute.GetObsoleteAttribute): Likewise.
7491 (Attribute.GetClsCompliantAttributeValue): Likewise.
7492 * class.cs, decl.cs: Update to changes.
7494 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7496 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7498 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7500 * statement.cs (Foreach.Resolve): Add error 186 report.
7502 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7504 * expression.cs (Conditional.DoResolve): Add warning 429.
7506 * statement.cs (If.Resolve): Add warning 665.
7508 2004-12-16 Raja R Harinath <rharinath@novell.com>
7510 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7511 except when in the parser, and in GlobalAttribute.
7512 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7513 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7514 RootContext.Tree.Types.NamespaceEntry once work is done.
7515 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7516 and resets RootContext.Tree.Types.NamespaceEntry.
7518 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7520 * cs-parser.jay: Don't create a block for every variable.
7522 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7524 * location.cs: Provide extra information.
7526 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7527 variables from the captured environment, it is the ldarg_0.
7529 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7531 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7534 * class.cs: Changed warning level for 169 to avoid developer
7535 displeasure from warning flooding. It will be changed back when they
7536 fix most of current BCL warnings.
7538 * RootContext.cs: Pushed default WarningLevel to 3.
7540 * statement.cs: Removed unused variable.
7542 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7544 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7545 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7546 Add error 502 report.
7547 (StaticClass.DefineType): Add error 441 report.
7548 (Class.AllowedModifiersProp): New virtual property as temporary
7549 extension to AllowedModifiers.
7550 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7551 to share implementation with StaticClass and don't call virtual
7554 * driver.cs (MainDriver): Add error 1558 test.
7556 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7557 report. Moved error 36 test here.
7559 * statement.cs (Throw.Resolve): Add error 724 report.
7561 * typemanager.cs: Add out_attribute_type core type.
7563 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7565 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7567 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7569 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7572 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7574 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7575 Add error 3023 report.
7576 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7578 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7581 2004-12-12 John Luke <john.luke@gmail.com>
7583 * driver.cs (AddArgs): take -- into account when
7584 adding arguments, fixes bug 65710
7586 2004-12-12 Martin Baulig <martin@ximian.com>
7588 * expression.cs (Unary.TryReduceNegative): Added support for
7589 SByteConstant and ByteConstant.
7590 (Unary.Reduce): Check error values from TryReduceNegative().
7592 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7594 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7595 and report exception as error 182.
7597 2004-12-10 Raja R Harinath <rharinath@novell.com>
7599 * driver.cs (Main): Fix message when there are warnings.
7601 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7603 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7605 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7607 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7608 Reduced number of warnings.
7610 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7612 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7614 * driver.cs: Removed message.
7616 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7618 2004-12-08 <vargaz@freemail.hu>
7620 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7622 2004-12-08 Martin Baulig <martin@ximian.com>
7624 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7625 instead of a CS3002 for properties and indexer.
7627 2004-12-08 Martin Baulig <martin@ximian.com>
7629 * decl.cs (MemberName.ToString): Make this work again.
7631 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7633 * attribute.cs (Resolve): Add error 591 detection.
7635 * class.cs (FieldMember.Define): Add error 1547 detection.
7636 (Indexer.Define): Add error 620 detection.
7637 (Operator.Define): Add error 590 detection.
7639 * ecore.cs: Missing argument for error 79.
7641 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7644 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7647 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7650 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7652 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7653 Some operator comments were suppressed.
7654 * doc.cs : Implicit/explicit operator name in doc comments are like
7655 "op_Explicit(type)~returnType", so added suffix handling.
7657 2005-01-21 Alp Toker <alp@atoker.com>
7659 * cs-parser.jay: destructor_declaration's container is PartialContainer
7660 not Class when partial types are used, so use Kind prop instead of 'is'.
7662 2004-12-12 Martin Baulig <martin@ximian.com>
7664 * expression.cs (Unary.TryReduceNegative): Added support for
7665 SByteConstant and ByteConstant.
7666 (Unary.Reduce): Check error values from TryReduceNegative().
7668 2004-12-11 Martin Baulig <martin@ximian.com>
7670 * support.cs (ReflectionParameters.ParameterName): If we have a
7671 `gpd', call `ParameterName' on it.
7673 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7675 * pending.cs (PendingImplementation.DefineProxy): Call
7676 DefineParameter() for all of the MethodBuilder's arguments.
7678 2004-12-09 Martin Baulig <martin@ximian.com>
7680 * doc.cs (DocUtil): Make this a static class.
7682 2004-12-09 Martin Baulig <martin@ximian.com>
7684 * expression.cs (Invocation.InferType): Moved the type inference
7685 implementation into TypeManager.
7687 * generics.cs (TypeManager): Moved the type inference
7688 implementation here.
7690 2004-12-09 Martin Baulig <martin@ximian.com>
7692 * typemanager.cs (TypeManager): Make this a partial class.
7695 (TypeManager): Move the generics part of `TypeManager' here.
7697 2004-12-08 Martin Baulig <martin@ximian.com>
7699 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7700 instead of a CS3002 for properties and indexer. Added CS3024
7701 check for generic interfaces.
7703 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7704 instances are not CLS-compliant.
7706 2004-12-08 Martin Baulig <martin@ximian.com>
7709 (void_pointer_expression): New rule for `void*', `void**' etc.
7710 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7712 2004-12-08 Martin Baulig <martin@ximian.com>
7714 * expression.cs (Invocation.InferType): Removed the hack for
7715 MethodCore.MayUnify().
7717 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7720 * class.cs (MethodCore.MayUnify): Use
7721 TypeManager.MayBecomeEqualGenericTypes().
7723 2004-12-08 Martin Baulig <martin@ximian.com>
7725 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7726 parameter, box it. Fixes #69233.
7728 2004-12-08 Martin Baulig <martin@ximian.com>
7730 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7731 have the ctor constraint. Fixes #68326.
7733 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7735 * cs-parser.jay : interface comment was not consumed because of
7736 extra opt_semicolon before doc handling.
7738 2004-12-03 Raja R Harinath <rharinath@novell.com>
7740 Fix test-327.cs, test-328.cs, and put in early infrastructure
7741 for eventually fixing #52697.
7742 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7743 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7745 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7746 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7747 (VerifyUsing, error246): Update.
7748 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7749 'NamespaceEntry.LookupNamespaceOrType'.
7751 2004-12-07 Martin Baulig <martin@ximian.com>
7753 * driver.cs: Call it "BETA SOFTWARE" :-)
7755 2004-12-06 Raja R Harinath <rharinath@novell.com>
7757 Fix crash on cs0657-17.cs.
7758 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7759 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7760 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7761 the case where the NamespaceEntry gets overwritten.
7763 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7765 Fixed #69195, #56821
7766 * ecore.cs (ResolveBoolean): Tiny refactoring.
7768 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7769 of right expression resolving when left is false constant and
7770 operator is LogicalAnd OR true constant and operator is LogicalOr.
7772 * statement.cs (ResolveUnreachable): Always reports warning.
7774 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7776 * class.cs: Distinguish between 1721 and 1722 (just a little help
7777 for the programmer).
7779 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7781 * delegate.cs: Only allow this on new versions of the language.
7783 2004-12-02 Duncan Mak <duncan@ximian.com>
7785 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7787 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7788 here as a static method. Take an additional bool out parameter
7789 `must_do_cs1540_check' for signaling to InstanceResolve.
7790 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7791 member field from PropertyExpr class and made it an argument of
7793 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7794 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7795 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7796 and `remove_accessor' as well as InstanceResolve: report CS0122
7801 2004-12-07 Martin Baulig <martin@ximian.com>
7803 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7804 and CS0692 where appropriate.
7806 2004-12-06 Martin Baulig <martin@ximian.com>
7808 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7809 IsDuplicateImplementation() and improved it.
7811 * expression.cs (Invocation.InferTypeArguments): Added
7812 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7813 and removed the "ref" modifier from `infered_types'.
7815 * decl.cs (MemberName.ToString): Removed the exception.
7817 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7819 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7820 comments are allowed.
7822 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7824 * delegate.cs: Add checks for subtypes in paramaters and return values
7825 in VerifyMethod () to add support for Covariance/Contravariance
7828 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7830 * report.cs: Remove extra closing parenthesis.
7832 * convert.cs (Error_CannotImplicitConversion): If the name of the
7833 types are the same, provide some extra information.
7835 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7838 * attribute.cs (Resolve): Improved implementation of params
7839 attribute arguments.
7841 * support.cs (ParameterData): Add HasParams to be faster.
7843 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7845 all things are for /doc support:
7847 * doc.cs: new file that supports XML documentation generation.
7848 * mcs.exe.sources: added doc.cs.
7850 Handle /doc command line option.
7851 Report error 2006 instead of 5 for missing file name for /doc.
7852 Generate XML documentation when required, after type resolution.
7854 Added support for picking up documentation (/// and /** ... */),
7855 including a new XmlCommentState enumeration.
7857 Added lines to fill Documentation element for field, constant,
7858 property, indexer, method, constructor, destructor, operator, event
7859 and class, struct, interface, delegate, enum.
7860 Added lines to warn incorrect comment.
7862 Added Documentation field (passed only when /doc was specified).
7864 Added DocComment, DocCommentHeader, GenerateDocComment() and
7865 OnGenerateDocComment() and some supporting private members for
7866 /doc feature to MemberCore.
7868 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7870 Added overriden DocCommentHeader.
7872 Added overriden DocCommentHeader and GenerateDocComment().
7874 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7876 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7877 unwrapping the enumeration values, chain to
7878 DoConstantNumericPromotions again, so we can promote things to the
7879 fundamental types (takes care of enums that are bytes, sbytes).
7883 2004-12-01 Raja R Harinath <rharinath@novell.com>
7885 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7886 Fix long-standing bug in type-lookup. Use FindType instead of
7887 LookupType when ec.ResolvingTypeTree.
7888 (Attribute.ResolveType, Attribute.Resolve)
7889 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7891 (Attributes.Search): Remove internal version. Update.
7892 (Attributes.SearchMulti): Update.
7893 (Attributes.GetClsCompliantAttribute): Remove.
7894 (Attributes.GetIndexerNameAttribute): Remove.
7895 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7896 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7897 * class.cs (Indexer.Define): Likewise.
7899 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7902 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7903 MarshallByReference members access.
7905 * expression.cs: Use CheckMarshallByRefAccess;
7906 Better error CS0197 message.
7908 * report.cs: Print whole related error message.
7910 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7912 * class (GetClassBases): Better error 60 report.
7913 (EventProperty): Disabled warning 67 detection.
7915 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7918 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7920 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7923 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7926 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7928 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7930 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7932 * attribute.cs (Attribute.Resolve): Refine error reporting and
7933 report a cs0117 if the identifier does not exist, to distinguish
7934 from 0617 which is a miss-use of the actual identifier.
7936 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7937 between cs0070 and cs0079.
7939 * class.cs (MemberBase.DoDefine): When reporting a wrong
7940 accessibility level, we use MethodCore to compare instead of
7941 Method (this was a regression in some refactoring effort).
7943 So now we correctly report cs0056 again.
7945 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7946 testing the target_type (which was known to be object_type) and
7947 not the source type (which is anonymous_method).
7949 Fixed reporting of error cs1660.
7951 * expression.cs (UserCast.Source): Expose the underlying cast.
7953 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7954 allowed types to find a match to int32 first (most common).
7956 In addition, it ignores any ImplicitUserConversions that did an
7957 internal implicit conversion (as the switch statement allows only
7958 one integral conversion to exist).
7960 * class.cs (PartialContainer.Create): rename `name' to
7961 `member_name' for clarity. Then replace the string calls with a
7962 call to MemberName.GetPartialName, as now using
7963 MemberName.ToString is an error (this is due to the side effects
7964 it had, that were fixed in the past).
7966 This will restore the error reporting on a number of partial class
7967 errors that were missusing this (and getting an exception as a
7968 results, which is now just a plain textual warning, because
7969 yyparse debug output would crash otherwise).
7971 2004-11-26 Raja R Harinath <rharinath@novell.com>
7973 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7975 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7977 * rootcontext.cs (LookupType): Make sure to cache lookups that
7978 don't give us a negative result. This saves about 5% of corlib
7981 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7983 * report.cs (AbstractMessage.Print): messages are sent to stderr
7985 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7986 non-interface in the list of interfaces (at this point, either
7987 parent was properly set, or a base class is being listed in the
7988 interfaces section).
7990 This flags error 1722, and resolves the crash from bug 69259.
7992 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7994 * statement.cs (Using.EmitExpressionFinally): make this work right
7995 for valuetypes. Fixes 69926.
7997 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7999 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8000 converted to an enum" here, before we try to change the underlying
8001 type. This code exists, but it is a different code path than the
8002 one used while encoding constants.
8004 (ImplicitReferenceConversionExists): In addition, resynchronized
8005 the code here, so it matches the same code in
8006 ImplicitReferenceConversionExists for the `from any class-type S
8007 to any interface-type T'.
8009 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8011 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8013 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8015 * cs-parser.jay: Use verbosity accordingly.
8017 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8019 * expression.cs (Unary.ResolveOperator): Do not report warning;
8020 AddressOf reads from variable.
8022 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8024 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8028 * attribute.cs (Attributable): Removed CheckTargets.
8029 (Attributes.Emit): Explicit attribute targets are tested here.
8031 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8032 not enabled for interfaces.
8034 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8035 (GetAssemblyName): Ouch next bug there.
8037 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8039 * expression.cs: Error 275 added.
8041 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8043 Fix bug #69177 (Implemented decimal constant support)
8045 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8046 (BinaryFold): Add DecimalConstant.
8048 * const.cs (Define): Decimal constant
8050 (ChangeType): Add decimal type handling.
8051 (LookupConstantValue): Don't set value for decimal type but
8052 emit DecimalConstantAttribute. Needed for constant optimization.
8054 * constant.cs (ToDecimal): New method.
8055 (ConvertToDecimal): New method.
8056 (IntConstant): Implemented ConvertToDecimal.
8057 (DecimalConstant.Emit): Emit optimized version for decimals in
8060 * expression.cs (ResolveOperator): Changed order of constant
8061 reduction to work correctly with native types which have
8062 overloaded operators.
8063 (ResolveMemberAccess): Extract constant value from attribute
8066 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8068 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8069 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8070 (ChangeType): Decimal is special.
8071 (TypeToCoreType): Add decimal type.
8073 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8075 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8078 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8080 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8083 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8085 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8087 * pending.cs (PendingImplementation): Grab only interfaces.
8089 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8091 * statement.cs (ForeachHelperMethods): Add location member and
8092 error 202 detection.
8094 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8096 * expression.cs (DoResolveBase): Fixed wrong warning for out
8099 2004-12-04 Martin Baulig <martin@ximian.com>
8101 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8102 to check whether the conversion is ok.
8104 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8105 `Type.EmptyTypes' if we're not a generic TypeContainer.
8107 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8109 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8110 old bug: when converting from the null literal to a pointer,
8111 return an EmptyCast, not the NullLiteral.
8113 This fixes #69921, the recent null_type changes probably made this
8116 2004-12-03 Martin Baulig <martin@ximian.com>
8118 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8119 method as our child, call AnonymousMethod.Compatible() on it.
8121 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8123 * class.cs (FieldBase): Use an unused bit field from the field to
8124 encode the `has_offset' property from the FieldMember. This saves
8125 a couple of Ks on bootstrap compilation.
8127 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8128 method as our child, return the AnonymousMethod resolved
8131 * expression.cs (New.DoResolve): Allow return values from
8132 NewDelegate to also include AnonymousMethods.
8136 2004-11-29 Raja R Harinath <rharinath@novell.com>
8138 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8140 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8141 System.Runtime.InteropServices._Exception, since it's a base
8142 interface of the core type System.Exception in the net_2_0 profile.
8144 2004-11-27 Martin Baulig <martin@ximian.com>
8146 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8148 2004-11-26 Raja R Harinath <rharinath@novell.com>
8150 * Makefile: Convert to use executable.make.
8151 * gmcs.exe.sources: New.
8153 2004-11-25 Martin Baulig <martin@ximian.com>
8155 * expression.cs (Invocation.InferType): Added support for byref types.
8157 2004-11-25 Martin Baulig <martin@ximian.com>
8159 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8160 in TypeManager.TypeToCoreType().
8162 2004-11-25 Martin Baulig <martin@ximian.com>
8164 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8165 "Dispose" method from the `current_type'.
8166 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8167 DoDefineMembers() instead of using the MethodBuilder; this is
8168 required for generic iterators.
8170 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8172 2004-11-24 Martin Baulig <martin@ximian.com>
8174 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8176 2004-11-20 Martin Baulig <martin@ximian.com>
8178 * expression.cs (Invocation.InferType): Correctly infer generic
8179 instances; see gen-103.cs.
8180 (Invocation.InferTypeArguments): If a generic method doesn't have
8181 any unbound type parameters, we don't need to infer anything.
8183 2004-11-19 Raja R Harinath <rharinath@novell.com>
8185 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8187 2004-11-17 Raja R Harinath <rharinath@novell.com>
8189 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8190 (TypeHandle.GetMemberCache): New.
8191 (TypeHandle.TypeHandle): Update.
8192 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8193 (TypeManager.LookupParentInterfacesCache):
8194 Rename from LookupInterfaceCache. Optimize slightly.
8195 (TypeManager.MemberLookup_FindMembers): Update.
8196 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8198 (AddCacheContents): Rename from AddHashtable.
8199 * class.cs (TypeContainer.parent_container): Remove.
8200 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8201 (TypeContainer.DoDefineMembers): Don't initialize it.
8202 Update to name changes.
8204 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8206 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8207 that factors the code to check access modifiers on override.
8209 (PropertyBase): Use the code here.
8211 Patch from Lluis S'anchez, fixes bug #69361.
8213 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8215 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8216 routine that is used to report the use of a captured variable
8217 whose address has been taken.
8219 There are two checks: one when variables are being captured and
8220 the other check is when the address of a variable is taken.
8222 (because an anonymous methods might be resolved before *or* after
8223 the address has been taken) and
8225 * expression.cs (Conditional.DoResolve): Remove the special
8226 casing that Martin added to trueExpr and falseExpr being both
8227 NullLiteral. We get the right behavior now just by introducing
8228 the null_type into the compiler.
8230 * convert.cs (ExplicitConversion): Change the code to use
8231 null_type instead of testing `expr is NullLiteral'.
8232 (ImplicitConversionStandard): use null_type too.
8233 (ImplicitReferenceConversionExists): use null_type too.
8234 (ImplicitReferenceConversion): use null_type too.
8236 * literal.cs: The type of `NullLiteral' is now null_type instead
8238 (Resolve): Set the type here.
8240 * typemanager.cs: Introduce null_type.
8242 2004-11-18 Martin Baulig <martin@ximian.com>
8245 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8247 2004-11-18 Martin Baulig <martin@ximian.com>
8249 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8251 2004-11-18 Martin Baulig <martin@ximian.com>
8253 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8254 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8255 call ResolveConstructedType() on it to resolve it without checking
8257 (Constraints.ResolveTypes): Check them here.
8258 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8259 but don't check constraints.
8260 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8261 check constraints here.
8262 (ConstructedType.ResolveConstructedType): New public method. This
8263 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8264 resolve ourselves without checking constraints.
8266 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8268 2004-11-18 Martin Baulig <martin@ximian.com>
8271 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8273 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8275 2004-11-18 Martin Baulig <martin@ximian.com>
8277 * ecore.cs (TypeExpr.ResolveType): Removed.
8278 (Expression.ResolveAsTypeTerminal): We always return a fully
8279 resolved `TypeExpr', so we can just access its `Type'.
8281 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8283 2004-11-17 Martin Baulig <martin@ximian.com>
8285 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8286 sure we don't return any unresolved TypeExpr's.
8287 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8289 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8291 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8292 unresolved `ConstructedType's.
8294 2004-11-17 Martin Baulig <martin@ximian.com>
8296 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8298 2004-11-17 Martin Baulig <martin@ximian.com>
8301 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8303 * decl.cs (DeclSpace.ResolveType): Removed.
8304 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8306 2004-11-17 Martin Baulig <martin@ximian.com>
8308 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8309 direction, like FindMembers() does. Fixes #69546, testcase is in
8312 2004-11-16 Martin Baulig <martin@ximian.com>
8314 This is based on a patch from Marek Safar, see bug #69082.
8315 Fixes bugs #63705 and #67130.
8317 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8318 method; create a MemberCache for an interface type and cache the
8321 * decl.cs (IMemberContainer.ParentContainer): Removed.
8322 (IMemberContainer.ParentCache): New property.
8323 (MemberCache.SetupCacheForInterface): Removed.
8324 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8325 to create a cache for an interface's "parent".
8327 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8330 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8332 * statement.cs: Avoid adding bools to a hashtable.
8334 2004-11-15 Martin Baulig <martin@ximian.com>
8336 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8338 2004-11-11 Martin Baulig <martin@ximian.com>
8340 * typemanager.cs (TypeManager.GetMethodName): New method.
8342 * class.cs (MethodData.Define): Include the generic arity in the
8343 name of an explicit interface; also add it to the method name.
8345 * pending.cs (PendingImplementation.InterfaceMethod): The method
8346 name now includes the generic arity.
8348 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8350 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8351 calling an unsafe method from a safe location.
8353 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8356 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8358 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8360 * namespace.cs (VerifyUsing): use GetPartialName instead of
8363 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8365 * statement.cs (Return.Resolve): Fix regression in typo: if
8366 `in_exc', we have to request a NeedReturnLabel, this was a typo
8367 introduced in the anonymous method check-in. Fixes #69131.
8369 * Indexers were using the ShortName when defining themselves,
8370 causing a regression in the compiler bootstrap when applying the
8371 patch from 2004-11-02 (first part), now they use their full name
8372 and the bug is gone.
8374 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8376 * driver.cs: Strip the path from the names of embedded resources. Fixes
8379 2004-11-04 Raja R Harinath <rharinath@novell.com>
8381 Fix error message regression: cs0104-2.cs.
8382 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8383 (AliasEntry.Resolve): Update.
8384 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8386 (RootContext.LookupType): Update.
8388 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8390 * cs-parser.jay: Add support for handling accessor modifiers
8391 * class: Add support port accessor modifiers and error checking,
8392 define PropertyMethod.Define as virtual (not abstract anymore)
8393 * ecore.cs: Add checking for proeprties access with access modifiers
8394 * iterators.cs: Modify Accessor constructor call based in the modified
8396 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8398 * expression.cs (StringConcat): Handle being called twice,
8399 as when we have a concat in a field init with more than two
8402 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8404 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8405 special case explicit implementations, we should always produce
8406 the .property or .event declaration.
8408 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8409 since it will not return correct data if people use this
8410 unresolved in the presence of using statements (see test-313).
8412 * class.cs (MethodData.Define): If we are an explicit interface
8413 implementation, set the method name to the full name of the
8414 interface plus the name of the method.
8416 Notice that using the method.MethodName.GetFullName() does not
8417 work, as it will only contain the name as declared on the source
8418 file (it can be a shorthand in the presence of using statements)
8419 and not the fully qualifed type name, for example:
8423 class D : ICloneable {
8424 object ICloneable.Clone () {
8428 Would produce a method called `ICloneable.Clone' instead of
8429 `System.ICloneable.Clone'.
8431 * namespace.cs (Alias.Resolve): Use GetPartialName.
8433 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8435 * cs-parser.jay: Add error 1055 report.
8437 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8439 * assign.cs (Assign.DoResolve): Only do the transform of
8440 assignment into a New if the types are compatible, if not, fall
8441 through and let the implicit code deal with the errors and with
8442 the necessary conversions.
8444 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8446 * cs-parser.jay: Add error 1031 report.
8448 * cs-tokenizer.cs: Add location for error 1038.
8450 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8452 * cs-parser.jay: Add error 1016 report.
8454 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8456 * cs-parser.jay: Add errors 1575,1611 report.
8458 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8460 * cs-parser.jay: Add error 1001 report.
8462 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8465 * attribute.cs (GetMarshal): Add method argument for
8466 caller identification.
8468 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8469 agument for GetMarshal and RuntimeMissingSupport.
8471 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8473 * attribute.cs (ExtractSecurityPermissionSet): Removed
8474 TypeManager.code_access_permission_type.
8476 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8478 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8480 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8481 for obsolete use of a variable here. Fixes regression on errors
8482 cs0619-25 and cs0619-26.
8484 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8486 Fix #62358, implemented security attribute encoding.
8488 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8489 Tests permitted SecurityAction for assembly or other types.
8490 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8491 data from SecurityPermissionAttribute to PermisionSet class.
8493 * class.cs (ApplyAttributeBuilder): Added special handling
8494 for System.Security.Permissions.SecurityAttribute based types.
8496 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8497 special handling for System.Security.Permissions.SecurityAttribute
8500 * enum.cs (ApplyAttributeBuilder): Added special handling
8501 for System.Security.Permissions.SecurityAttribute based types.
8503 * parameter.cs (ApplyAttributeBuilder): Added special handling
8504 for System.Security.Permissions.SecurityAttribute based types.
8506 * rootcontext.cs: Next 2 core types.
8508 * typemanager.cs (TypeManager.security_permission_attr_type):
8509 Built in type for the SecurityPermission Attribute.
8510 (code_access_permission_type): Build in type.
8512 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8514 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8515 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8516 all of this information into
8517 EmitContext.EmitCapturedVariableInstance.
8519 * codegen.cs (EmitCapturedVariableInstance): move here the
8520 funcionality of emitting an ldarg.0 in the presence of a
8521 remapping. This centralizes the instance emit code.
8523 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8524 then emit a load of this: it means that we have reached the
8525 topmost ScopeInfo: the one that contains the pointer to the
8526 instance of the class hosting the anonymous method.
8528 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8529 captures to the topmost CaptureContext.
8531 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8533 * expression.cs (LocalVariableReference): Move the knowledge about
8534 the iterators into codegen's EmitCapturedVariableInstance.
8536 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8538 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8539 all code paths return a value from an anonymous method (it is the
8540 same as the 161 error, but for anonymous methods).
8542 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8544 The introduction of anonymous methods in the compiler changed
8545 various ways of doing things in the compiler. The most
8546 significant one is the hard split between the resolution phase
8547 and the emission phases of the compiler.
8549 For instance, routines that referenced local variables no
8550 longer can safely create temporary variables during the
8551 resolution phase: they must do so from the emission phase,
8552 since the variable might have been "captured", hence access to
8553 it can not be done with the local-variable operations from the runtime.
8557 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8558 is a toplevel block.
8560 (ToplevelBlock): A new kind of Block, these are the blocks that
8561 are created by the parser for all toplevel method bodies. These
8562 include methods, accessors and anonymous methods.
8564 These contain some extra information not found in regular blocks:
8565 A pointer to an optional CaptureContext (for tracking captured
8566 local variables and parameters). A pointer to the parent
8569 (Return.Resolve): Catch missmatches when returning a value from an
8570 anonymous method (error 1662).
8571 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8574 (Break.Resolve): ditto.
8576 (SwitchLabel): instead of defining the labels during the
8577 resolution phase, we now turned the public ILLabel and ILLabelCode
8578 labels into methods called GetILLabelCode() and GetILLabel() that
8579 only define the label during the Emit phase.
8581 (GotoCase): Track the SwitchLabel instead of the computed label
8582 (its contained therein). Emit the code by using
8583 SwitchLabel.GetILLabelCode ().
8585 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8586 whether the Local has been captured or not.
8588 (LocalInfo.IsCaptured): New property, used to tell whether the
8589 local has been captured.
8591 * anonymous.cs: Vastly updated to contain the anonymous method
8594 The main classes here are: CaptureContext which tracks any
8595 captured information for a toplevel block and ScopeInfo used to
8596 track the activation frames for various local variables.
8598 Each toplevel block has an optional capture context associated
8599 with it. When a method contains an anonymous method both the
8600 toplevel method and the anonymous method will create a capture
8601 context. When variables or parameters are captured, they are
8602 recorded on the CaptureContext that owns them, for example:
8606 MyDelegate d = delegate {
8611 Here `a' will be recorded as captured on the toplevel
8612 CapturedContext, the inner captured context will not have anything
8613 (it will only have data if local variables or parameters from it
8614 are captured in a nested anonymous method.
8616 The ScopeInfo is used to track the activation frames for local
8617 variables, for example:
8619 for (int i = 0; i < 10; i++)
8620 for (int j = 0; j < 10; j++){
8621 MyDelegate d = delegate {
8626 At runtime this captures a single captured variable `i', but it
8627 captures 10 different versions of the variable `j'. The variable
8628 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8629 recorded on a child.
8631 The toplevel ScopeInfo will also track information like the `this'
8632 pointer if instance variables were referenced (this is necessary
8633 as the anonymous method lives inside a nested class in the host
8634 type of the method).
8636 (AnonymousMethod): Expanded to track the Toplevel, implement
8637 `AnonymousMethod.Compatible' to tell whether an anonymous method
8638 can be converted to a target delegate type.
8640 The routine now also produces the anonymous method content
8642 (AnonymousDelegate): A helper class that derives from
8643 DelegateCreation, this is used to generate the code necessary to
8644 produce the delegate for the anonymous method that was created.
8646 * assign.cs: API adjustments for new changes in
8647 Convert.ImplicitStandardConversionExists.
8649 * class.cs: Adjustments to cope with the fact that now toplevel
8650 blocks are of type `ToplevelBlock'.
8652 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8653 insteda of standard blocks.
8655 Flag errors if params arguments are passed to anonymous methods.
8657 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8658 `CurrentAnonymousMethod' which points to the current Anonymous
8659 Method. The variable points to the AnonymousMethod class that
8660 holds the code being compiled. It is set in the new EmitContext
8661 created for the anonymous method.
8663 (EmitContext.Phase): Introduce a variable and an enumeration to
8664 assist in enforcing some rules about when and where we are allowed
8665 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8666 only one that enfonces this right now).
8668 (EmitContext.HaveCaptureInfo): new helper method that returns
8669 whether we have a CapturedContext initialized.
8671 (EmitContext.CaptureVariable): New method used to register that a
8672 LocalInfo must be flagged for capturing.
8674 (EmitContext.CapturedParameter): New method used to register that a
8675 parameters must be flagged for capturing.
8677 (EmitContext.CapturedField): New method used to register that a
8678 field must be flagged for capturing.
8680 (EmitContext.HaveCapturedVariables,
8681 EmitContext.HaveCapturedFields): Return whether there are captured
8682 variables or fields.
8684 (EmitContext.EmitMethodHostInstance): This is used to emit the
8685 instance for the anonymous method. The instance might be null
8686 (static methods), this (for anonymous methods that capture nothing
8687 and happen to live side-by-side with the current method body) or a
8688 more complicated expression if the method has a CaptureContext.
8690 (EmitContext.EmitTopBlock): Routine that drives the emission of
8691 code: it will first resolve the top block, then emit any metadata
8692 and then emit the code. The split is done so that we can extract
8693 any anonymous methods and flag any captured variables/parameters.
8695 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8696 during this phase, the ILGenerator should not be used as labels
8697 and local variables declared here might not be accessible to any
8698 code that is part of an anonymous method.
8700 Exceptions to this include the temporary variables that are
8701 created by some statements internally for holding temporary
8704 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8707 (EmitContext.TemporaryReturn): This method is typically called
8708 from the Emit phase, and its the only place where we allow the
8709 ReturnLabel to be defined other than the EmitMeta. The reason is
8710 that otherwise we would have to duplicate a lot of logic in the
8711 Resolve phases of various methods that today is on the Emit
8714 (EmitContext.NeedReturnLabel): This no longer creates the label,
8715 as the ILGenerator is not valid during the resolve phase.
8717 (EmitContext.EmitThis): Extended the knowledge in this class to
8718 work in anonymous methods in addition to iterators.
8720 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8721 code is necessary on the stack to access the instance to a local
8722 variable (the variable will be accessed as a field).
8724 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8725 EmitContext.EmitAddressOfParameter): Routines to support
8726 parameters (not completed at this point).
8728 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8729 will also remove the parameters.
8731 * convert.cs (Convert): Define a `ConstantEC' which points to a
8732 null. This is just to prefity some code that uses
8733 ImplicitStandardConversion code and do not have an EmitContext
8736 The idea is to flag explicitly that at that point in time, it is
8737 known that the conversion will not trigger the delegate checking
8738 code in implicit conversions (which requires a valid
8741 Everywhere: pass new EmitContext parameter since
8742 ImplicitStandardConversionExists now requires it to check for
8743 anonymous method conversions.
8745 (Convert.ImplicitStandardConversionExists): If the type of an
8746 expression is the anonymous_method_type, and the type is a
8747 delegate, we invoke the AnonymousMethod.Compatible method to check
8748 whether an implicit conversion is possible.
8750 (Convert.ImplicitConversionStandard): Only do implicit method
8751 group conversions if the language level is not ISO_1.
8753 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8754 MethodInfo for the Invoke method. used by Delegate and
8757 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8758 method conversions if the target type is a delegate.
8760 Removed extra debugging nops.
8762 (LocalVariableReference): Turn the `local_info' into a public
8765 Add `prepared' field, the same hack used for FieldExprs to cope
8766 with composed assignments, as Local variables do not necessarily
8767 operate purely on the stack as they used to: they can be captured
8770 Add `temp' for a temporary result, like fields.
8772 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8774 It now copes with Local variables that are captured and emits the
8775 proper instance variable to load it from a field in the captured
8778 (ParameterReference.DoResolveBase): During the resolve phase,
8779 capture parameters if we are in an anonymous method.
8781 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8782 anonymous method, use the EmitContext helper routines to emit the
8783 parameter reference.
8785 * iterators.cs: Set RemapToProxy to true/false during the
8788 * parameters.cs (GetParameterByName): New helper method.
8790 * typemanager.cs (anonymous_method_type) a new type that
8791 represents an anonyous method. This is always an internal type,
8792 used as a fencepost to test against the anonymous-methodness of an
8795 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8797 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8799 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8801 2004-11-10 Martin Baulig <martin@ximian.com>
8803 * expression.cs (Invocation.BetterFunction): If two methods have
8804 equal parameter types, but only one of them is generic, the
8805 non-generic one wins.
8806 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8807 instance; just use `Type.IsValueType' to determine whether
8808 something is a struct or not.
8809 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8810 so we can be called multiple times.
8812 2004-11-10 Martin Baulig <martin@ximian.com>
8814 * generic.cs (TypeParameter.DefineConstraints): New public method.
8815 (TypeParameter.CheckAccessLevel): Override this and return true.
8816 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8817 override ResolveType() anymore.
8818 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8820 2004-11-10 Martin Baulig <martin@ximian.com>
8822 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8823 call DeclSpace.ResolveNestedType() on it.
8825 2004-11-10 Martin Baulig <martin@ximian.com>
8827 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8828 non-null, call ParameterModifier() on it.
8830 2004-11-10 Martin Baulig <martin@ximian.com>
8833 (Iterators): Added `current_type' and `this_type' fields.
8834 (Iterators.DefineIterator): Create a new EmitContext and store it
8835 in `ec'; compute `this_type'.
8837 2004-11-10 Martin Baulig <martin@ximian.com>
8840 (TypeManager.IsPrivateAccessible): New public method.
8841 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8843 2004-11-10 Martin Baulig <martin@ximian.com>
8845 * class.cs (TypeContainer.DefineType): Call
8846 TypeBuilder.DefineGenericParameters() before resolving the type
8848 (MethodData.parent_method): New protected field.
8849 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8850 (MethodData.Define): Compute `parent_method'.
8853 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8854 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8855 (DeclSpace.ec): New protected field; store the EmitContext here.
8856 (DeclSpace.EmitContext): New public property.
8857 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8858 (DeclSpace.ResolveNestedType): New public method.
8859 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8860 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8861 (DeclSpace.FamilyAccessible): Likewise.
8862 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8863 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8866 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8869 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8870 (Enum.Emit): Don't create a new EmitContext.
8872 2004-10-18 Martin Baulig <martin@ximian.com>
8874 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8875 `Type' directly, but call ResolveType() on it.
8876 (Catch.Resolve): Likewise.
8877 (Foreach.Resolve): Likewise.
8879 2004-10-18 Martin Baulig <martin@ximian.com>
8881 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8882 `Type' directly, but call ResolveType() on it.
8883 (Probe.DoResolve): Likewise.
8884 (ArrayCreation.LookupType): Likewise.
8885 (TypeOf.DoResolve): Likewise.
8886 (SizeOf.DoResolve): Likewise.
8888 2004-10-18 Raja R Harinath <rharinath@novell.com>
8890 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8893 2004-10-17 John Luke <john.luke@gmail.com>
8895 * class.cs (Operator.GetSignatureForError): use CSharpName
8897 * parameter.cs (Parameter.GetSignatureForError): Returns
8898 correct name even if was not defined.
8900 2004-10-13 Raja R Harinath <rharinath@novell.com>
8903 * class.cs (TypeContainer.EmitContext): New property.
8904 (DefineNestedTypes): Create an emitcontext for each part.
8905 (MethodCore.DoDefineParameters): Use container's emitcontext.
8906 Pass type array to InternalParameters.
8907 (MemberBase.DoDefine): Use container's emitcontext.
8908 (FieldMember.Define): Likewise.
8909 (Event.Define): Likewise.
8910 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8911 Pass type array to InternalParameters.
8912 (SetIndexerMethod.GetParameterInfo): Likewise.
8913 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8914 * delegate.cs (Define): Pass emitcontext to
8915 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8916 array to InternalParameters.
8917 * expression.cs (ParameterReference.DoResolveBase): Pass
8918 emitcontext to GetParameterInfo.
8919 (ComposedCast.DoResolveAsTypeStep): Remove check on
8920 ec.ResolvingTypeTree.
8921 * parameter.cs (Parameter.Resolve): Change argument to
8922 EmitContext. Use ResolveAsTypeTerminal.
8923 (Parameter.GetSignature): Change argument to EmitContext.
8924 (Parameters.ComputeSignature): Likewise.
8925 (Parameters.ComputeParameterTypes): Likewise.
8926 (Parameters.GetParameterInfo): Likewise.
8927 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8928 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8929 * support.cs (InternalParameters..ctor): Remove variant that takes
8931 * typemanager.cs (system_intptr_expr): New.
8932 (InitExpressionTypes): Initialize it.
8934 2004-10-12 Chris Toshok <toshok@ximian.com>
8936 * cs-parser.jay: fix location for try_statement and catch_clause.
8938 2004-10-18 Martin Baulig <martin@ximian.com>
8940 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8941 `Type' directly, but call ResolveType() on it.
8942 (MemberBase.DoDefine): Likewise.
8944 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8945 `Type' directly, but call ResolveType() on it.
8946 (ComposedCast.DoResolveAsTypeStep): Likewise.
8948 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8949 `Type' directly, but call ResolveType() on it.
8951 2004-10-17 John Luke <john.luke@gmail.com>
8953 * class.cs (Operator.GetSignatureForError): use CSharpName
8955 * parameter.cs (Parameter.GetSignatureForError): Returns
8956 correct name even if was not defined.
8958 2004-10-13 Raja R Harinath <rharinath@novell.com>
8961 * class.cs (TypeContainer.EmitContext): New property.
8962 (DefineNestedTypes): Create an emitcontext for each part.
8963 (MethodCore.DoDefineParameters): Use container's emitcontext.
8964 Pass type array to InternalParameters.
8965 (MemberBase.DoDefine): Use container's emitcontext.
8966 (FieldMember.Define): Likewise.
8967 (Event.Define): Likewise.
8968 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8969 Pass type array to InternalParameters.
8970 (SetIndexerMethod.GetParameterInfo): Likewise.
8971 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8972 * delegate.cs (Define): Pass emitcontext to
8973 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8974 array to InternalParameters.
8975 * expression.cs (ParameterReference.DoResolveBase): Pass
8976 emitcontext to GetParameterInfo.
8977 (ComposedCast.DoResolveAsTypeStep): Remove check on
8978 ec.ResolvingTypeTree.
8979 * parameter.cs (Parameter.Resolve): Change argument to
8980 EmitContext. Use ResolveAsTypeTerminal.
8981 (Parameter.GetSignature): Change argument to EmitContext.
8982 (Parameters.ComputeSignature): Likewise.
8983 (Parameters.ComputeParameterTypes): Likewise.
8984 (Parameters.GetParameterInfo): Likewise.
8985 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8986 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8987 * support.cs (InternalParameters..ctor): Remove variant that takes
8989 * typemanager.cs (system_intptr_expr): New.
8990 (InitExpressionTypes): Initialize it.
8992 2004-10-12 Chris Toshok <toshok@ximian.com>
8994 * cs-parser.jay: fix location for try_statement and catch_clause.
8996 2004-10-07 Raja R Harinath <rharinath@novell.com>
8998 More DeclSpace.ResolveType avoidance.
8999 * decl.cs (MemberCore.InUnsafe): New property.
9000 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9001 with newly created EmitContext.
9002 (FieldMember.Define): Likewise.
9003 * delegate.cs (Delegate.Define): Likewise.
9004 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9005 only if normal name-lookup fails.
9006 (TypeExpr.DoResolve): Enable error-checking.
9007 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9008 (SizeOf.DoResolve): Likewise.
9009 (ComposedCast.DoResolveAsTypeStep): Likewise.
9010 (StackAlloc.DoResolve): Likewise.
9011 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9012 (Block.Unsafe): New property.
9013 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9014 (Unsafe): Set 'unsafe' flag of contained block.
9015 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9016 (Fixed.Resolve): Likewise.
9017 (Catch.Resolve): Likewise.
9018 (Using.ResolveLocalVariableDecls): Likewise.
9019 (Foreach.Resolve): Likewise.
9021 2004-10-05 John Luke <john.luke@gmail.com>
9023 * cs-parser.jay: add location to error CS0175
9025 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9027 * ecore.cs (Expression.Constantity): Add support for turning null
9030 * const.cs (Const.Define): Allow constants to be reference types
9031 as long as the value is Null.
9033 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9035 * namespace.cs (NamespaceEntry.Using): No matter which warning
9036 level is set, check if this namespace name has already been added.
9038 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9040 * expression.cs: reftype [!=]= null should always use br[true,false].
9043 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9046 * attribute.cs: Enum conversion moved to
9047 GetAttributeArgumentExpression to be applied to the all
9050 2004-10-01 Raja R Harinath <rharinath@novell.com>
9052 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9053 * class.c (TypeContainer.DefineType): Flag error if
9054 base types aren't accessible due to access permissions.
9055 * decl.cs (DeclSpace.ResolveType): Move logic to
9056 Expression.ResolveAsTypeTerminal.
9057 (DeclSpace.ResolveTypeExpr): Thin layer over
9058 Expression.ResolveAsTypeTerminal.
9059 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9060 Refactor code into NestedAccess. Use it.
9061 (DeclSpace.NestedAccess): New.
9062 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9063 argument to silence errors. Check access permissions.
9064 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9065 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9066 (Cast.DoResolve): Likewise.
9067 (New.DoResolve): Likewise.
9068 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9069 (TypeOf.DoResolve): Likewise.
9071 * expression.cs (Invocation.BetterConversion): Return the Type of
9072 the better conversion. Implement section 14.4.2.3 more faithfully.
9073 (Invocation.BetterFunction): Make boolean. Make correspondence to
9074 section 14.4.2.2 explicit.
9075 (Invocation.OverloadResolve): Update.
9076 (Invocation): Remove is_base field.
9077 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9078 (Invocation.Emit): Likewise.
9080 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9082 * cs-parser.jay: Reverted 642 warning fix.
9084 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9087 * decl.cs (FindMemberWithSameName): Indexer can have more than
9090 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9092 * expression.cs (LocalVariableReference.DoResolveLValue):
9093 Do not report warning 219 for out values.
9094 (EmptyExpression.Null): New member to avoid extra allocations.
9096 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9098 * cs-parser.jay: Fix wrong warning 642 report.
9100 * cs-tokenizer.cs (CheckNextToken): New helper;
9101 Inspect next character if is same as expected.
9103 2004-09-23 Martin Baulig <martin@ximian.com>
9105 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9106 (Convert.ImplicitReferenceConversionExists): Likewise.
9108 2004-11-09 Raja R Harinath <rharinath@novell.com>
9110 * Makefile (DISTFILES): Comment out a few missing files.
9112 2004-10-29 Raja R Harinath <rharinath@novell.com>
9114 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9115 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9116 (gmcs.exe): Invoke bootstrap-libs.
9117 (clean-local): Clean the net_2_0_bootstrap profile too.
9118 (PROGRAM_INSTALL_DIR): New.
9119 (install-local): Use it.
9121 2004-10-13 Martin Baulig <martin@ximian.com>
9123 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9124 (TypeParameter.DefineType): If we're a method type parameter and
9125 that method is overriding something, "inflate" its constraints.
9127 2004-10-12 Martin Baulig <martin@ximian.com>
9129 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9130 and have type arguments, create and resolve a ConstructedType.
9132 2004-10-12 Martin Baulig <martin@ximian.com>
9134 * decl.cs (MemberCache.FindMemberToOverride): Use
9135 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9136 to compare the invocationType.
9138 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9139 When comparing two type parameters, only do the signature-only
9140 comparision for method type parameters.
9142 2004-10-11 Martin Baulig <martin@ximian.com>
9144 * report.cs: Don't make --fatal abort on warnings, we have
9145 -warnaserror for that.
9147 2004-10-11 Martin Baulig <martin@ximian.com>
9150 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9151 (TypeManager.IsEqual): Call ourself recursively instead of using
9154 2004-10-11 Martin Baulig <martin@ximian.com>
9156 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9157 on our own type parameters, not on the ones we inherit from a containing
9160 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9163 * generic.cs (TypeParameter.Define): We may only be called once.
9165 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9166 instead of TypeManager.IsEqual().
9168 2004-09-28 Martin Baulig <martin@ximian.com>
9171 (GenericConstraints.EffectiveBaseClass): New public property.
9172 (TypeParameter.GenericConstraints): New public property.
9173 (ConstructedType.CheckConstraints): Improved.
9175 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9176 (Convert.TypeParameterConversion): New private method; use this in
9177 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9178 for all conversions related to type parameters.
9180 2004-09-24 Martin Baulig <martin@ximian.com>
9182 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9183 type parameter conversions for type parameters which are known to
9186 2004-09-24 Martin Baulig <martin@ximian.com>
9188 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9189 `IsValueType' properties.
9191 * support.cs (ReflectionConstraints): Use
9192 Type.GetGenericParameterConstraints() instead of the old hack.
9194 2004-09-24 Martin Baulig <martin@ximian.com>
9196 * generic.cs (GenericConstraints): Moved here and made it an
9199 * support.cs (GenericConstraints): Moved to generic.cs.
9201 2004-09-24 Martin Baulig <martin@ximian.com>
9204 (ReflectionConstraints): Un-nested this class and made it public.
9207 (TypeManager.GetTypeParameterConstraints): New public method.
9208 (TypeManager.HasConstructorConstraint): Use the attributes.
9210 2004-09-24 Martin Baulig <martin@ximian.com>
9212 * support.cs (GenericConstraints): Replaced `HasConstructor',
9213 `IsReferenceType' and `IsValueType' with `Attributes'.
9214 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9215 method and made the .ctor public.
9217 * generic.cs (Constraints.Attributes): New public property.
9218 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9219 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9220 `IsValueType' -> `HasValueTypeConstraint'.
9222 2004-09-23 Martin Baulig <martin@ximian.com>
9224 * generic.cs (Constraints): Reflect latest runtime changes.
9226 2004-09-23 Martin Baulig <martin@ximian.com>
9228 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9229 (Convert.ImplicitReferenceConversionExists): Likewise.
9231 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9233 * class.cs (Operator.Define): Add error 448 and 559 report.
9235 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9237 * class.cs (MemberBase.IsTypePermitted): New protected
9238 method for checking error CS0610.
9240 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9242 * class.cs (TypeContainer.HasExplicitLayout): New property
9243 Returns whether container has StructLayout attribute set Explicit.
9244 (FieldMember): New abstract class for consts and fields.
9245 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9246 (Field): Reuse FieldMember.
9248 * const.cs (Const): Reuse FieldMember.
9250 * rootcontext.cs: EmitConstants call moved to class.
9252 2004-09-22 Martin Baulig <martin@ximian.com>
9254 Marek and me just fixed one of our oldest bugs: #28562 :-)
9256 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9258 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9259 we're an EnumConstant, just return that.
9260 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9261 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9262 to get the value which'll actually be written into the attribute.
9263 However, we have to use GetValue() to access the attribute's value
9266 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9268 * constant.cs (Constant.IsNegative): New abstract property
9271 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9272 (StackAlloc.DoResolve): Reused IsNegative.
9274 2004-09-22 Martin Baulig <martin@ximian.com>
9276 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9277 public method; like LookupTypeContainer, but also works for
9280 * report.cs (Report.SymbolRelatedToPreviousError): Use
9281 TypeManager.LookupGenericTypeContainer().
9283 2004-09-22 Martin Baulig <martin@ximian.com>
9285 Thanks to Peter Sestoft for this bug report.
9287 * expression.cs (Conditional): If both the `trueExpr' and the
9288 `falseExpr' is a NullLiteral, return a NullLiteral.
9290 2004-09-22 Martin Baulig <martin@ximian.com>
9292 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9293 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9294 for the "get_Current" call.
9296 2004-09-21 Martin Baulig <martin@ximian.com>
9298 * convert.cs (Convert.ImplicitReferenceConversion): When
9299 converting to an interface type, first check whether we're
9300 converting from a reference type.
9302 2004-09-14 Martin Baulig <martin@ximian.com>
9304 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9306 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9309 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9310 called and is obsolete then this member suppress message
9311 when call is inside next [Obsolete] method or type.
9313 * expression.cs: Use TestObsoleteMethodUsage member.
9315 2004-09-14 Martin Baulig <martin@ximian.com>
9317 * genericparser.cs: Removed.
9319 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9321 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9323 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9325 * attribute.cs (Attribute.Resolve): Add error 653 report.
9327 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9329 (Method.ApplyAttributeBuilder): Add error 685 report.
9330 (Operator.Define): Add error 564 report.
9332 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9334 * expression.cs (Invocation.DoResolve): Add error
9337 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9340 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9342 * class.cs (ConstructorInitializer.Resolve):
9343 Wrong error number (515->516).
9345 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9347 * class.cs (Indexer.Define): Add error 631 report.
9349 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9351 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9353 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9355 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9357 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9359 * cs-parser.jay: Added error CS0241 report.
9361 2004-09-10 Raja R Harinath <rharinath@novell.com>
9363 * cs-parser.jay (fixed_statement): Introduce a scope for the
9364 declaration in the 'fixed' statement.
9366 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9368 * cs-parser.jay: Added CS0230 error report.
9370 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9372 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9374 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9376 * expression.cs (Argument.Resolve): Added error CS0192 and
9379 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9381 C# 2.0 #pragma warning feature
9383 * cs-tokenizer.cs (PreProcessPragma): New method;
9384 Handles #pragma directive.
9386 * report.cs (WarningRegions): New class; Support
9387 class for #pragma warning directive. It tests whether
9388 warning is enabled for a given line.
9390 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9392 * const.cs: Add more descriptive error report, tahnks to
9395 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9397 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9399 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9401 * expression.cs: Apply patch from Ben: Remove dead code from
9402 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9403 as that code just threw an exception anwyays.
9405 * const.cs: Remove the call to the turnintoconstant, for details
9408 * literal.cs: The type of the null-literal is the null type; So
9409 we use a placeholder type (literal.cs:System.Null, defined here)
9412 * expression.cs (Conditional.DoResolve): Remove some old code that
9413 is no longer needed, conversions have been fixed.
9415 (ArrayCreationExpression.DoResolve): Return false if we fail to
9416 resolve the inner expression.
9418 2004-09-07 Raja R Harinath <rharinath@novell.com>
9421 * cs-parser.jay (delegate_declaration): Record a delegate
9422 declaration as a type declaration.
9423 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9425 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9427 * parameter.cs: Do not crash if the type can not be resolved.
9429 * expression.cs: Report errors with unsafe pointers, fixes #64896
9431 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9433 * expression.cs: Pointer arith always needs to do a conv.i
9434 if the operand is a long. fix 65320
9436 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9438 Fixed cs0619-37.cs, cs0619-38.cs
9440 * enum.cs (GetObsoleteAttribute): Removed.
9442 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9443 on Enum member is double staged. The first is tested member
9446 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9448 Fixed #56986, #63631, #65231
9450 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9451 adds member to name container.
9452 (TypeContainer.AddToTypeContainer): New method, adds type to
9454 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9455 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9456 AddOperator): Simplified by reusing AddToMemberContainer.
9457 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9459 (Method.CheckForDuplications): Fixed implementation to test all
9461 (MemberBase): Detection whether member is explicit interface
9462 implementation is now in constructor.
9463 (MemberBase.UpdateMemberName): Handles IndexerName.
9464 (Accessor): Changed to keep also location information.
9465 (AbstractPropertyEventMethod): Is derived from MemberCore.
9466 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9467 will be emited or not.
9468 (PropertyBase.AreAccessorsDuplicateImplementation):
9469 Tests whether accessors are not in collision with some method.
9470 (Operator): Is derived from MethodCore to simplify common
9473 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9475 (DeclSpace.AddToContainer): Adds the member to defined_names
9476 table. It tests for duplications and enclosing name conflicts.
9478 * enum.cs (EnumMember): Clean up to reuse the base structures
9480 2004-09-03 Martin Baulig <martin@ximian.com>
9482 Merged latest changes into gmcs. Please keep this comment in
9483 here, it makes it easier for me to see what changed in MCS since
9484 the last time I merged.
9486 2004-09-03 Martin Baulig <martin@ximian.com>
9488 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9489 into TypeContainer, to make partial classes work again.
9491 2004-09-03 Martin Baulig <martin@ximian.com>
9493 * rootcontext.cs (RootContext.V2): Removed.
9495 2004-03-23 Martin Baulig <martin@ximian.com>
9497 * expression.cs (Invocation.OverloadResolve): Added `bool
9498 may_fail' argument and use it instead of the Location.IsNull() hack.
9500 2004-09-09 Martin Baulig <martin@ximian.com>
9502 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9504 2004-09-09 Martin Baulig <martin@ximian.com>
9506 * generic.cs (TypeParameter.DefineType): Added support for
9507 explicit interface methods.
9509 2004-09-09 Martin Baulig <martin@ximian.com>
9511 * README.Changes: New document. Started to list important changes
9512 between MCS and GMCS here.
9514 2004-09-08 Martin Baulig <martin@ximian.com>
9517 (TypeContainer.CheckRecursiveDefinition): New protected method.
9518 (TypeContainer.DefineType): Move the CS0146 check into
9519 CheckRecursiveDefinition().
9521 2004-09-06 Martin Baulig <martin@ximian.com>
9523 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9524 types for the constructor constraint.
9526 2004-09-03 Martin Baulig <martin@ximian.com>
9528 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9529 into TypeContainer, to make partial classes work again.
9531 2004-09-03 Martin Baulig <martin@ximian.com>
9533 * rootcontext.cs (RootContext.V2): Removed.
9535 2004-03-23 Martin Baulig <martin@ximian.com>
9537 * expression.cs (Invocation.OverloadResolve): Added `bool
9538 may_fail' argument and use it instead of the Location.IsNull() hack.
9540 2004-09-03 Martin Baulig <martin@ximian.com>
9542 Merged latest changes into gmcs. Please keep this comment in
9543 here, it makes it easier for me to see what changed in MCS since
9544 the last time I merged.
9546 2004-09-03 Raja R Harinath <rharinath@novell.com>
9549 * expression.cs (BetterConversion): Don't allow either conversion
9550 to be null. Remove redundant implicit conversion test when 'q ==
9551 null' -- when this function is invoked, we already know that the
9552 implicit conversion exists.
9553 (BetterFunction): Assume that 'best' is non-null. Remove
9554 redundant reimplementation of IsApplicable when 'best' is null.
9555 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9556 number of arguments.
9557 (IsAncestralType): Extract from OverloadResolve.
9558 (OverloadResolve): Make robust to the MethodGroupExpr being
9559 unsorted. Implement all the logic of Section 14.5.5.1, and
9560 support overloading of methods from multiple applicable types.
9561 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9563 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9564 (RealError, Warning): Append type of report to related symbol.
9566 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9568 * enum.cs: Fixed CLS-Compliance checks for enum members.
9569 Error tests cs3008-8.cs, cs3014-8.cs
9571 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9573 Fixed bug #62342, #63102
9574 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9575 like ImplementMethod.
9577 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9579 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9582 2004-09-02 Martin Baulig <martin@ximian.com>
9584 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9585 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9588 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9590 C# 2.0 Static classes implemented
9592 * class.cs (TypeContainer): instance_constructors,
9593 initialized_fields, initialized_static_fields,
9594 default_constructor, base_inteface_types are protected to be
9595 accessible from StaticClass.
9596 (TypeContainer.DefineDefaultConstructor): New virtual method
9597 for custom default constructor generating
9598 (StaticClass): New class to handle "Static classes" feature.
9600 * cs-parser.jay: Handle static keyword on class like instance
9603 * driver.cs: Added "/langversion" command line switch with two
9604 options (iso-1, default).
9606 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9608 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9610 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9612 * delegate.cs: Style.
9614 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9616 * delegate.cs: Add seperate instance expr field for miguel.
9618 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9620 * PointerArithmetic (Resolve): make sure we are not doing
9621 pointer arith on void*. Also, make sure we are resolved
9622 by not setting eclass until resolve.
9624 All callers: Make sure that PointerArithmetic gets resolved.
9626 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9628 * ArrayCreation (LookupType): If the type does not resolve
9629 to an array, give an error.
9631 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9633 * statement.cs (Try.Resolve): Fixed bug #64222
9635 2004-08-27 Martin Baulig <martin@ximian.com>
9638 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9641 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9643 * ecore.cs (Constantify): Get underlying type via
9644 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9645 Windows in special cases.
9647 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9649 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9650 for obtaining also private methods.
9651 (GetRemoveMethod): Used GetRemoveMethod (true)
9652 for obtaining also private methods.
9654 2004-09-02 Martin Baulig <martin@ximian.com>
9656 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9657 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9660 2004-08-27 Martin Baulig <martin@ximian.com>
9663 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9666 2004-08-25 Martin Baulig <martin@ximian.com>
9668 * support.cs (ReflectionParameters..ctor): If this is a generic
9669 method, retrieve and store its type parameters.
9670 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9671 (ReflectionParameters.GenericConstraints): The argument specifies
9672 the type parameter, not the method parameter.
9673 (InternalParameters.GenericConstraints): Likewise.
9675 * generic.cs (TypeParameter.DefineType): Correctly handle
9676 constraints wrt. generic methods in interfaces and their
9679 2004-08-24 Martin Baulig <martin@ximian.com>
9681 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9682 (Constraints.IsSubclassOf): New internal method.
9684 * typemanager.cs (TypeManager.FindMembers): Added special support
9685 for GenericTypeParameterBuilder's.
9686 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9689 2004-08-24 Martin Baulig <martin@ximian.com>
9692 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9693 this for accessibility checks.
9694 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9695 IsNestedFamilyAccessible.
9696 (TypeManager.IsSubclassOf): New method, do what the name actually
9699 2004-08-24 Martin Baulig <martin@ximian.com>
9701 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9702 as a SimpleName, include the generic arity.
9704 2004-08-24 Martin Baulig <martin@ximian.com>
9706 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9707 MethodAttributes.HideBySig for operators.
9709 2004-08-23 Martin Baulig <martin@ximian.com>
9711 Back to the old error reporting system :-)
9713 * report.cs (Message): Removed.
9714 (Report.MessageData, ErrorData, WarningData): Removed.
9715 (Report.Error, Warning): Back to the old system.
9717 2004-08-23 Martin Baulig <martin@ximian.com>
9719 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9721 * class.cs (TypeContainer.ParentContainer): New public virtual
9722 method; replaces the explicit interface implementation.
9723 (ClassPart.ParentContainer): Override.
9725 2004-08-23 Martin Baulig <martin@ximian.com>
9727 * statement.cs (Switch): Added support for constant switches; see
9728 #59428 or test-285.cs.
9730 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9733 * statement.cs (GetEnumeratorFilter): Removed useless
9734 logic because C# specs is strict. GetEnumerator must be
9737 2004-08-22 Martin Baulig <martin@ximian.com>
9739 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9740 a switch and may break, reset the barrier. Fixes #59867.
9742 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9744 CLS-Compliance speed up (~5% for corlib)
9746 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9747 New method. Tests container for CLS-Compliant names
9749 * class.cs (TypeContainer.VerifyClsName): New method.
9750 Checks whether container name is CLS Compliant.
9751 (Constructor): Implements IMethodData.
9753 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9754 low-case table for CLS Compliance test.
9755 (MemberCache.VerifyClsParameterConflict): New method.
9756 Checks method parameters for CS3006 error.
9758 * enum.cs (EnumMember): Is derived from MemberCore.
9759 (Enum.VerifyClsName): Optimized for better performance.
9761 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9763 * report.cs: Renamed Error_T to Error and changed all
9766 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9768 * class.cs (TypeContainer.IndexerArrayList): New inner class
9769 container for indexers.
9770 (TypeContainer.DefaultIndexerName): New constant for default
9771 indexer name. Replaced all "Item" with this constant.
9772 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9774 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9775 DefaultMemberAttribute constructor.
9777 2004-08-05 Martin Baulig <martin@ximian.com>
9779 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9782 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9784 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9785 multi platforms problem.
9787 * compiler.csproj: Included shared files.
9789 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9791 Fix bug 60333, 55971 in the more general way
9792 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9793 Added arg_type argument for constant conversion.
9794 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9796 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9799 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9800 OperatorArrayList, MethodCoreArrayList for typecontainer
9801 containers. Changed class member types to these new types.
9802 (MethodArrayList.DefineMembers): Added test for CS0659.
9804 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9806 * cfold.cs: Synchronize the folding with the code in expression.cs
9807 Binary.DoNumericPromotions for uint operands.
9809 * attribute.cs: Revert patch from Raja, it introduced a regression
9810 while building Blam-1.2.1 (hard to isolate a test case).
9812 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9816 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9818 (MethodCore.parent_method): New member. The method we're overriding
9819 if this is an override method.
9820 (MethodCore.CheckBase): Moved from Method class and made common.
9821 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9823 (MethodCore.CheckForDuplications): New abstract method. For custom
9824 member duplication search in a container
9825 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9826 method and its return type.
9827 (Event.conflict_symbol): New member. Symbol with same name in the
9831 (MemberCache.FindMemberWithSameName): New method. The method
9832 is looking for conflict with inherited symbols.
9834 2004-08-04 Martin Baulig <martin@ximian.com>
9836 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9838 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9840 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9842 * report.cs (Message): New enum for better error, warning reference in
9844 (MessageData): New inner abstract class. It generally handles printing of
9845 error and warning messages.
9846 Removed unused Error, Warning, Message methods.
9848 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9850 Fix for cs0592-8.cs test
9852 (Attributable.ValidAttributeTargets): Made public.
9853 (Attribute.ExplicitTarget): New member for explicit target value.
9854 (Attribute.CheckTargets): Now we translate explicit attribute
9855 target to Target here.
9857 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9859 * ecore.cs (MethodGroupExpr): new IsBase property.
9861 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9863 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9864 rather than an instance expr.
9866 (DelegateCreation.Emit): Use the method group rather than
9867 the instance expression. Also, if you have base.Foo as the
9868 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9870 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9872 (NewDelegate.DoResolve): Only check for the existance of Invoke
9873 if the method is going to be needed. Use MethodGroupExpr.
9875 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9877 * expression.cs: For pointer arith., make sure to use
9878 the size of the type, not the size of the pointer to
9881 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9884 * class.cs (Class): Added error CS0502 test.
9886 2004-08-03 John Luke <jluke@cfl.rr.com>
9887 Raja R Harinath <rharinath@novell.com>
9890 * attribute.cs (Attribute.complained_before): New flag.
9891 (Attribute.ResolveType, Attribute.Resolve),
9892 (Attribute.DefinePInvokeMethod): Set it.
9893 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9895 2004-08-03 Martin Baulig <martin@ximian.com>
9897 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9898 use a user-defined operator; we still need to do numeric
9899 promotions in case one argument is a builtin type and the other
9900 one has an implicit conversion to that type. Fixes #62322.
9902 2004-08-18 Martin Baulig <martin@ximian.com>
9904 * class.cs (Method.Define): Use the correct method name when
9905 creating the MethodBuilder for a generic method.
9907 2004-08-17 Martin Baulig <martin@ximian.com>
9909 * generic.cs (Constraints): Support type parameter constraints.
9911 2004-08-16 Martin Baulig <martin@ximian.com>
9913 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9914 (Token.GENERIC_DIMENSION): New token; this is returned if we
9915 encounter an unbound generic type in a typeof() expression.
9917 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9918 this token is only generated while parsing a typeof() expression.
9919 (typeof_expression): Removed the old unbound_type hack.
9921 * generic.cs (TypeArguments.IsUnbound): New public property.
9923 * decl.cs (MemberName): Added support for unbound types.
9925 2004-08-14 Martin Baulig <martin@ximian.com>
9928 (TypeManager.IsEqualGenericInstance): New static method.
9929 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9930 just used to check accessibility, so follow the rules of 26.1.6.
9932 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9933 ConstructedType instead of a TypeExpression if we have type arguments.
9935 * cs-parser.jay (typeof_expression): Support unbound generic types.
9937 * ecore.cs (UnboundTypeExpression): New public class.
9939 2004-08-12 Martin Baulig <martin@ximian.com>
9941 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9942 TypeManager.IsEqual() rather than `=='.
9944 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9945 generic instances as well.
9947 2004-08-12 Martin Baulig <martin@ximian.com>
9949 * expression.cs (Invocation.InferType): We can only infer method
9950 type parameters. Fixes #62647.
9952 2004-08-11 Martin Baulig <martin@ximian.com>
9954 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9955 before resolving the base classes.
9957 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9959 * Makefile: install .mdb file too.
9961 2004-08-05 Martin Baulig <martin@ximian.com>
9963 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9964 initializer, the current type is just the TypeBuilder, not the
9965 instantiated generic type.
9966 (FieldExpr.IsFieldInitializer): New public property.
9968 2004-08-04 Martin Baulig <martin@ximian.com>
9970 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9972 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9974 2004-08-03 Martin Baulig <martin@ximian.com>
9976 * class.cs (MethodData.Define): If we're an explicit
9977 implementation, remove the generic arity from the type name.
9979 2004-08-03 Martin Baulig <martin@ximian.com>
9981 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9982 use a user-defined operator; we still need to do numeric
9983 promotions in case one argument is a builtin type and the other
9984 one has an implicit conversion to that type. Fixes #62322.
9986 2004-08-02 Martin Baulig <martin@ximian.com>
9988 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9990 (TypeContainer.GetClassBases): Return the unexpanded list of
9991 interfaces; we expand them later.
9992 (TypeContainer.DefineType): After creating the TypeBuilder, call
9993 TypeManager.ExpandInterfaces() to get an expanded and resolved
9996 * ecore.cs (TypeExpr.GetInterfaces): Removed
9998 * generics.cs (Constraints.InterfaceConstraints): Remove.
9999 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10000 register the interface constraints.
10003 (TypeManager.AddUserType): Removed the `ifaces' argument.
10004 (TypeManager.AddTypeParameter): Likewise.
10005 (TypeManager.AddUserInterface): Removed, was unused.
10006 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10007 `TypeExpr[]' array for the interfaces.
10008 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10009 has been defined, returns a list of the resolved interfaces types.
10010 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10011 (TypeManager.GetExplicitInterfaces): Likewise.
10013 2004-08-02 Martin Baulig <martin@ximian.com>
10015 * expression.cs (Invocation.EmitCall): If we're invoking a method
10016 on a type parameter, use the new `Constrained' prefix opcode.
10018 2004-08-02 Martin Baulig <martin@ximian.com>
10020 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10021 (LocalInfo.IsThis): New public property.
10022 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10024 2004-08-01 Martin Baulig <martin@ximian.com>
10026 * class.cs (TypeContainer.GetClassBases): Don't set the default
10027 here since we may get called from GetPartialBases().
10028 (TypeContainer.DefineType): If GetClassBases() didn't return a
10029 parent, use the default one.
10031 2004-07-30 Martin Baulig <martin@ximian.com>
10033 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10035 * class.cs (SourceMethod): New public class, derive from the
10036 symbol writer's ISourceMethod.
10037 (Method): Use the new symbol writer API.
10039 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10040 as argument and use the new symbol writer.
10043 (SourceFile): Implement the symbol writer's ISourceFile.
10044 (Location.SymbolDocument): Removed.
10045 (Location.SourceFile): New public property.
10047 * symbolwriter.cs: Use the new symbol writer API.
10049 2004-07-30 Raja R Harinath <rharinath@novell.com>
10051 * Makefile (install-local): Remove. Functionality moved to
10054 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10056 * Makefile: Install mcs.exe.config file together with mcs.exe.
10057 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10058 correct runtime version.
10060 2004-07-25 Martin Baulig <martin@ximian.com>
10063 (TypeContainer.RegisterOrder): Removed, this was unused.
10064 (TypeContainer, interface_order): Removed.
10065 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10066 TypeContainer as argument since we can also be called with a
10067 `PartialContainer' for a partial class/struct/interface.
10068 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10069 of checking whether we're an `Interface' - we could be a
10070 `PartialContainer'.
10071 (PartialContainer.Register): Override; call
10072 AddClass()/AddStruct()/AddInterface() on our parent.
10074 * cs-parser.jay (interface_member_declaration): Add things to the
10075 `current_container', not the `current_class'.
10077 * rootcontext.cs (RegisterOrder): The overloaded version which
10078 takes an `Interface' was unused, removed.
10080 * typemanager.cs (TypeManager.LookupInterface): Return a
10081 `TypeContainer', not an `Interface'.
10082 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10083 contain a `PartialContainer' for an interface, so check it's
10084 `Kind' to figure out what it is.
10086 2004-07-25 Martin Baulig <martin@ximian.com>
10088 * class.cs (Class.DefaultTypeAttributes): New public constant.
10089 (Struct.DefaultTypeAttributes): Likewise.
10090 (Interface.DefaultTypeAttributes): Likewise.
10091 (PartialContainer.TypeAttr): Override this and add the
10092 DefaultTypeAttributes.
10094 2004-07-25 Martin Baulig <martin@ximian.com>
10096 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10097 we can just use the `Parent' field instead.
10099 2004-07-25 Martin Baulig <martin@ximian.com>
10101 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10103 2004-07-25 Martin Baulig <martin@ximian.com>
10105 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10106 our parts before defining any methods.
10107 (TypeContainer.VerifyImplements): Make this virtual.
10108 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10109 on our PartialContainer.
10111 2004-07-25 Martin Baulig <martin@ximian.com>
10113 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10115 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10116 argument, we can just use the `Parent' field instead.
10119 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10120 (MemberBase.DoDefine): Likewise.
10122 2004-07-24 Martin Baulig <martin@ximian.com>
10124 * decl.cs (MemberCore.Parent): New public field.
10125 (DeclSpace.Parent): Moved to MemberCore.
10127 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10128 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10130 (FieldBase, Field, Operator): Likewise.
10131 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10132 (EventField, Event): Likewise.
10134 2004-07-23 Martin Baulig <martin@ximian.com>
10136 * class.cs (PartialContainer): New public class.
10137 (ClassPart): New public class.
10138 (TypeContainer): Added support for partial classes.
10139 (TypeContainer.GetClassBases): Splitted some of the functionality
10140 out into GetNormalBases() and GetPartialBases().
10142 * cs-tokenizer.cs (Token.PARTIAL): New token.
10143 (Tokenizer.consume_identifier): Added some hacks to recognize
10144 `partial', but only if it's immediately followed by `class',
10145 `struct' or `interface'.
10147 * cs-parser.jay: Added support for partial clases.
10149 2004-07-23 Martin Baulig <martin@ximian.com>
10151 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10152 a `DeclSpace' and also made it readonly.
10153 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10154 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10155 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10157 * cs-parser.jay: Pass the `current_class', not the
10158 `current_container' (at the moment, this is still the same thing)
10159 to a new Method, Property, Event, Indexer or Constructor.
10161 2004-07-23 Martin Baulig <martin@ximian.com>
10163 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10164 and removed the `current_interface' one.
10165 (struct_declaration, class_declaration, interface_declaration):
10166 Set `current_class' to the newly created class/struct/interface;
10167 set their `Bases' and call Register() before parsing their body.
10169 2004-07-23 Martin Baulig <martin@ximian.com>
10171 * class.cs (Kind): New public enum.
10172 (TypeContainer): Made this class abstract.
10173 (TypeContainer.Kind): New public readonly field.
10174 (TypeContainer.CheckDef): New public method; moved here from
10176 (TypeContainer.Register): New public abstract method.
10177 (TypeContainer.GetPendingImplementations): New public abstract
10179 (TypeContainer.GetClassBases): Removed the `is_class' and
10180 `is_iface' parameters.
10181 (TypeContainer.DefineNestedTypes): Formerly known as
10183 (ClassOrStruct): Made this class abstract.
10185 * tree.cs (RootTypes): New public type.
10187 2004-07-20 Martin Baulig <martin@ximian.com>
10189 * tree.cs (Tree.RecordNamespace): Removed.
10190 (Tree.Namespaces): Removed.
10192 * rootcontext.cs (RootContext.IsNamespace): Removed.
10194 * cs-parser.jay (namespace_declaration): Just create a new
10195 NamespaceEntry here.
10197 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10199 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10200 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10201 entry to make sure it runs in the correct runtime version.
10203 2004-07-18 Martin Baulig <martin@ximian.com>
10205 * generic.cs (ConstructedType.CheckConstraints): Improved
10206 constraints checking.
10208 2004-07-18 Martin Baulig <martin@ximian.com>
10210 * expression.cs (Invocation.BetterMethod): Call
10211 TypeManager.TypeToCoreType() on all types and removed my previous
10212 hack; we're already doig the right thing here.
10214 2004-07-17 Martin Baulig <martin@ximian.com>
10216 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10218 2004-07-16 Martin Baulig <martin@ximian.com>
10220 * iterators.cs: Added generics support.
10222 2004-07-16 Martin Baulig <martin@ximian.com>
10224 * iterators.cs: Rewrote this. We're now using one single Proxy
10225 class for both the IEnumerable and the IEnumerator interface and
10226 `Iterator' derives from Class so we can use the high-level API.
10228 * class.cs (TypeContainer.AddIterator): New method.
10229 (TypeContainer.DoDefineType): New protected virtual method, which
10230 is called from DefineType().
10231 (TypeContainer.DoDefineMembers): Call DefineType() and
10232 DefineMembers() on all our iterators.
10233 (TypeContainer.Emit): Call Emit() on all our iterators.
10234 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10236 * codegen.cs (EmitContext.CurrentIterator): New public field.
10238 2004-07-15 Martin Baulig <martin@ximian.com>
10241 (TypeManager.not_supported_exception_type): New type.
10243 2004-07-14 Martin Baulig <martin@ximian.com>
10246 (TypeManager.generic_ienumerable_type): New type.
10247 (TypeManager.generic_ienumerator_type): New type.
10250 (RootContext.interfaces_first_stage): Added
10251 "System.Collections.Generic.IEnumerator`1" and
10252 "System.Collections.Generic.IEnumerable`1".
10254 2004-07-14 Martin Baulig <martin@ximian.com>
10256 * iterators.cs: Use real error numbers.
10258 2004-07-14 Martin Baulig <martin@ximian.com>
10260 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10261 requires this to be a System.Collection.IEnumerable and not a
10262 class implementing that interface.
10263 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10265 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10267 * class.cs: Fixed previous fix, it broke some error tests.
10269 2004-07-12 Martin Baulig <martin@ximian.com>
10271 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10274 2004-07-14 Martin Baulig <martin@ximian.com>
10276 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10277 an exclamation mark (!) for the generic arity to reflect the
10278 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10280 2004-07-13 Martin Baulig <martin@ximian.com>
10282 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10283 specifiers being part of a type argument.
10285 2004-07-13 Martin Baulig <martin@ximian.com>
10287 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10288 name for generic types.
10290 2004-07-13 Martin Baulig <martin@ximian.com>
10292 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10295 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10297 * assign.cs (LocalTemporary): Add new argument: is_address,If
10298 `is_address' is true, then the value that we store is the address
10299 to the real value, and not the value itself.
10301 * ecore.cs (PropertyExpr): use the new local temporary
10302 stuff to allow us to handle X.Y += z (where X is a struct)
10304 2004-07-08 Martin Baulig <martin@ximian.com>
10306 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10307 not always return, just like we're doing in Using.Resolve().
10309 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10311 * cs-parser.jay (fixed_statement): flag this as Pinned.
10313 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10315 * typemanager.cs (TypeManager): Removed MakePinned method, this
10316 mechanism is replaced with the .NET 2.x compatible mechanism of
10317 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10319 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10320 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10321 `IsFixed' property which has a different meaning.
10323 2004-07-02 Raja R Harinath <rharinath@novell.com>
10325 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10326 visible from inside a nested class, not just the names of the
10327 immediately enclosing class.
10328 Fix for bug #60730.
10330 2004-06-24 Raja R Harinath <rharinath@novell.com>
10332 * expression.cs (BetterConversion): Remove buggy special-case
10333 handling of "implicit constant expression conversions". At this
10334 point, we already know that the conversion is possible -- we're
10335 only checking to see which is better.
10337 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10339 * cs-parser.jay: Added error CS0210 test.
10341 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10343 * cs-parser.jay: Added error CS0134 test.
10345 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10348 * cs-parser.jay: Added error CS0145 test.
10350 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10352 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10354 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10356 * expression.cs (StackAlloc.Resolve): The argument may not
10357 be a constant; deal with this case.
10359 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10361 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10362 GetIndexerAttributeValue.
10363 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10365 * class.cs (Indexer.Define): Added error tests for CS0415,
10368 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10370 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10373 2004-06-23 Martin Baulig <martin@ximian.com>
10375 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10376 neither return nor throw, reset the barrier as well. Fixes #60457.
10378 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10380 * class.cs : EventAttributes is now set to None by default.
10381 This fixes bug #60459.
10383 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10386 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10387 Don't throw exception but return null (it's sufficient now).
10389 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10391 * typemanager.cs (GetArgumentTypes): Faster implementation.
10393 2004-06-18 Martin Baulig <martin@ximian.com>
10395 * attribute.cs (Attribute.Resolve): Check whether we're an
10396 EmptyCast which a Constant child. Fixes #60333.
10398 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10400 * statement.cs (EmitCollectionForeach): Account for the fact that
10401 not all valuetypes are in areas which we can take the address of.
10402 For these variables, we store to a temporary variable. Also, make
10403 sure that we dont emit a `callvirt' on a valuetype method.
10405 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10407 * expression.cs (StackAlloc.DoReSolve): Added test for
10408 negative parameter (CS0247).
10410 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10413 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10415 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10418 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10421 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10423 Fix bug #58254 & cs1555.cs, cs1556.cs
10424 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10426 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10428 * cs-parser.jay: Added error CS1669 test for indexers.
10430 2004-06-18 Martin Baulig <martin@ximian.com>
10432 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10433 argument. Fixes #60441.
10435 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10436 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10437 The name needs to have the actual name of the method in order
10438 for other tests (such as the one in OverloadResolve for Invoke
10439 on a delegate) to work. As well, it does not really help
10440 error reporting because the method group had multiple methods.
10441 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10442 Make profiling work.
10444 2004-06-13 Martin Baulig <martin@ximian.com>
10446 * cs-parser.jay: Don't allow generic attributes.
10448 2004-06-13 Martin Baulig <martin@ximian.com>
10450 * class.cs (MemberBase.DoDefineBase): New protected method.
10451 (MemberBase.DoDefine): Compute the `flags' in the new
10452 DoDefineBase() which must be called first.
10453 (Method.Define): Call DoDefineBase() first so we have the flags
10454 when defining the generic method.
10456 * cs-parser.jay (interface_method_declaration): Support generic methods.
10458 2004-06-13 Martin Baulig <martin@ximian.com>
10460 * decl.cs (TypeName): Removed.
10461 (MemberName): Removed TypeName and MemberNow; now we just have
10464 * cs-parser.jay: Don't distinguish between type arguments and type
10465 parameters in the grammar and simplified the rules a bit. The
10466 reduce/reduce conflicts are now gone (except the one we inherited
10469 2004-06-11 Martin Baulig <martin@ximian.com>
10471 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10472 call this twice: for params and varargs methods.
10474 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10477 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10479 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10481 * attribute.cs (Attribute.GetValidTargets): Made public.
10484 (AbstractPropertyEventMethod): New class for better code sharing.
10485 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10487 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10489 2004-06-09 Martin Baulig <martin@ximian.com>
10491 * cs-parser.jay: Removed a reduce/reduce conflict.
10493 2004-06-03 Martin Baulig <martin@ximian.com>
10495 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10496 GetSimpleName() and return a SimpleName.
10498 * ecore.cs (SimpleName.Arguments): New public field.
10499 (SimpleName): Added overloaded ctor which takes an additional
10500 TypeArguments argument.
10501 (SimpleName.SimpleNameResolve): Added support for generic methods.
10502 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10503 formerly in MemberAccess.DoResolve(), but we also need it in
10504 SimpleNameResolve().
10506 * expression.cs (MemberAccess.DoResolve): Use the new
10507 MethodGroupExpr.ResolveGeneric().
10509 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10511 * decl.cs: If possible, use lookuptypedirect here. We can only do
10512 this if there is no `.' after the namespace. Avoids using
10513 LookupType, which does lots of slow processing.
10514 (FindNestedType) New method, does what it says :-).
10515 * namespace.cs: use LookupTypeDirect.
10516 * rootcontext.cs: use membercache, if possible.
10517 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10519 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10522 According to the spec,
10524 In a member access of the form E.I, if E is a single identifier,
10525 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10526 field, property, localvariable, or parameter with the same type as
10527 the meaning of E as a type-name (§3.8), then both possible
10528 meanings of E are permitted.
10530 We did not check that E as a simple-name had the same type as E as
10533 This trivial check gives us 5-7% on bootstrap time.
10535 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10537 * expression.cs (Invocation.OverloadResolve): Avoid the
10538 use of hashtables and boxing here by allocating on demand.
10540 2004-05-30 Martin Baulig <martin@ximian.com>
10542 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10543 we're doing a silent lookup. Don't try to lookup nested types in
10544 TypeManager.object_type (thanks to Ben Maurer).
10546 2004-05-30 Martin Baulig <martin@ximian.com>
10548 Committing a patch from Ben Maurer.
10550 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10552 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10554 * convert.cs: add a trivial cache for overload operator resolution.
10556 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10559 (AttributeTester.GetObsoleteAttribute): Returns instance of
10560 ObsoleteAttribute when type is obsolete.
10563 (TypeContainer.VerifyObsoleteAttribute): Override.
10564 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10565 (MethodCode.VerifyObsoleteAttribute): Override.
10566 (MemberBase.VerifyObsoleteAttribute): Override.
10569 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10570 and report proper error.
10573 (Delegate.VerifyObsoleteAttribute): Override.
10576 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10577 and report proper error.
10578 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10581 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10585 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10586 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10587 Added test for ObsoleteAttribute.
10590 (Catch): Derived from Statement.
10592 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10594 * decl.cs: If possible, use lookuptypedirect here. We can only do
10595 this if there is no `.' after the namespace. Avoids using
10596 LookupType, which does lots of slow processing.
10597 (FindNestedType) New method, does what it says :-).
10598 * namespace.cs: use LookupTypeDirect.
10599 * rootcontext.cs: use membercache, if possible.
10600 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10602 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10605 According to the spec,
10607 In a member access of the form E.I, if E is a single identifier,
10608 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10609 field, property, localvariable, or parameter with the same type as
10610 the meaning of E as a type-name (§3.8), then both possible
10611 meanings of E are permitted.
10613 We did not check that E as a simple-name had the same type as E as
10616 This trivial check gives us 5-7% on bootstrap time.
10618 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10620 Fixed bug #59071 & cs0160.cs
10621 * statement.cs (Try.Resolve): Check here whether order of catch
10622 clauses matches their dependencies.
10624 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10627 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10630 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10632 * expression.cs (Invocation.OverloadResolve): Avoid the
10633 use of hashtables and boxing here by allocating on demand.
10635 2004-05-30 Martin Baulig <martin@ximian.com>
10637 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10638 we're doing a silent lookup. Don't try to lookup nested types in
10639 TypeManager.object_type (thanks to Ben Maurer).
10641 2004-05-30 Martin Baulig <martin@ximian.com>
10643 Committing a patch from Ben Maurer.
10645 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10647 2004-05-29 Martin Baulig <martin@ximian.com>
10649 * class.cs (IMethodData.ShouldIgnore): New method.
10651 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10652 `Location' argument, we don't need it anywhere. Use
10653 `IMethodData.ShouldIgnore ()' instead of
10654 `MethodData.GetMethodFlags ()'.
10655 (TypeManager.AddMethod): Removed.
10656 (TypeManager.AddMethod2): Renamed to AddMethod.
10658 2004-05-29 Martin Baulig <martin@ximian.com>
10660 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10662 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10663 converting from a class type S to an interface type and we already
10664 have an object on the stack, don't box it again. Fixes #52578.
10666 2004-05-29 Martin Baulig <martin@ximian.com>
10668 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10669 Added support for `params' parameters. Fixes #59267.
10671 2004-05-29 Martin Baulig <martin@ximian.com>
10673 * literal.cs (NullPointer): Provide a private .ctor which sets
10674 `type' to TypeManager.object_type. Fixes #59048.
10676 2004-05-29 Martin Baulig <martin@ximian.com>
10678 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10679 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10681 * ecore.cs (EventExpr.instance_expr): Make the field private.
10683 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10685 Fixed bug #50080 & cs0214-2.cs
10686 * expression.cs (Cast.DoResolve): Check unsafe context here.
10688 * statement.cs (Resolve.DoResolve): Likewise.
10690 2004-05-26 Martin Baulig <martin@ximian.com>
10692 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10694 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10695 (RootContext.LookupType): Pass down the `silent' flag.
10697 2004-05-25 Martin Baulig <martin@ximian.com>
10700 (MethodGroupExpr.IdenticalTypeName): New public property.
10701 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10702 expression actually refers to a type.
10704 2004-05-25 Martin Baulig <martin@ximian.com>
10706 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10707 for #56176 and made it actually work.
10709 2004-05-25 Martin Baulig <martin@ximian.com>
10711 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10712 (FieldExpr, PropertyExpr): Override and implement
10713 CacheTemporaries. Fixes #52279.
10715 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10717 * location.cs: In the new compiler listing a file twice is a
10718 warning, not an error.
10720 2004-05-24 Martin Baulig <martin@ximian.com>
10722 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10723 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10725 2004-05-24 Martin Baulig <martin@ximian.com>
10727 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10728 walking the `using' list. Fixes #53921.
10730 2004-05-24 Martin Baulig <martin@ximian.com>
10732 * const.cs (Const.LookupConstantValue): Added support for
10733 EmptyCast's; fixes #55251.
10735 2004-05-24 Martin Baulig <martin@ximian.com>
10737 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10738 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10739 which does the CS0135 check. The reason is that we first need to
10740 check whether the variable actually exists.
10742 2004-05-24 Martin Baulig <martin@ximian.com>
10744 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10745 than RootContext.LookupType() to find the explicit interface
10746 type. Fixes #58584.
10748 2004-05-24 Raja R Harinath <rharinath@novell.com>
10750 * Makefile: Simplify. Use executable.make.
10751 * mcs.exe.sources: New file. List of sources of mcs.exe.
10753 2004-05-24 Anders Carlsson <andersca@gnome.org>
10757 Use the invariant culture when doing String.Compare for CLS case
10760 2004-05-23 Martin Baulig <martin@ximian.com>
10762 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10763 don't have any dots. Fixes #52622, added cs0246-8.cs.
10765 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10767 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10769 * class.cs (MemberBase.Define): Reuse MemberType member for
10770 resolved type. Other methods can use it too.
10772 2004-05-23 Martin Baulig <martin@ximian.com>
10774 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10775 the variable also exists in the current block (otherwise, we need
10776 to report a CS0103). Fixes #58670.
10778 2004-05-23 Martin Baulig <martin@ximian.com>
10780 * flowanalysis.cs (Reachability.Reachable): Compute this
10781 on-the-fly rather than storing it as a field.
10783 2004-05-23 Martin Baulig <martin@ximian.com>
10785 * flowanalysis.cs (Reachability.And): Manually compute the
10786 resulting `barrier' from the reachability.
10788 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10791 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10792 instance of ObsoleteAttribute when symbol is obsolete.
10795 (IMethodData): Extended interface for ObsoleteAttribute support.
10797 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10799 * attribute.cs: Fix bug #55970
10801 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10805 (GetObsoleteAttribute): New method. Creates the instance of
10807 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10808 ObsoleteAttribute when member is obsolete.
10809 (AttributeTester.Report_ObsoleteMessage): Common method for
10810 Obsolete error/warning reporting.
10813 (TypeContainer.base_classs_type): New member for storing parent type.
10816 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10817 for this MemberCore.
10819 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10821 * attribute.cs, const.cs: Fix bug #58590
10823 2004-05-21 Martin Baulig <martin@ximian.com>
10825 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10826 out parameters if the end of the method is unreachable. Fixes
10829 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10831 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10832 Hari was right, why extra method.
10834 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10836 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10838 2004-05-20 Martin Baulig <martin@ximian.com>
10840 * delegate.cs: Convert this file to Unix mode - like the original
10843 2004-05-20 Martin Baulig <martin@ximian.com>
10845 * attribute.cs: Convert this file to Unix mode - like the original
10848 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10850 Fix bug #58688 (MCS does not report error when the same attribute
10853 * attribute.cs (Attribute.Emit): Distinction between null and default.
10855 2004-05-19 Raja R Harinath <rharinath@novell.com>
10857 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10858 of a top-level attribute without an attribute target.
10859 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10861 (Attribute.Conditional_GetConditionName),
10862 (Attribute.Obsolete_GetObsoleteMessage): Update.
10863 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10864 part of ScanForIndexerName.
10865 (Attribute.CanIgnoreInvalidAttribute): New function.
10866 (Attribute.ScanForIndexerName): Move to ...
10867 (Attributes.ScanForIndexerName): ... here.
10868 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10869 (Attributes.Search): New internal variant that can choose not to
10870 complain if types aren't resolved. The original signature now
10872 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10873 complaints suppressed.
10874 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10875 only if it not useful.
10876 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10877 top-level for attributes that are shared between the assembly
10878 and a top-level class.
10879 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10880 * class.cs: Update to reflect changes.
10881 (DefineIndexers): Fuse loops.
10882 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10883 a couple more variants of attribute names.
10885 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10887 Fix bug #52585 (Implemented explicit attribute declaration)
10890 (Attributable.ValidAttributeTargets): New abstract method. It gets
10891 list of valid attribute targets for explicit target declaration.
10892 (Attribute.Target): It holds target itself.
10893 (AttributeSection): Removed.
10894 (Attribute.CheckTargets): New method. It checks whether attribute
10895 target is valid for the current element.
10898 (EventProperty): New class. For events that are declared like
10899 property (with add and remove accessors).
10900 (EventField): New class. For events that are declared like field.
10903 * cs-parser.jay: Implemented explicit attribute target declaration.
10905 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10906 Override ValidAttributeTargets.
10909 (ReturnParameter): Class for applying custom attributes on
10911 (ParameterAtribute): New class. Class for applying custom
10912 attributes on the parameter type.
10914 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10916 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10919 (Method): Allow UNSAFE here.
10921 * modifiers.cs: Support unsafe reporting.
10923 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10925 * decl.cs: Fix bug #58478.
10927 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10929 * statement.cs: When checking for unreachable code on an EmptyStatement,
10930 set the location. Fixes bug #58488.
10932 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10934 * driver.cs: Add -pkg handling.
10936 From Gonzalo: UseShelLExecute=false
10938 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10941 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10943 (Attribute.IsClsCompliaceRequired): Moved to base for better
10945 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10946 when attribute is AttributeUsageAttribute.
10947 (Attribute.GetValidTargets): Simplified.
10948 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10949 attribute for this type.
10950 (Attribute.ApplyAttributes): Method renamed to Emit and make
10952 (GlobalAttributeSection): New class for special handling of global
10953 attributes (assembly, module).
10954 (AttributeSection.Emit): New method.
10956 * class.cs: Implemented Attributable abstract methods.
10957 (MethodCore.LabelParameters): Moved to Parameter class.
10958 (Accessor): Is back simple class.
10959 (PropertyMethod): Implemented Attributable abstract class.
10960 (DelegateMethod): Implemented Attributable abstract class.
10961 (Event): New constructor for disctintion between normal Event
10962 and Event with accessors.
10964 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10966 * codegen.cs, const.cs, decl.cs, delegate.cs:
10967 (CommonAssemblyModulClass): Implemented Attributable abstract class
10970 * enum.cs: Implement IAttributeSupport interface.
10971 (EnumMember): New class for emum members. Implemented Attributable
10975 (ParameterBase): Is abstract.
10976 (ReturnParameter): New class for easier [return:] attribute handling.
10978 * typemanager.cs: Removed builder_to_attr.
10980 2004-05-11 Raja R Harinath <rharinath@novell.com>
10983 * attribute.cs (Attribute.GetPositionalValue): New function.
10984 * class.cs (TypeContainer.VerifyMembers): New function.
10985 (TypeContainer.Emit): Use it.
10986 (ClassOrStruct): New base class for Class and Struct.
10987 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10988 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10990 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10991 then each non-static field should have a FieldOffset attribute.
10992 Otherwise, none of the fields should have a FieldOffset attribute.
10993 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10994 and FieldOffset attributes.
10995 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10996 (TypeManager.field_offset_attribute_type): New core types.
10997 (TypeManager.InitCoreTypes): Initialize them.
10999 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11001 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11002 Return correct type.
11005 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11007 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11008 be implicitly converted to ulong.
11010 * expression.cs: The logic for allowing operator &, | and ^ worked
11011 was wrong, it worked before because we did not report an error in
11012 an else branch. Fixes 57895.
11014 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11015 allow volatile fields to be reference types.
11017 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11019 * driver.cs: Add support for /debug-
11021 2004-05-07 Raja R Harinath <rharinath@novell.com>
11023 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11024 Add a 'complain' parameter to silence errors.
11025 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11026 silently overlooked type-resolutions.
11027 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11028 to reflect changes.
11029 (Attributes.Search): New function.
11030 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11031 (Attributes.GetAttributeFullName): Remove hack.
11032 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11033 Update to reflect changes.
11034 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11035 Use Attributes.Search instead of nested loops.
11037 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11040 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11041 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11042 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11044 * report.cs: (Report.Warning): Renamed to Warning_T because of
11045 parameter collision.
11047 2004-05-05 Raja R Harinath <rharinath@novell.com>
11049 * expression.cs (MemberAccess.ResolveMemberAccess):
11050 Exit with non-zero status after Report.Error.
11051 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11053 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11055 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11057 * support.cs: Don't hang when the file is empty.
11059 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11061 * support.cs: In SeekableStreamReader, compute the preamble size of the
11062 underlying stream. Position changes should take into account that initial
11065 2004-05-03 Todd Berman <tberman@sevenl.net>
11067 * driver.cs: remove unused GetSysVersion function.
11069 2004-05-03 Todd Berman <tberman@sevenl.net>
11071 * driver.cs: Remove the hack from saturday, as well as the hack
11072 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11073 link_paths to get that bit proper.
11075 2004-05-01 Todd Berman <tberman@sevenl.net>
11077 * driver.cs: Try a LoadFrom before a Load, this checks the current
11078 path. This is currently a bug in mono that is be fixed, however, this
11079 provides a workaround for now. This will be removed when the bug
11082 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11084 * CryptoConvert.cs: Updated to latest version. Fix issue with
11085 incomplete key pairs (#57941).
11087 2004-05-01 Todd Berman <tberman@sevenl.net>
11089 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11092 2004-04-30 Jackson Harper <jackson@ximian.com>
11094 * codegen.cs: Open keys readonly.
11096 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11098 * typemanager.cs: don't report cyclic struct layout when a struct
11099 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11100 which has 2 Pango.Rectangle fields.
11102 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11104 * expression.cs: Handle IntPtr comparisons with IL code
11105 rather than a method call.
11107 2004-04-29 Martin Baulig <martin@ximian.com>
11109 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11110 the list of PropertyInfo's in class hierarchy and find the
11111 accessor. Fixes #56013.
11113 2004-04-29 Martin Baulig <martin@ximian.com>
11115 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11117 2004-04-29 Martin Baulig <martin@ximian.com>
11119 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11121 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11123 2004-04-29 Martin Baulig <martin@ximian.com>
11125 * class.cs (ConstructorInitializer.Resolve): Check whether the
11126 parent .ctor is accessible. Fixes #52146.
11128 2004-04-29 Martin Baulig <martin@ximian.com>
11130 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11132 * statement.cs (Using.EmitLocalVariableDecls): Use
11133 TypeManager.idisposable_type, not typeof (IDisposable).
11134 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11136 2004-04-29 Martin Baulig <martin@ximian.com>
11138 * class.cs (Event.Define): Don't emit the field and don't set
11139 RTSpecialName and SpecialName for events on interfaces. Fixes
11142 2004-04-29 Raja R Harinath <rharinath@novell.com>
11144 Refactor Attribute.ApplyAttributes.
11145 * attribute.cs (Attributable): New base class for objects that can
11146 have Attributes applied on them.
11147 (Attribute): Make AttributeUsage fields public.
11148 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11149 (Attribute.IsInternalCall): New property.
11150 (Attribute.UsageAttr): Convert to a public read-only property.
11151 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11152 (Attribute.ResolveType, Attribute.Resolve)
11153 (Attribute.ScanForIndexerName): Update to reflect changes.
11154 (Attribute.CheckAttributeTarget): Re-format.
11155 (Attribute.ApplyAttributes): Refactor, to various
11156 Attributable.ApplyAttributeBuilder methods.
11157 * decl.cs (MemberCore): Make Attributable.
11158 * class.cs (Accessor): Make Attributable.
11159 (MethodData.ApplyAttributes): Use proper attribute types, not
11161 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11162 (TypeContainer.ApplyAttributeBuilder)
11163 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11164 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11165 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11166 (Operator.ApplyAttributeBuilder): New factored-out methods.
11167 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11168 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11169 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11170 * parameter.cs (ParameterBase): New Attributable base class
11171 that can also represent Return types.
11172 (Parameter): Update to the changes.
11174 2004-04-29 Jackson Harper <jackson@ximian.com>
11176 * driver.cs: Prefer the corlib system version when looking for
11177 assemblies in the GAC. This is still a hack, but its a better hack
11180 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11182 * decl.cs, enum.cs: Improved error 3005 reporting.
11184 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11185 (related_symbols): New private member for list of symbols
11186 related to reported error/warning.
11188 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11190 2004-04-29 Martin Baulig <martin@ximian.com>
11192 * ecore.cs (Expression.Constantify): If we're an enum and
11193 TypeManager.TypeToCoreType() doesn't give us another type, use
11194 t.UnderlyingSystemType. Fixes #56178.
11196 2004-04-29 Martin Baulig <martin@ximian.com>
11198 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11199 interfaces and for each interface, only add members directly
11200 declared in that interface. Fixes #53255.
11202 2004-04-28 Martin Baulig <martin@ximian.com>
11204 * expression.cs (ConditionalLogicalOperator): Use a temporary
11205 variable for `left' to avoid that we evaluate it more than once;
11208 2004-04-28 Martin Baulig <martin@ximian.com>
11210 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11213 2004-04-28 Martin Baulig <martin@ximian.com>
11215 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11218 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11219 whether the type is not void (CS1547).
11221 2004-04-28 Martin Baulig <martin@ximian.com>
11223 * expression.cs (Unary.DoResolveLValue): Override this and report
11224 CS0131 for anything but Operator.Indirection.
11226 2004-04-28 Martin Baulig <martin@ximian.com>
11228 Committing a patch from Ben Maurer; see bug #50820.
11230 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11233 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11236 2004-04-28 Martin Baulig <martin@ximian.com>
11238 Committing a patch from Ben Maurer; see bug #50820.
11240 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11243 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11246 2004-04-28 Martin Baulig <martin@ximian.com>
11248 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11249 (Block.AddLabel): Call DoLookupLabel() to only search in the
11252 2004-04-28 Martin Baulig <martin@ximian.com>
11254 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11255 comparing StringConstants and NullLiterals in Equality and Inequality.
11257 2004-04-28 Jackson Harper <jackson@ximian.com>
11259 * driver.cs: Attempt to load referenced assemblies from the
11260 GAC. This is the quick and dirty version of this method that
11261 doesnt take into account versions and just takes the first
11262 canidate found. Will be good enough for now as we will not have more
11263 then one version installed into the GAC until I update this method.
11265 2004-04-28 Martin Baulig <martin@ximian.com>
11267 * typemanager.cs (TypeManager.CheckStructCycles): New public
11268 static method to check for cycles in the struct layout.
11270 * rootcontext.cs (RootContext.PopulateTypes): Call
11271 TypeManager.CheckStructCycles() for each TypeContainer.
11272 [Note: We only need to visit each type once.]
11274 2004-04-28 Martin Baulig <martin@ximian.com>
11276 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11278 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11279 success and added `out object value'. Use a `bool resolved' field
11280 to check whether we've already been called rather than
11281 `ConstantValue != null' since this breaks for NullLiterals.
11283 2004-04-28 Raja R Harinath <rharinath@novell.com>
11285 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11286 setting of this flag, since the 'set' method may be non-public.
11288 2004-04-28 Raja R Harinath <rharinath@novell.com>
11290 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11291 check on current_vector.Block.
11293 2004-04-27 Martin Baulig <martin@ximian.com>
11295 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11296 a field initializer. Fixes #56459.
11298 2004-04-27 Martin Baulig <martin@ximian.com>
11300 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11301 we're not attempting to use an indexer. Fixes #52154.
11303 2004-04-27 Martin Baulig <martin@ximian.com>
11305 * statement.cs (Return): Don't create a return label if we don't
11306 need it; reverts my change from January 20th. Thanks to Ben
11309 2004-04-27 Martin Baulig <martin@ximian.com>
11311 According to the spec, `goto' can only leave a nested scope, but
11314 * statement.cs (Block.LookupLabel): Only lookup in the current
11315 block, don't recurse into parent or child blocks.
11316 (Block.AddLabel): Check in parent and child blocks, report
11317 CS0140/CS0158 if we find a duplicate.
11318 (Block): Removed this indexer for label lookups.
11319 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11320 this already does the error reporting for us.
11323 (FlowBranching.UsageVector.Block): New public variable; may be null.
11324 (FlowBranching.CreateSibling): Added `Block' argument.
11325 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11326 label for the target of a `goto' and check whether we're not
11327 leaving a `finally'.
11329 2004-04-27 Martin Baulig <martin@ximian.com>
11331 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11332 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11335 2004-04-27 Martin Baulig <martin@ximian.com>
11337 * statement.cs (Block.AddLabel): Also check for implicit blocks
11338 and added a CS0158 check.
11340 2004-04-27 Martin Baulig <martin@ximian.com>
11342 * flowanalysis.cs (FlowBranchingLoop): New class.
11343 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11344 UsageVector's instead of an ArrayList.
11345 (FlowBranching.Label): Likewise.
11346 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11347 (FlowBranching.AddBreakVector): New method.
11349 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11351 * attribute.cs: Small regression fix: only convert the type if we
11352 the type is different, fixes System.Drawing build.
11354 2004-04-27 Martin Baulig <martin@ximian.com>
11356 * attribute.cs (Attribute.Resolve): If we have a constant value
11357 for a named field or property, implicity convert it to the correct
11360 2004-04-27 Raja R Harinath <rharinath@novell.com>
11362 * statement.cs (Block.Block): Implicit blocks share
11363 'child_variable_names' fields with parent blocks.
11364 (Block.AddChildVariableNames): Remove.
11365 (Block.AddVariable): Mark variable as "used by a child block" in
11366 every surrounding block.
11367 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11368 been used in a child block, complain about violation of "Invariant
11369 meaning in blocks" rule.
11370 * cs-parser.jay (declare_local_variables): Don't use
11371 AddChildVariableNames.
11372 (foreach_statement): Don't create an implicit block: 'foreach'
11373 introduces a scope.
11375 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11377 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11378 converting from 0L to ulong. Fixes 57522.
11380 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11382 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11383 derived class hides via 'new' keyword field from base class (test-242.cs).
11384 TODO: Handle this in the more general way.
11386 * class.cs (CheckBase): Ditto.
11388 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11390 * decl.cs (caching_flags): New member for storing cached values
11392 (MemberCore.Flags): New enum where bit flags for caching_flags
11394 (MemberCore.cls_compliance): Moved to caching_flags.
11395 (DeclSpace.Created): Moved to caching_flags.
11397 * class.cs: Use caching_flags instead of DeclSpace.Created
11399 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11401 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11402 if we are only a derived class, not a nested class.
11404 * typemanager.cs: Same as above, but do this at the MemberLookup
11405 level (used by field and methods, properties are handled in
11406 PropertyExpr). Allow for the qualified access if we are a nested
11409 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11411 * class.cs: Refactoring.
11412 (IMethodData): New inteface; Holds links to parent members
11413 to avoid member duplication (reduced memory allocation).
11414 (Method): Implemented IMethodData interface.
11415 (PropertyBase): New inner classes for get/set methods.
11416 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11417 (Event): New inner classes for add/remove methods.
11418 (Event.DelegateMethod): Implemented IMethodData interface.
11420 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11421 EmitContext (related to class.cs refactoring).
11423 2004-04-21 Raja R Harinath <rharinath@novell.com>
11425 * delegate.cs (Delegate.VerifyApplicability): If the number of
11426 arguments are the same as the number of parameters, first try to
11427 verify applicability ignoring any 'params' modifier on the last
11431 2004-04-08 Martin Baulig <martin@ximian.com>
11433 Merged latest changes into gmcs. Please keep this comment in
11434 here, it makes it easier for me to see what changed in MCS since
11435 the last time I merged.
11437 2004-04-16 Raja R Harinath <rharinath@novell.com>
11439 * class.cs (TypeContainer.AddIndexer): Use
11440 'ExplicitInterfaceName' to determine if interface name was
11441 explicitly specified. 'InterfaceType' is not initialized at this time.
11442 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11443 Indexers array is already in the required order. Initialize
11444 'IndexerName' only if there are normal indexers.
11445 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11446 (TypeContainer.Emit): Emit DefaultMember attribute only if
11447 IndexerName is initialized.
11450 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11452 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11455 2004-04-15 Raja R Harinath <rharinath@novell.com>
11457 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11461 * attribute.cs (Attribute.Resolve): Check for duplicate named
11465 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11467 * iterators.cs (MarkYield): track whether we are in an exception,
11468 and generate code accordingly. Use a temporary value to store the
11469 result for our state.
11471 I had ignored a bit the interaction of try/catch with iterators
11472 since their behavior was not entirely obvious, but now it is
11473 possible to verify that our behavior is the same as MS .NET 2.0
11477 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11479 * iterators.cs: Avoid creating temporaries if there is no work to
11482 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11483 Enumerations, use TypeManager.EnumToUnderlying and call
11486 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11489 (This.Emit): Use EmitContext.EmitThis to emit our
11492 (This.EmitAssign): Ditto.
11494 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11495 codepaths, we will move all the functionality into
11498 (FieldExpr.EmitAssign): Ditto.
11500 This fixes several hidden bugs that I uncovered while doing a code
11501 review of this today.
11503 * codegen.cs (EmitThis): reworked so the semantics are more clear
11504 and also support value types "this" instances.
11506 * iterators.cs: Changed so that for iterators in value types, we
11507 do not pass the value type as a parameter.
11509 Initialization of the enumerator helpers is now done in the caller
11510 instead of passing the parameters to the constructors and having
11511 the constructor set the fields.
11513 The fields have now `assembly' visibility instead of private.
11515 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11517 * expression.cs (Argument.Resolve): Check if fields passed as ref
11518 or out are contained in a MarshalByRefObject.
11520 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11521 another compiler type.
11523 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11525 * class.cs (Indexer.Define): use the new name checking method.
11526 Also, return false on an error.
11527 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11528 (is_identifier_[start/part]_character): make static.
11530 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11532 * expression.cs (Binary.ResolveOperator): Do no append strings
11533 twice: since we can be invoked more than once (array evaluation)
11534 on the same concatenation, take care of this here. Based on a fix
11535 from Ben (bug #56454)
11537 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11539 * codegen.cs: Fix another case where CS1548 must be reported (when
11540 delay-sign isn't specified and no private is available #56564). Fix
11541 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11542 error when MCS is used on the MS runtime and we need to delay-sign
11543 (which seems unsupported by AssemblyBuilder - see #56621).
11545 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11547 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11548 (TypeManager.ComputeNamespaces): Faster implementation for
11551 * compiler.csproj: Updated AssemblyName to mcs.
11553 2004-05-11 Jackson Harper <jackson@ximian.com>
11555 * Makefile: Preserve MONO_PATH
11557 2004-05-11 Jackson Harper <jackson@ximian.com>
11559 * Makefile: Use mono and mcs to build gmcs
11561 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11563 * codegen.cs: Add patch from Robert Shade
11564 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11567 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11569 * CryptoConvert.cs: Updated to latest version. Fix issue with
11570 incomplete key pairs (#57941).
11572 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11574 * codegen.cs: Fix another case where CS1548 must be reported (when
11575 delay-sign isn't specified and no private is available #56564). Fix
11576 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11577 error when MCS is used on the MS runtime and we need to delay-sign
11578 (which seems unsupported by AssemblyBuilder - see #56621).
11580 2004-04-29 Jackson Harper <jackson@ximian.com>
11582 * Makefile: Set MONO_PATH to use the bootstrap corlib
11583 * driver.cs: Check the GAC for referenced assemblies.
11585 2004-04-29 Martin Baulig <martin@ximian.com>
11587 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11589 2004-04-07 Martin Baulig <martin@ximian.com>
11591 * expression.cs (Binary.ResolveOperator): Added special case for
11592 Equality/Inequality between a type parameter and a null literal.
11594 2004-04-07 Martin Baulig <martin@ximian.com>
11596 * convert.cs: Check null literal -> type parameter conversions.
11598 2004-04-07 Martin Baulig <martin@ximian.com>
11600 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11601 `class' and `struct' constraints.
11603 2004-04-07 Martin Baulig <martin@ximian.com>
11605 * generic.cs (SpecialConstraint): New public enum.
11606 (Constraints.Resolve): Added support for the `class' and `struct'
11609 * cs-parser.jay (type_parameter_constraint): Added support for the
11610 `class' and `struct' constraints.
11612 2004-04-07 Martin Baulig <martin@ximian.com>
11614 * support.cs (GenericConstraints): Replaced `Types' by
11615 `ClassConstraint' and `InterfaceConstraints'; added
11616 `HasClassConstraint'.
11618 2004-04-07 Martin Baulig <martin@ximian.com>
11621 (Constraints.InterfaceConstraints): New public property.
11622 (Constraints.Types): Make this property public
11623 (TypeParameter): Implement IMemberContainer.
11624 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11625 instead of a TypeBuilder/MethodBuilder; pass the interface
11626 constraints to TypeManager.AddTypeParameter().
11627 (TypeParameter.DefineType): Just take an EmitContext and no
11628 TypeBuilder/MethodBuilder. Use the new public API.
11630 * typemanager.cs (TypeManager.AddTypeParameter): Added
11631 `TypeExpr[]' argument; add the interfaces to the
11632 `builder_to_ifaces' hash.
11633 (TypeManager.LookupMemberContainer): For
11634 GenericTypeParameterBuilders, get the TypeParameter from the
11635 `builder_to_type_param'.
11636 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11637 the TypeParameter and call FindMembers on it.
11639 2004-04-07 Martin Baulig <martin@ximian.com>
11642 (MethodCore.GenericMethod): Moved this field here from Method.
11643 (MethodCore.IsDuplicateImplementation): Take the number of type
11644 parameters into account if we're a generic method.
11646 * expression.cs (Invocation.InferTypeArguments): Don't return true
11647 if `arguments' is null; we still need to check whether we actually
11648 don't need to infer anything in this case.
11649 (MemberAccess): Merged the functionality from GenericMemberAccess
11652 * generic.cs (GenericMemberAccess): Removed.
11654 2004-04-05 Martin Baulig <martin@ximian.com>
11656 * decl.cs (MemberCore): For generic classes, interfaces and
11657 structs, `Name' now includes the number of type parameters
11658 ("Stack!1.Node!1").
11659 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11660 encode the number of type arguments in the type name.
11662 * expression.cs (Expression.MemberLookup): Removed the
11663 `num_type_args' argument; we now encode the number of type
11664 arguments in the type name.
11666 * ecore.cs (SimpleName): Encode the number of type arguments in
11667 the type name itself.
11669 * generic.cs (ConstructedType): Likewise.
11671 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11672 `MemberName'; we now include the number of type parameters in the
11675 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11676 (TypeManager.MemberLookup): Removed the
11677 `num_type_args' argument; we now encode the number of type
11678 arguments in the type name.
11680 2004-04-03 Martin Baulig <martin@ximian.com>
11682 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11683 (MemberCore.MemberName): Moved here from MemberBase.
11684 (DeclSpace.SetParameterInfo): Just take the constraints as an
11685 ArrayList; we already have the type parameters in our
11686 `MemberName'; also do the CS0080 reporting here.
11688 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11689 `IDENTIFIER opt_type_parameter_list'; when constructing our
11690 `MemberName', it'll already include our type parameters.
11691 (class_declaration, interface_declaration): Likewise.
11692 (delegate_declaration): Likewise.
11693 (MakeName): Take a MemberName and return a MemberName.
11694 The following two changes are required to avoid shift/reduce conflicts:
11695 (member_name): Don't include a TypeName anymore; ie. this is now
11696 just 'IDENTIFIER opt_type_parameter_list'.
11697 (property_declaration, event_declaration): Use a
11698 `namespace_or_type_name' instead of a `member_name'.
11700 2004-04-03 Martin Baulig <martin@ximian.com>
11702 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11703 `MemberName' class.
11704 (TypeName): Formerly known as MemberName.
11706 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11707 instead of a `MemberName'.
11709 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11710 (member_name): New rule; create a MemberName.
11712 2004-04-02 Martin Baulig <martin@ximian.com>
11714 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11715 (CS0305 and CS0308).
11717 2004-04-02 Martin Baulig <martin@ximian.com>
11719 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11720 support for nested types.
11722 2004-04-02 Martin Baulig <martin@ximian.com>
11724 * ecore.cs (IAlias): New public interface.
11725 (TypeExpr, TypeExpression): Implement IAlias.
11726 (TypeAliasExpression): New public class.
11728 * namespace.cs (Namespace): Implement IAlias.
11729 (Namespace.Lookup): Return an IAlias instead on an object.
11730 (Namespace.DefineName): Take an IAlias instead of an object.
11731 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11733 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11735 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11737 (NamespaceEntry.Lookup): Likewise.
11739 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11742 * decl.cs (DeclSpace): Implement IAlias.
11743 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11745 * generic.cs (ConstructedType): Improved error checking.
11747 2004-04-02 Martin Baulig <martin@ximian.com>
11749 * convert.cs: Added type parameter conversions.
11752 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11753 (ClassCast.Emit): If the source type is a type parameter, box it.
11754 If the target type is a type parameter, emit an `unbox.any'
11755 instead of a `classcast'.1
11757 2004-04-01 Martin Baulig <martin@ximian.com>
11759 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11761 2004-04-01 Martin Baulig <martin@ximian.com>
11763 * generic.cs (ConstructedType.CheckConstraints): Use
11764 Convert.ImplicitStandardConversionExists(); user-defined implicit
11765 conversions are not allowed according to the spec.
11767 2004-03-30 Martin Baulig <martin@ximian.com>
11769 * expression.cs (New): Added support for type parameters.
11772 (TypeManager.activator_type): New public static field.
11773 (TypeManager.activator_create_instance): Likewise.
11775 2004-03-30 Martin Baulig <martin@ximian.com>
11777 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11780 2004-03-30 Martin Baulig <martin@ximian.com>
11782 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11783 the spec here: the argument type must be convertible to the
11786 2004-03-30 Martin Baulig <martin@ximian.com>
11789 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11790 TypeManager.AddTypeParameter().
11791 (ConstructedType.CheckConstraints): Re-enable this and actually
11792 check whether we have a constructor constraint.
11795 (TypeManager.builder_to_type_param): New static field.
11796 (TypeManager.AddTypeParameter): New static method.
11797 (TypeManager.LookupTypeParameter): New public method.
11799 2004-03-30 Martin Baulig <martin@ximian.com>
11801 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11802 the new API to actually define the constructor constraint.
11805 (TypeManager.new_constraint_attr_type): New static field.
11806 (TypeManager.InitCoreTypes): Initialize it.
11808 2004-03-30 Martin Baulig <martin@ximian.com>
11810 * generic.cs (Constraints): Completed error checking, use correct
11813 2004-03-29 Martin Baulig <martin@ximian.com>
11815 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11817 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11818 public version which takes a `ParameterData pd' instead of an
11821 2004-03-29 Martin Baulig <martin@ximian.com>
11823 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11826 2004-03-29 Martin Baulig <martin@ximian.com>
11828 * expression.cs (Argument.ResolveMethodGroup): If we're a
11829 ConstructedType, call GetMemberAccess() on it.
11831 2004-03-29 Martin Baulig <martin@ximian.com>
11833 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11834 (MethodCore.CheckGenericOverride): When overriding a generic
11835 method, check whether the constraints match.
11837 * support.cs (GenericConstraints): New public interface.
11838 (ParameterData.GenericConstraints): New public method.
11840 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11841 method parameter and compute our constraints if appropriate.
11842 (Parameter.GenericConstraints): New public property.
11844 * generic.cs (Constraints): Implement GenericConstraints.
11846 2004-03-29 Martin Baulig <martin@ximian.com>
11848 * decl.cs (MemberCache.FindMemberToOverride): Use
11849 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11851 2004-03-29 Martin Baulig <martin@ximian.com>
11853 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11855 2004-03-29 Martin Baulig <martin@ximian.com>
11857 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11858 not allowed on non-generic declarations").
11860 2004-03-29 Martin Baulig <martin@ximian.com>
11862 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11863 public version of this method.
11865 * class.cs (MethodCore.IsDuplicateImplementation): Use
11866 Invocation.InferTypeArguments() to check this.
11868 2004-03-29 Martin Baulig <martin@ximian.com>
11870 * convert.cs: Use TypeManager.IsDelegateType() instead of
11871 comparing types correctly.
11873 2004-03-29 Martin Baulig <martin@ximian.com>
11875 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11876 types directly to make it work for generic instances.
11878 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11880 2004-03-29 Martin Baulig <martin@ximian.com>
11882 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11883 support for arrays.
11885 2004-03-24 Martin Baulig <martin@ximian.com>
11887 * decl.cs (DeclSpace.FindType): Also use
11888 TypeManager.CheckGeneric() for types from the using clauses.
11890 2004-03-23 Martin Baulig <martin@ximian.com>
11892 * expression.cs (Invocation.OverloadResolve): Added `bool
11893 may_fail' argument and use it instead of the Location.IsNull() hack.
11895 2004-03-23 Martin Baulig <martin@ximian.com>
11897 * expression.cs (Invocation.InferType): Use correct type inference
11900 2004-03-23 Martin Baulig <martin@ximian.com>
11902 * ecore.cs (MethodGroupExpr.Name): Use
11903 TypeManager.CSharpSignature() instead of just the name.
11905 * expression.cs (Invocation.OverloadResolve): Provide better error
11907 (Invocation.DoResolve): OverloadResolve() never returns null
11908 without reporting an error, so removed the error -6 reporting here.
11910 2004-03-23 Martin Baulig <martin@ximian.com>
11912 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11915 * cs-parser.jay (delegate_declaration): Support generic delegates.
11917 * delegate.cs: Support generic delegates.
11919 2004-03-22 Martin Baulig <martin@ximian.com>
11921 * expression.cs (Invocation.InferParamsTypeArguments): New static
11922 method; does type inference for params arguments.
11924 2004-03-21 Martin Baulig <martin@ximian.com>
11926 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11927 method; checks whether a method is a generic method.
11929 * expression.cs (Invocation.InferTypeArguments): New static method;
11930 infer type arguments for generic method invocation.
11932 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11933 property; we set this to true if we're resolving a generic method
11934 invocation and the user specified type arguments, ie. we're not
11935 doing type inference.
11937 2004-03-20 Martin Baulig <martin@ximian.com>
11939 * class.cs (MethodData.DeclaringType): New public property.
11940 (MethodData.Define): Set DeclaringType here.
11941 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11942 instead of OperatorMethodBuilder.DeclaringType.
11944 2004-03-20 Martin Baulig <martin@ximian.com>
11946 * cs-tokenizer.cs (xtoken): Return a special
11947 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11949 * cs-parser.jay (default_value_expression): Switch to the new
11952 2004-03-19 Martin Baulig <martin@ximian.com>
11954 * decl.cs (MemberName): New class. We use this to "construct"
11955 namespace_or_type_name's.
11957 * generics.cs (TypeArguments.GetDeclarations): New public method;
11958 returns the type arguments as a string[] and reports a CS0081 if
11959 one of them is not an identifier.
11961 * class.cs (MemberBase): The .ctor now takes the name as a
11962 MemberName instead of a string.
11963 (MemberBase.ExplicitInterfaceName): Changed type from string to
11965 (MemberBase.DoDefine): If we're an explicit implementation, the
11966 InterfaceType may be a generic instance.
11968 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11969 (namespace_name): Call MemberName.GetName () to transform the
11970 MemberName into a string and ensure we don't have any type
11972 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11973 MemberName into an expression.
11974 (method_header): Use namespace_or_type_name instead of member_name.
11976 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11978 * rootcontext.cs: Add new types to the boot resolution.
11980 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11981 MulticastDelegate is not allowed.
11983 * typemanager.cs: Add new types to lookup: System.TypedReference
11986 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11987 check for TypedReference or ArgIterator, they are not allowed.
11989 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11990 makes us properly catch 1510 in some conditions (see bug 56016 for
11993 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11995 * CryptoConvert.cs: update from corlib version
11998 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12000 * class.cs (Indexer.Define): Check indexername declaration
12002 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12004 * attribute.cs (IsClsCompliant): Fixed problem with handling
12005 all three states (compliant, not-compliant, undetected).
12007 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12009 * attribute.cs (Attribute): Location is now public.
12010 (Resolve): Store resolved arguments (pos_values) in attribute class.
12011 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12012 (GetClsCompliantAttributeValue): New method that gets
12013 CLSCompliantAttribute value.
12014 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12015 if exists else null.
12016 (AttributeTester): New class for CLS-Compliant verification routines.
12018 * class.cs (Emit): Add CLS-Compliant verification.
12019 (Method.GetSignatureForError): Implemented.
12020 (Constructor.GetSignatureForError): Implemented
12021 (Constructor.HasCompliantArgs): Returns if constructor has
12022 CLS-Compliant arguments.
12023 (Constructor.Emit): Override.
12024 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12025 is needed to test only parameters.
12026 (FieldBase.GetSignatureForError): Implemented.
12027 (TypeContainer): New member for storing base interfaces.
12028 (TypeContainer.FindMembers): Search in base interfaces too.
12030 * codegen.cs (GetClsComplianceAttribute): New method that gets
12031 assembly or module CLSCompliantAttribute value.
12032 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12034 (ModuleClass.Emit): Add error 3012 test.
12036 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12038 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12039 state for all decl types.
12040 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12041 if CLS-Compliant tests are required.
12042 (IsClsCompliaceRequired): New method. Analyze whether code
12043 must be CLS-Compliant.
12044 (IsExposedFromAssembly): New method. Returns true when MemberCore
12045 is exposed from assembly.
12046 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12047 value or gets cached value.
12048 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12049 is explicitly marked with CLSCompliantAttribute.
12050 (IsIdentifierClsCompliant): New abstract method. This method is
12051 used to testing error 3005.
12052 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12053 for identifier and parameters CLS-Compliant testing.
12054 (VerifyClsCompliance): New method. The main virtual method for
12055 CLS-Compliant verifications.
12056 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12057 null. I don't know why is null (too many public members !).
12058 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12059 and get value of first CLSCompliantAttribute that found.
12061 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12062 (VerifyClsCompliance): Override and add extra tests.
12064 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12065 clscheck- disable CLS-Compliant verification event if assembly is has
12066 CLSCompliantAttribute(true).
12068 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12069 ApllyAttribute is now called in emit section as in the other cases.
12070 Possible future Emit integration.
12071 (IsIdentifierClsCompliant): New override.
12072 (VerifyClsCompliance): New override.
12073 (GetEnumeratorName): Returns full enum name.
12075 * parameter.cs (GetSignatureForError): Implemented.
12077 * report.cs (WarningData): New struct for Warning message information.
12078 (LocationOfPreviousError): New method.
12079 (Warning): New method. Reports warning based on the warning table.
12080 (Error_T): New method. Reports error based on the error table.
12082 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12083 verifications are done here.
12085 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12087 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12088 CLSCompliantAttribute.
12089 (all_imported_types): New member holds all imported types from other
12091 (LoadAllImportedTypes): New method fills static table with exported types
12092 from all referenced assemblies.
12093 (Modules): New property returns all assembly modules.
12095 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12097 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12098 throwing a parser error.
12100 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12101 which removes the hardcoded get_/set_ prefixes for properties, as
12102 IL allows for the properties to be named something else.
12106 * expression.cs: Do not override operand before we know if it is
12107 non-null. Fix 56207
12109 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12111 * typemanager.cs: support for pinned variables.
12113 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12115 * decl.cs, typemanager.cs: Avoid using an arraylist
12116 as a buffer if there is only one result set.
12118 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12120 * expression.cs: Make sure you cant call a static method
12121 with an instance expression, bug #56174.
12123 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12125 * class.cs (IsDuplicateImplementation): Improve error reporting to
12126 flag 663 (method only differs in parameter modifier).
12128 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12129 in preprocessor directives.
12131 * location.cs (LookupFile): Allow for the empty path.
12133 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12134 better approach for some of that patch, but its failing with the
12135 CharSet enumeration. For now try/catch will do.
12137 * typemanager.cs: Do not crash if a struct does not have fields.
12140 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12142 * expression.cs: cs0213, cant fix a fixed expression.
12145 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12147 * cs-parser.jay: detect invalid embeded statements gracefully.
12150 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12152 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12155 the invocation type may not be a subclass of the tye of the item/
12156 The type of the item must be a subclass of the invocation item.
12161 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12163 * attribute.cs: Added methods to get a string and a bool from an
12164 attribute. Required to information from AssemblyKeyFileAttribute,
12165 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12166 * codegen.cs: Modified AssemblyName creation to include support for
12167 strongnames. Catch additional exceptions to report them as CS1548.
12168 * compiler.csproj: Updated include CryptoConvert.cs.
12169 * compiler.csproj.user: Removed file - user specific configuration.
12170 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12171 Mono.Security assembly. The original class is maintained and tested in
12172 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12173 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12174 like CSC 8.0 (C# v2) supports.
12175 * Makefile: Added CryptoConvert.cs to mcs sources.
12176 * rootcontext.cs: Added new options for strongnames.
12178 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12180 * driver.cs: For --expect-error, report error code `2'
12181 if the program compiled with no errors, error code `1' if
12182 it compiled with an error other than the one expected.
12184 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12186 * compiler.csproj: Updated for Visual Studio .NET 2003.
12187 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12188 * compiler.sln: Updated for Visual Studio .NET 2003.
12190 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12192 * expression.cs: Fix bug #47234. We basically need to apply the
12193 rule that we prefer the conversion of null to a reference type
12194 when faced with a conversion to 'object' (csc behaviour).
12196 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12198 * statement.cs: Shorter form for foreach, eliminates
12199 a local variable. r=Martin.
12201 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12203 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12204 checks if we can use brtrue/brfalse to test for 0.
12205 * expression.cs: use the above in the test for using brtrue/brfalse.
12206 cleanup code a bit.
12208 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12210 * expression.cs: Rewrite string concat stuff. Benefits:
12212 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12213 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12214 rather than a concat chain.
12216 * typemanager.cs: Add lookups for more concat overloads.
12218 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12220 * expression.cs: Emit shorter il code for array init.
12237 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12239 * statement.cs: Before, two switch blocks would be merged if the
12240 total size of the blocks (end_item - begin_item + 1) was less than
12241 two times the combined sizes of the blocks.
12243 Now, it will only merge if after the merge at least half of the
12248 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12250 * class.cs : csc build fix for GetMethods(). See bug #52503.
12252 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12254 * expression.cs: Make sure fp comparisons work with NaN.
12255 This fixes bug #54303. Mig approved this patch a long
12256 time ago, but we were not able to test b/c the runtime
12259 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12261 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12263 2004-03-19 Martin Baulig <martin@ximian.com>
12265 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12266 two overloads may unify for some type parameter substitutions and
12267 report a CS0408 if appropriate.
12269 2004-03-19 Martin Baulig <martin@ximian.com>
12271 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12272 error here and not in our caller.
12274 2004-03-19 Martin Baulig <martin@ximian.com>
12276 * interface.cs: Completely killed this file.
12277 (Interface): We're now a TypeContainer and live in class.cs.
12279 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12280 argument; we're now also called for interfaces.
12281 (TypeContainer.DefineMembers): Allow this method being called
12283 (TypeContainer.GetMethods): New public method; formerly known as
12284 Interface.GetMethod(). This is used by PendingImplementation.
12285 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12286 it's now private and non-static.
12287 (Interface): Moved this here; it's now implemented similar to
12289 (Method, Property, Event, Indexer): Added `bool is_interface'
12290 argument to their .ctor's.
12291 (MemberBase.IsInterface): New public field.
12293 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12294 instances instead of InterfaceMethod, InterfaceProperty, etc.
12295 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12296 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12298 2004-03-19 Martin Baulig <martin@ximian.com>
12300 * class.cs (MethodCore.IsDuplicateImplementation): New private
12301 method which does the CS0111 checking.
12302 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12303 Use IsDuplicateImplementation().
12305 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12307 * decl.cs (FindMemberToOverride): New method to find the correct
12308 method or property to override in the base class.
12310 - Make Method/Property use the above method to find the
12311 version in the base class.
12312 - Remove the InheritableMemberSignatureCompare as it is now
12315 This patch makes large code bases much faster to compile, as it is
12316 O(n) rather than O(n^2) to do this validation.
12318 Also, it fixes bug 52458 which is that nested classes are not
12319 taken into account when finding the base class member.
12321 Reviewed/Approved by Martin.
12323 2004-03-17 Martin Baulig <martin@ximian.com>
12325 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12326 of type arguments into account; use the `real_num_type_args'
12327 approach like in DoResolveAsTypeStep().
12329 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12332 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12334 * interface.cs: In all interface classes removed redundant
12335 member initialization.
12337 2004-03-16 Martin Baulig <martin@ximian.com>
12339 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12341 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12343 * decl.cs (DefineTypeAndParents): New helper method to define a
12344 type's containers before the type itself is defined; This is a
12345 bug exposed by the recent changes to Windows.Forms when an
12346 implemented interface was defined inside a class that had not been
12349 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12351 (Check): Loop correctly to report errors modifiers
12352 (UNSAFE was not in the loop, since it was the same as TOP).
12354 * interface.cs: Every interface member now takes a ModFlags,
12355 instead of a "is_new" bool, which we set on the base MemberCore.
12357 Every place where we called "UnsafeOk" in the interface, now we
12358 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12359 the unsafe settings from the member declaration instead of the
12360 container interface.
12362 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12364 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12365 `set_indexer_name' to the pending bits (one per type).
12367 We fixed a bug today that was picking the wrong method to
12368 override, since for properties the existing InterfaceMethod code
12369 basically ignored the method name. Now we make sure that the
12370 method name is one of the valid indexer names.
12372 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12374 * support.cs (SeekableStreamReader): Keep track of stream byte
12375 positions and don't mix them with character offsets to the buffer.
12377 Patch from Gustavo Giráldez
12379 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12381 * interface.cs (InterfaceSetGetBase): Removed double member
12382 initialization, base class does it as well.
12384 2004-03-13 Martin Baulig <martin@ximian.com>
12386 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12387 when compiling corlib.
12389 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12391 * convert.cs (ExplicitConversion): We were reporting an error on
12392 certain conversions (object_type source to a value type, when the
12393 expression was `null') before we had a chance to pass it through
12394 the user defined conversions.
12396 * driver.cs: Replace / and \ in resource specifications to dots.
12399 * class.cs: Add check for duplicate operators. Fixes 52477
12401 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12403 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12404 that are in the middle of the statements, not only at the end.
12407 * class.cs (TypeContainer.AddField): No longer set the
12408 `HaveStaticConstructor' flag, now we call it
12409 `UserDefineStaticConstructor' to diferentiate the slightly
12410 semantic difference.
12412 The situation is that we were not adding BeforeFieldInit (from
12413 Modifiers.TypeAttr) to classes that could have it.
12414 BeforeFieldInit should be set to classes that have no static
12419 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12421 And most importantly Zoltan's comment:
12423 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12425 "I think beforefieldinit means 'it's ok to initialize the type sometime
12426 before its static fields are used', i.e. initialization does not need
12427 to be triggered by the first access to the type. Setting this flag
12428 helps the JIT to compile better code, since it can run the static
12429 constructor at JIT time, and does not need to generate code to call it
12430 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12431 this flag for lots of classes like String.
12433 csc sets this flag if the type does not have an explicit static
12434 constructor. The reasoning seems to be that if there are only static
12435 initalizers for a type, and no static constructor, then the programmer
12436 does not care when this initialization happens, so beforefieldinit
12439 This bug prevents the AOT compiler from being usable, since it
12440 generates so many calls to mono_runtime_class_init that the AOT code
12441 is much slower than the JITted code. The JITted code is faster,
12442 because it does not generate these calls if the vtable is type is
12443 already initialized, which is true in the majority of cases. But the
12444 AOT compiler can't do this."
12446 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12448 * class.cs (MethodData.Emit): Refactor the code so symbolic
12449 information is generated for destructors; For some reasons we
12450 were taking a code path that did not generate symbolic information
12453 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12455 * class.cs: Create a Constructor.CheckBase method that
12456 takes care of all validation type code. The method
12457 contains some code that was moved from Define.
12459 It also includes new code that checks for duplicate ctors.
12460 This fixes bug #55148.
12462 2004-03-09 Joshua Tauberer <tauberer@for.net>
12464 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12465 a { ... }-style array creation invokes EmitStaticInitializers
12466 which is not good for reference-type arrays. String, decimal
12467 and now null constants (NullCast) are not counted toward
12468 static initializers.
12470 2004-03-05 Martin Baulig <martin@ximian.com>
12472 * location.cs (SourceFile.HasLineDirective): New public field;
12473 specifies whether the file contains or is referenced by a "#line"
12475 (Location.DefineSymbolDocuments): Ignore source files which
12476 either contain or are referenced by a "#line" directive.
12478 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12480 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12481 direct access to our parent, so check the method inline there.
12483 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12485 * expression.cs (Invocation.EmitCall): Miguel's last commit
12486 caused a regression. If you had:
12491 In Foo the implict this would be null.
12493 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12495 * expression.cs (Invocation.EmitCall): If the method is not
12496 virtual, do not emit a CallVirt to it, use Call.
12498 * typemanager.cs (GetFullNameSignature): Improve the method to
12499 cope with ".ctor" and replace it with the type name.
12501 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12502 as an argument the ConstructorBuilder where it is being defined,
12503 to catch the recursive constructor invocations.
12505 2004-03-16 Martin Baulig <martin@ximian.com>
12507 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12508 ConstructedType, call ResolveType() on it to get the type rather
12509 than just using `expr.Type'.
12511 2004-03-16 Martin Baulig <martin@ximian.com>
12513 * generics.cs (ConstructedType.GetMemberAccess): Take the
12514 EmitContext instead on the TypeExpr and use
12515 ec.TypeContainer.CurrentType/ec.ContainerType.
12517 2004-03-16 Martin Baulig <martin@ximian.com>
12519 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12520 parameters before aliases.
12522 2004-03-16 Martin Baulig <martin@ximian.com>
12524 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12525 New oublic function; checks whether two generic instances may become
12526 equal under some instantiations (26.3.1).
12528 * class.cs (TypeContainer.Define): Call
12529 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12532 2004-03-16 Martin Baulig <martin@ximian.com>
12534 * class.cs (TypeContainer.GetClassBases): Moved
12535 Error_TypeParameterAsBase() here and also check whether the base
12536 class is not an attribute.
12538 2004-03-16 Martin Baulig <martin@ximian.com>
12540 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12542 2004-03-16 Martin Baulig <martin@ximian.com>
12544 * class.cs (Error_TypeParameterAsBase): Use correct error number
12547 2004-03-16 Martin Baulig <martin@ximian.com>
12549 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12552 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12555 2004-03-15 Martin Baulig <martin@ximian.com>
12557 * typemanager.cs (TypeManager.GetFullName): New public method.
12558 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12559 argument; only return members with the correct number of type
12561 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12562 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12563 whether the number of type arguments matches.
12565 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12566 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12568 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12569 field; it's set by the protected .ctor when we're actually a
12570 GenericMemberAccess.
12571 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12572 arguments and pass it to MemberLookupFinal ().
12574 * ecore.cs (Expression.MemberLookup): Added `int
12575 num_type_arguments' argument; only return members with the correct
12576 number of type arguments.
12577 (Expression.MemberLookupFailed): Check whether the MemberLookup
12578 failed because we did not have the correct number of type
12579 arguments; report CS0305 in this case.
12581 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12582 `e.ResolveAsTypeTerminal()' already did so.
12584 2004-03-15 Martin Baulig <martin@ximian.com>
12586 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12587 we're a ConstructedType; in this case, the caller must report an
12588 error (for instance CS0131).
12590 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12591 (TypeArguments.Resolve): Actually report errors here.
12593 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12595 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12596 `set_indexer_name' to the pending bits (one per type).
12598 We fixed a bug today that was picking the wrong method to
12599 override, since for properties the existing InterfaceMethod code
12600 basically ignored the method name. Now we make sure that the
12601 method name is one of the valid indexer names.
12603 2004-03-15 Martin Baulig <martin@ximian.com>
12605 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12606 for generic instances.
12608 2004-03-13 Martin Baulig <martin@ximian.com>
12610 * class.cs (TypeContainer.DefineType): Call
12611 TypeManager.AddUserType() immediately after creating the
12612 TypeBuilder; pass all type parameters when creating the
12615 * decl.cs (DeclSpace.FindNestedType): New public method.
12616 (DeclSpace.FindType): Added `int num_type_args' argument; only
12617 return types with the correct number of type parameters.
12618 (DeclSpace.CountTypeParams): New public property.
12620 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12621 the number of type parameters; defaults to zero.
12623 * generic.cs (TypeArguments.Count): New public property.
12624 (ConstructedType.DoResolveAsTypeStep): First call
12625 ds.FindNestedType() to find out whether we're nested in the
12626 current generic type; in this case, we inherit all type parameters
12627 from the current class.
12629 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12630 num_type_args' argument.
12631 (RootContext.LookupType): Added overloaded version which takes the
12632 number of type arguments; only return types with the correct
12633 number of type arguments.
12635 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12636 checks whether `Type t' has `int num_type_args'.
12638 2004-03-13 Martin Baulig <martin@ximian.com>
12640 * generic.cs (GenericMethod.DefineType): New method; calls
12641 DefineType() on all the type parameters.
12643 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12644 (MethodData.Define): If we're a generic method, call
12645 GenericMethod.DefineType() to define the type parameters.
12647 2004-03-10 Martin Baulig <martin@ximian.com>
12649 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12650 instead of IsAssignableFrom.
12652 2004-03-10 Martin Baulig <martin@ximian.com>
12654 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12656 * support.cs (ParameterData.HasArrayParameter): New property.
12657 (ReflectionParameters.ctor): Take a MethodBase instead of a
12658 ParameterInfo[]. If we have any type parameters, get the generic
12659 method definition and ask it whether we have variable arguments.
12661 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12663 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12664 routines to check if a type is an enumerable/enumerator allow
12665 classes that implement the IEnumerable or IEnumerator interfaces.
12667 * class.cs (Property, Operator): Implement IIteratorContainer, and
12668 implement SetYields.
12670 (Property.Define): Do the block swapping for get_methods in the
12671 context of iterators. We need to check if Properties also
12672 include indexers or not.
12674 (Operator): Assign the Block before invoking the
12675 OperatorMethod.Define, so we can trigger the Iterator code
12678 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12679 Property and Operator classes are not created when we parse the
12680 declarator but until we have the block completed, so we use a
12681 singleton SimpleIteratorContainer.Simple to flag whether the
12682 SetYields has been invoked.
12684 We propagate this setting then to the Property or the Operator to
12685 allow the `yield' to function.
12687 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12689 * codegen.cs: Implemented attribute support for modules.
12690 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12691 Assembly/Module functionality.
12693 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12694 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12695 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12697 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12699 * interface.cs (FindMembers): The operation is performed on all base
12700 interfaces and not only on the first. It is required for future CLS Compliance patch.
12702 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12704 * statement.cs, codegen.cs:
12705 This patch deals with patterns such as:
12707 public class List : IEnumerable {
12709 public MyEnumerator GetEnumerator () {
12710 return new MyEnumerator(this);
12713 IEnumerator IEnumerable.GetEnumerator () {
12717 public struct MyEnumerator : IEnumerator {
12722 Before, there were a few things we did wrong:
12723 1) we would emit callvirt on a struct, which is illegal
12724 2) we emited ldarg when we needed to emit ldarga
12725 3) we would mistakenly call the interface methods on an enumerator
12726 type that derived from IEnumerator and was in another assembly. For example:
12728 public class MyEnumerator : IEnumerator
12730 Would have the interface methods called, even if there were public impls of the
12731 method. In a struct, this lead to invalid IL code.
12733 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12735 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12738 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12740 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12742 * cs-parser.jay: Fix small regression: we were not testing V2
12743 compiler features correctly.
12745 * interface.cs: If the emit context is null, then create one
12747 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12749 * decl.cs (GetSignatureForError): New virtual method to get full name
12750 for error messages.
12752 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12753 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12755 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12756 Duplicated members and code in these classes has been removed.
12757 Better encapsulation in these classes.
12759 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12761 * assign.cs (Assign.DoResolve): When dealing with compound
12762 assignments, there is a new rule in ECMA C# 2.4 (might have been
12763 there before, but it is documented here) that states that in:
12767 If b is of type int, and the `op' is a shift-operator, then the
12768 above is evaluated as:
12772 * expression.cs (Binary.ResolveOperator): Instead of testing for
12773 int/uint/long/ulong, try to implicitly convert to any of those
12774 types and use that in pointer arithmetic.
12776 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12777 method to print information for from the type, not from the
12778 null-method we were given.
12780 2004-02-01 Duncan Mak <duncan@ximian.com>
12782 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12783 parsing for cmd, fixes bug #53694.
12785 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12787 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12788 in the member name duplication tests. Property and operator name duplication
12789 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12791 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12793 * interface.cs (PopulateMethod): Fixed crash when interface method
12794 returns not existing type (error test cs0246-3.cs).
12796 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12798 * cs-parser.jay (interface_accessors): Re-write actions to also
12799 store attributes attached to get and set methods. Fix spelling
12802 (inteface_property_declaration): Modify accordingly.
12804 (InterfaceAccessorInfo): New helper class to store information to pass
12805 around between rules that use interface_accessors.
12807 * interface.cs (Emit): Apply attributes on the get and set
12808 accessors of properties and indexers too.
12810 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12811 right MethodBuilder when applying attributes to the get and set accessors.
12813 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12815 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12817 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12819 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12821 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12823 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12824 changes that treat `yield' specially when present before `break'
12825 or `return' tokens.
12827 * cs-tokenizer.cs: yield is no longer a keyword.
12829 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12831 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12832 setting for default constructors.
12833 For default constructors are almost every time set wrong Modifier. The
12834 generated IL code has been alright. But inside mcs this values was
12835 wrong and this was reason why several of my CLS Compliance tests
12838 2004-02-27 Martin Baulig <martin@ximian.com>
12840 * generics.cs (ConstructedType.ResolveType): Make the nested type
12841 stuff actually work.
12843 2004-02-25 Martin Baulig <martin@ximian.com>
12845 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12846 property; returns the type parameters just from the current type,
12847 ie. with the ones from outer classes.
12848 (DeclSpace.LookupGeneric): First search in the current class, then
12850 (DeclSpace.initialize_type_params): When hiding a type parameter
12851 from an outer class, put it into the `type_param_list' anyways.
12853 * expression.cs (MemberAccess.expr): Made this field protected.
12855 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12856 the type parameters from the current class.
12858 * generic.cs (ConstructedType.ResolveType): Support nested generic
12859 types by taking the type parameters which we inherit from outer
12860 classes into account.
12861 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12862 support for nested generic types.
12864 2004-02-23 Martin Baulig <martin@ximian.com>
12866 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12867 field and check whether we're nested inside a generic type.
12868 (DeclSpace.ResolveType): If we're resolving to a generic type
12869 definition, create a ConstructedType and return its resolved type.
12870 (DeclSpace.initialize_type_params): New private method;
12871 initializes the `type_param_list' field from the type parameters
12872 from this and all enclosing classes.
12873 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12874 we're already initialized.
12876 2004-02-23 Martin Baulig <martin@ximian.com>
12878 * class.cs (Method.Define): Create the generic method before
12879 calling DoDefine().
12880 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12881 the TypeContainer one); we use this for generic methods.
12883 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12884 parent's TypeBuilder.
12886 2004-02-18 Martin Baulig <martin@ximian.com>
12888 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12889 to check for equality.
12891 2004-02-05 Martin Baulig <martin@ximian.com>
12893 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12894 `ec.TypeContainer.CurrentType', use it instead of
12895 `ec.ContainerType' to check whether we're in the type's ctor.
12897 2004-01-29 Martin Baulig <martin@ximian.com>
12899 * expression.cs (Invocation.DoResolve): If we're a
12900 `ConstructedType', then we're actually a generic method, so
12901 rewrite the expr as a GenericMemberAccess.
12903 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12904 here; manually parse it into a string.
12906 2004-01-28 Martin Baulig <martin@ximian.com>
12908 * typemanager.cs (TypeManager.IsEqual): New static method.
12909 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12910 check for equality instead of using `=='.
12912 2004-01-26 Martin Baulig <martin@ximian.com>
12914 * decl.cs (DeclSpace.CurrentType): New public field.
12916 * expression.cs (This.ResolveBase): If we have an
12917 `ec.TypeContainer.CurrentType', use it instead of
12918 `ec.ContainerType'.
12920 * class.cs (TypeContainer.DefineType): If we're a generic type,
12921 create the `CurrentType' (unresolved).
12922 (TypeContainer.GenericType): New private field.
12923 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12924 it and store it in `GenericType' before creating the MemberCache.
12925 (TypeContainer.GetMembers): If we have a `GenericType', call
12926 TypeManager.FindMembers() on it.
12928 * interface.cs (Interface.GenericType): New private field.
12929 (Interface.DefineType): If we're a generic type, create the
12930 `CurrentType' (unresolved).
12931 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12932 and store it in `GenericType' before creating the MemberCache.
12933 (Interface.GetMembers): If we have a `GenericType', call
12934 TypeManager.FindMembers() on it.
12936 2004-01-22 Martin Baulig <martin@ximian.com>
12938 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12939 not a QualifiedIdentifier. This is what `type_name_expression'
12940 was previously doing.
12941 (type_name_expression): Removed; the code is now in
12942 `namespace_or_type_name'.
12943 (qualified_identifier): Removed, use `namespace_or_type_name'
12945 (QualifiedIdentifier): Removed this class.
12947 2004-01-22 Martin Baulig <martin@ximian.com>
12949 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12950 not a string as alias name.
12952 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12954 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12955 #52730 bug, and instead compute correctly the need to use a
12956 temporary variable when requesting an address based on the
12957 static/instace modified of the field and the constructor.
12959 2004-01-21 Martin Baulig <martin@ximian.com>
12961 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12962 class and namespace before looking up aliases. Fixes #52517.
12964 2004-01-21 Martin Baulig <martin@ximian.com>
12966 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12967 assinged in a 'try'; fixes exception4.cs.
12969 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12970 * class.cs : Implemented parameter-less constructor for TypeContainer
12972 * decl.cs: Attributes are now stored here. New property OptAttributes
12974 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12976 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12978 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12980 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12981 (CSharpSignature): New method for indexer and property signature.
12983 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12985 * pending.cs (IsVirtualFilter): Faster implementation.
12987 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12989 * typemanager.cs: Avoid inclusion of same assembly more than once.
12991 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12993 * cs-parser.jay: Fixed problem where the last assembly attribute
12994 has been applied also to following declaration (class, struct, etc.)
12996 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12998 * class.cs: Added error CS0538, CS0539 reporting.
12999 Fixed crash on Microsoft runtime when field type is void.
13001 * cs-parser.jay: Added error CS0537 reporting.
13003 * pending.cs: Added error CS0535 reporting.
13004 Improved error report for errors CS0536, CS0534.
13006 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13008 Merge a few bits from the Anonymous Method MCS tree.
13010 * statement.cs (ToplevelBlock): New class for toplevel methods,
13011 will hold anonymous methods, lifted variables.
13013 * cs-parser.jay: Create toplevel blocks for delegates and for
13014 regular blocks of code.
13016 2004-01-20 Martin Baulig <martin@ximian.com>
13018 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13019 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13020 and `NeedExplicitReturn'; added `IsLastStatement'.
13021 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13022 have a `ReturnLabel' or we're not unreachable.
13024 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13025 child's reachability; don't just override ours with it. Fixes
13026 #58058 (lluis's example).
13027 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13028 InFinally(), InLoop(), InSwitch() and
13029 BreakCrossesTryCatchBoundary() methods.
13031 * statement.cs (Return): Do all error checking in Resolve().
13032 Unless we are the last statement in a top-level block, always
13033 create a return label and jump to it.
13034 (Break, Continue): Do all error checking in Resolve(); also make
13035 sure we aren't leaving a `finally'.
13036 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13037 statement in a top-level block.
13038 (Block.Flags): Added `IsDestructor'.
13039 (Block.IsDestructor): New public property.
13041 2004-01-20 Martin Baulig <martin@ximian.com>
13043 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13045 2004-01-20 Martin Baulig <martin@ximian.com>
13047 * statement.cs (Statement.ResolveUnreachable): New public method.
13048 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13049 (Block.Resolve): Resolve unreachable statements.
13051 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13053 * expression.cs: We need to fix the case where we do
13054 not have a temp variable here.
13056 * assign.cs: Only expression compound assignments need
13057 temporary variables.
13059 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13061 * flowanalysis.cs: Reduce memory allocation in a few ways:
13062 - A block with no variables should not allocate a bit
13064 - A method with no out parameters does not need any tracking
13065 for assignment of the parameters, so we need not allocate
13068 public readonly Type[] VariableTypes;
13069 public readonly string[] VariableNames;
13070 Are redundant. The data is already stored in the variable
13071 map, so we need not allocate another array for it.
13072 - We need to add alot of checks for if (params | locals) == null
13073 due to the first two changes.
13075 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13077 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13078 implement IMemoryLocation, we store a copy on a local variable and
13079 take the address of it. Patch from Benjamin Jemlich
13081 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13082 to use a special "type_name_expression" rule which reduces the
13083 number of "QualifiedIdentifier" classes created, and instead
13084 directly creates MemberAccess expressions.
13086 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13088 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13089 that fixes #52853. Null literal assignment to ValueType
13091 * class.cs (MethodData.Emit): Instead of checking the name of the
13092 method to determine if its a destructor, create a new derived
13093 class from Method called Destructor, and test for that.
13095 * cs-parser.jay: Create a Destructor object instead of a Method.
13097 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13101 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13103 * expression.cs (Binary.ResolveOperator): Perform an implicit
13104 conversion from MethodGroups to their delegate types on the
13105 Addition operation.
13107 * delegate.cs: Introduce a new class DelegateCreation that is the
13108 base class for `NewDelegate' and `ImplicitDelegateCreation',
13109 factor some code in here.
13111 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13112 conversion from MethodGroups to compatible delegate types.
13114 * ecore.cs (Expression.Resolve): Do not flag error 654
13115 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13116 we allow conversions from MethodGroups to delegate types now.
13118 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13119 assignments in v2 either.
13121 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13123 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13124 static read-only fields in ctors.
13126 Applied patch from Benjamin Jemlich
13128 * expression.cs (UnaryMutator): Avoid leaking local variables.
13130 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13132 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13133 here to return true, as they can be used like this:
13135 (XXX) int.MEMBER ()
13137 Fixed 49836 and all the other dups
13139 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13141 * driver.cs: Implement /win32res and /win32icon.
13143 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13145 * cs-parser.jay: Add a rule to improve error handling for the
13146 common mistake of placing modifiers after the type.
13148 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13150 * cs-parser.jay (interface_event_declaration): Catch
13151 initialization of events on interfaces, and report cs0068
13153 * cs-parser.jay (interface_event_declaration): Catch
13154 initialization of events.
13156 * ecore.cs: Better report missing constructors.
13158 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13159 the error reporting done in the wrong place. Fix.
13161 * expression.cs (Binary.ResolveOperator): Catch the
13162 operator + (E x, E y) error earlier, and later allow for implicit
13163 conversions in operator +/- (E e, U x) from U to the underlying
13166 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13167 52596, if the container class is abstract, the default constructor
13168 is protected otherwise its public (before, we were always public).
13170 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13173 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13174 Jemlich that fixes bug #52597, MCS was generating invalid code for
13175 idisposable structs. Thanks to Ben for following up with this
13178 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13180 * driver.cs: Allow assemblies without code to be generated, fixes
13183 2004-01-07 Nick Drochak <ndrochak@gol.com>
13185 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13187 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13189 * cs-parser.jay: Add rules to improve error reporting if fields or
13190 methods are declared at the namespace level (error 116)
13192 * Add rules to catch event add/remove
13194 2004-01-04 David Sheldon <dave-mono@earth.li>
13196 * expression.cs: Added matching ")" to error message for
13199 2004-01-03 Todd Berman <tberman@gentoo.org>
13201 * ecore.cs, attribute.cs:
13202 Applying fix from #52429.
13204 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13206 * ecore.cs, expression.cs, statement.cs:
13207 Total rewrite of how we handle branching. We
13208 now handle complex boolean expressions with fewer
13209 jumps. As well if (x == 0) no longer emits a ceq.
13211 if (x is Foo) is much faster now, because we generate
13214 Overall, we get a pretty big improvement on our benchmark
13215 tests. The code we generate is smaller and more readable.
13217 I did a full two-stage bootstrap. The patch was reviewed
13218 by Martin and Miguel.
13220 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13222 * cs-parser.jay: Make primary_expression not take a QI.
13223 we dont need this because the member_access rule covers
13224 us here. So we replace the rule with just IDENTIFIER.
13226 This has two good effects. First, we remove a s/r conflict.
13227 Second, we allocate many fewer QualifiedIdentifier objects.
13229 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13231 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13232 set the correct information via SRE. This prevents
13233 hanging on the MS runtime. Fixes #29374.
13235 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13237 * convert.cs: correctly handle conversions to value types
13238 from Enum and ValueType as unboxing conversions.
13240 Fixes bug #52569. Patch by Benjamin Jemlich.
13242 2004-01-02 Ravi Pratap <ravi@ximian.com>
13244 * expression.cs (BetterConversion): Prefer int -> uint
13245 over int -> ulong (csc's behaviour). This fixed bug #52046.
13247 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13249 * decl.cs (MemberCache.FindMembers): now returns a
13252 * typemanager.cs: In general, go with with ^^.
13253 (CopyNewMethods): take an IList.
13254 (RealMemberLookup): Only allocate an arraylist
13255 if we copy from two sets of methods.
13257 This change basically does two things:
13258 1) Fewer array lists allocated due to CopyNewMethods.
13259 2) the explicit cast in MemberList costed ALOT.
13261 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13263 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13264 a hashtable to avoid needless string allocations when an identifier is
13265 used more than once (the common case).
13267 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13269 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13270 is broken, it will not return anything. So, we
13271 have to use the information we have in mcs to
13274 * typemanager.cs: Add a cache for GetInterfaces,
13275 since this will now be used more often (due to ^^)
13277 (GetExplicitInterfaces) New method that gets the
13278 declared, not effective, interfaces on a type
13279 builder (eg, if you have interface IFoo, interface
13280 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13283 This patch makes MCS able to bootstrap itself on
13286 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13288 * expression.cs: Remove the Nop's that Miguel put
13291 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13293 * report.cs, codegen.cs: Give the real stack trace to
13294 the error when an exception is thrown.
13296 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13298 * decl.cs: only allocate hashtables for ifaces if
13301 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13303 * expression.cs: fix the error from cs0121-2.cs
13304 (a parent interface has two child interfaces that
13305 have a function with the same name and 0 params
13306 and the function is called through the parent).
13308 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13310 * class.cs, rootcontext.cs, typmanager.cs: do not
13313 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13315 * codegen.cs: remove stack for the ec flow branching.
13316 It is already a linked list, so no need.
13318 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13320 * Makefile: Allow custom profiler here.
13322 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13324 * typemanager.cs (LookupType):
13325 - Use a static char [], because split takes
13326 a param array for args, so it was allocating
13328 - Do not store true in a hashtable, it boxes.
13330 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13332 * flowanalysis.cs: bytify common enums.
13334 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13336 * modifiers.cs: Add a new set of flags for the
13337 flags allowed on explicit interface impls.
13338 * cs-parser.jay: catch the use of modifiers in
13339 interfaces correctly.
13340 * class.cs: catch private void IFoo.Blah ().
13342 All related to bug #50572.
13344 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13346 * decl.cs: Rewrite the consistant accessability checking.
13347 Accessability is not linear, it must be implemented in
13348 a tableish way. Fixes #49704.
13350 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13352 * expression.cs: Handle negation in a checked context.
13353 We must use subtraction from zero. Fixes #38674.
13355 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13357 * class.cs: Ignore static void main in DLLs.
13358 * rootcontext.cs: Handle the target type here,
13359 since we are have to access it from class.cs
13360 * driver.cs: account for the above.
13362 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13364 * report.cs: Give line numbers and files if available.
13366 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13368 * driver.cs: Implement /addmodule.
13370 * typemanager.cs: Change 'modules' field so it now contains Modules not
13373 2003-12-20 Martin Baulig <martin@ximian.com>
13375 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13376 (FieldBase.IsAssigned): Removed this field.
13377 (FieldBase.SetAssigned): New public method.
13378 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13380 2003-12-20 Martin Baulig <martin@ximian.com>
13382 * expression.cs (LocalVariableReference.DoResolve): Don't set
13383 `vi.Used' if we're called from DoResolveLValue().
13385 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13386 returns the usage vector it just merged into the current one -
13387 pass this one to UsageWarning().
13388 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13389 of the `EmitContext', don't call this recursively on our children.
13391 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13393 * driver.cs: Implement /target:module.
13395 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13397 * support.cs (CharArrayHashtable): New helper class.
13399 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13400 char arrays, not strings, so we can avoid creating a string in
13401 consume_identifier if the identifier is a keyword.
13403 2003-12-16 Martin Baulig <martin@ximian.com>
13405 * statement.cs (LocalInfo.Assigned): Removed this property.
13406 (LocalInfo.Flags): Removed `Assigned'.
13407 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13408 and uses flow analysis.
13409 (Block.UsageWarning): Made this method private.
13410 (Block.Resolve): Call UsageWarning() if appropriate.
13412 * expression.cs (LocalVariableReference.DoResolve): Always set
13413 LocalInfo.Used here.
13415 2003-12-13 Martin Baulig <martin@ximian.com>
13417 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13418 any value here; we're now using flow analysis to figure out
13419 whether a statement/block returns a value.
13421 2003-12-13 Martin Baulig <martin@ximian.com>
13423 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13425 (FlowBranching.MergeFinally): Don't call
13426 `branching.CheckOutParameters()' here, this is called in
13428 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13429 when adding the `finally' vector.
13431 2003-12-13 Martin Baulig <martin@ximian.com>
13434 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13435 actually work and also fix #48962.
13437 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13439 * decl.cs: Do not check System.Object for nested types,
13440 since we know it does not have any. Big bang for buck:
13443 Run 1: 8.35 seconds
13444 Run 2: 8.32 seconds
13445 corlib: 17.99 seconds
13447 Run 1: 8.17 seconds
13448 Run 2: 8.17 seconds
13449 corlib: 17.39 seconds
13451 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13453 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13454 time we are returning 0 members, so we save alot here.
13456 2003-12-11 Martin Baulig <martin@ximian.com>
13458 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13459 `MergeChild()', also just take the `FlowBranching' as argument;
13460 call Merge() on it and return the result.
13461 (FlowBranching.Merge): We don't need to do anything if we just
13464 2003-12-11 Martin Baulig <martin@ximian.com>
13466 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13467 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13468 Maurer for this idea.
13470 2003-12-11 Martin Baulig <martin@ximian.com>
13472 * flowanalysis.cs (MergeResult): This class is now gone; we now
13473 use the `UsageVector' for this. The reason for this is that if a
13474 branching just has one sibling, we don't need to "merge" them at
13475 all - that's the next step to do.
13476 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13479 2003-12-11 Martin Baulig <martin@ximian.com>
13481 Reworked flow analyis and made it more precise and bug-free. The
13482 most important change is that we're now using a special `Reachability'
13483 class instead of having "magic" meanings of `FlowReturns'. I'll
13484 do some more cleanups and optimizations and also add some more
13485 documentation this week.
13487 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13488 largely reworked this class.
13489 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13490 the new `Reachability' class instead of having "magic" values here.
13491 (FlowBranching): We're now using an instance of `Reachability'
13492 instead of having separate `Returns', `Breaks' etc. fields.
13494 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13495 based on flow analysis; ignore the return value of block.Emit ().
13497 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13499 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13500 if they are private.
13502 2003-12-09 Martin Baulig <martin@ximian.com>
13504 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13505 call them directly on the UsageVector.
13507 2003-12-09 Martin Baulig <martin@ximian.com>
13509 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13510 Changed return type from `FlowReturns' to `Reachability'.
13512 2003-12-09 Martin Baulig <martin@ximian.com>
13514 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13515 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13516 `Reachable' fields with a single `Reachability' one.
13518 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13520 * class.cs (FindMembers): Remove foreach's.
13525 Run 1: 8.74 seconds
13526 Run 2: 8.71 seconds
13529 Run 1: 8.64 seconds
13530 Run 2: 8.58 seconds
13533 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13538 This patch does a few things:
13539 1. EmptyStatement is now a singleton, so it is never reallocated.
13540 2. All blah is EmptyStatement constructs have been changed to
13541 blah == EmptyStatement.Value, which is much faster and valid
13542 now that EmptyStatement is a singleton.
13543 3. When resolving a block, rather than allocating a new array for
13544 the non-empty statements, empty statements are replaced with
13545 EmptyStatement.Value
13546 4. Some recursive functions have been made non-recursive.
13547 Mainly the performance impact is from (3), however (1) and (2) are needed for
13548 this to work. (4) does not make a big difference in normal situations, however
13549 it makes the profile look saner.
13554 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13555 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13556 Total memory allocated: 56397 KB
13559 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13560 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13561 Total memory allocated: 55666 KB
13563 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13565 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13566 than the hashtable in a hashtable version
13568 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13569 we always end up concating a string. This results in a huge perf
13570 loss, because many strings have to be tracked by the GC. In this
13571 patch, we first use a hashtable that works with two keys, so that
13572 the strings do not need to be concat'ed.
13576 Run 1: 8.74 seconds
13577 Run 2: 8.71 seconds
13580 Run 1: 8.65 seconds
13581 Run 2: 8.56 seconds
13583 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13585 * Makefile: Add a new target `do-time' that does a quick and simple
13586 profile, leaving easy to parse output.
13588 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13590 * codegen.cs (Init): Create the dynamic assembly with
13591 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13593 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13595 * support.cs: Make the PtrHashtable use only one
13596 instance of its comparer.
13598 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13600 * typemanager.cs: Fix lookup of GetNamespaces.
13602 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13604 * expression.cs: Removed redundant line.
13606 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13607 ArrayLists, use for loops with bounds.
13609 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13612 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13613 arraylists, use for loop with bounds.
13615 The above three changes give us a 0.071 second performance
13616 improvement out of 3.294 seconds down to 3.223. On my machine
13617 the above changes reduced the memory usage by 1,387 KB during
13618 compiler bootstrap.
13620 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13621 QualifiedIdentifiers. Before we created a new string through
13622 concatenation, and mostly later on, the result would be
13623 manipulated by DecomposeQI through string manipulation.
13625 This reduced the compiler memory usage for bootstrapping from
13626 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13627 compile times in 0.05 seconds.
13629 2003-11-28 Dick Porter <dick@ximian.com>
13631 * support.cs: Do string compares with the Invariant culture.
13639 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13640 the comparison is done with the Invariant culture.
13642 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13644 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13645 GetEnumerator method.
13647 (ProbeCollectionType): Iterate starting at the most specific type
13648 upwards looking for a GetEnumerator
13650 * expression.cs: Shift count can be up to 31 for int/uint and 63
13653 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13655 * statement.cs (Block.LookupLabel): Also look for the label on the
13656 children blocks. Use a hash table to keep track of visited
13659 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13660 we actually did transform the other operand, otherwise fall back
13661 to the common codepath that casts to long.
13663 * cs-tokenizer.cs: Use the same code pattern as the int case.
13664 Maybe I should do the parsing myself, and avoid depending on the
13665 Parse routines to get this done.
13667 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13669 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13670 which fixes bug 51347. This time test it.
13672 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13673 attributes for example can not tell the difference between these.
13674 The difference was only a syntax feature of the language.
13676 * attribute.cs: Apply attributes to delegates.
13678 * delegate.cs: Call the apply attributes method.
13680 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13682 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13683 comparing 0 vs Byte.MinValue, not the value
13685 (ImplicitConversionRequired): When reporting a conversion error,
13686 use error 31 to print out the constant error instead of the
13689 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13690 which fixes bug 51347.
13692 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13694 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13695 which fixes the -warnaserror command line option.
13697 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13699 * cfold.cs (DoNumericPromotions): During constant folding of
13700 additions on UIntConstant, special case intconstants with
13701 IntConstants like we do on the expression binary operator.
13703 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13705 * convert.cs (ImplicitReferenceConversion): We were missing a case
13706 (System.Enum are not value types or class types, so we need to
13707 classify them separatedly).
13709 * driver.cs: We do not support error 2007.
13711 2003-11-12 Jackson Harper <jackson@ximian.com>
13713 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13714 system directory. Also use the full file name so users can
13715 libraries names mscorlib-o-tron.dll in a non system dir.
13717 2004-01-04 David Sheldon <dave-mono@earth.li>
13719 * expression.cs: Added matching ")" to error message for CS0077.
13721 2003-12-19 Martin Baulig <martin@ximian.com>
13723 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13724 static method; see documentation in the method.
13725 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13727 * convert.cs (Convert.ImplicitReferenceConversion,
13728 Convert.ImplicitReferenceConversionExists): Add support for
13729 generic type declarations; see gen-36.cs.
13731 2003-12-19 Martin Baulig <martin@ximian.com>
13733 * pending.cs (Pending.InterfaceMethod): Use
13734 `Type.IsAssignableFrom()' instead of `=='.
13736 2003-12-18 Martin Baulig <martin@ximian.com>
13738 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13741 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13742 `expr_type.Equals (target_type)' instead of `=='.
13744 2003-12-08 Martin Baulig <martin@ximian.com>
13746 * generics.cs (Constraints.Types): Removed.
13747 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13749 (Constraints.ResolveTypes): New public method; resolves the
13750 TypeExpr's to Type's.
13751 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13752 longer takes the constraints.
13753 (TypeParameter.DefineMethod): Likewise.
13754 (TypeParameter.DefineType): New public method. Calls
13755 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13758 2003-12-08 Martin Baulig <martin@ximian.com>
13760 * convert.cs (Convert.ImplicitConversionStandard): Use
13761 `expr_type.Equals (target_type)' instead of `=='.
13763 2003-12-08 Martin Baulig <martin@ximian.com>
13765 * typemanager.cs (TypeManager.GetReferenceType): Call
13766 `Type.MakeByRefType ()'.
13768 2003-12-08 Martin Baulig <martin@ximian.com>
13770 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13771 just has some special meaning in some situations. For instance,
13772 it is allowed to use `where' as the name of a variable etc.
13774 2003-12-04 Martin Baulig <martin@ximian.com>
13776 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13777 `Type.MakeArrayType()' for array types.
13779 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13781 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13784 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13787 2003-11-16 Martin Baulig <martin@ximian.com>
13789 * codegen.cs (EmitContext.IsGeneric): Removed.
13791 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13792 ResolveGeneric() on the DeclSpace.
13794 2003-11-16 Martin Baulig <martin@ximian.com>
13796 * generic.cs (TypeArguments.Resolve):
13797 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13798 `ResolveType()' on it to get the Type.
13800 2003-11-15 Martin Baulig <martin@ximian.com>
13802 * generic.cs (ConstructedType.GetInterfaces): Override this.
13804 2003-11-14 Martin Baulig <martin@ximian.com>
13806 * interface.cs (Interface.DefineType): Define all type parameters
13807 before adding the interfaces we inherit.
13809 2003-11-11 Martin Baulig <martin@ximian.com>
13811 * generic.cs (ConstructedType.ResolveType): Always call
13812 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13814 2003-11-10 Martin Baulig <martin@ximian.com>
13816 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13817 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13818 calling `ResolveType()' on them, directly assign their `Type'.
13820 2003-11-08 Martin Baulig <martin@ximian.com>
13822 * generic.cs (ConstructedType): Override `IsClass' etc.
13824 2003-11-08 Martin Baulig <martin@ximian.com>
13826 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13827 return value and the `out parent' parameter.
13828 (TypeContainer.DefineType): Moved the CS0644 check into
13829 GetClassBases(). Don't pass the interface types to the
13830 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13831 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13833 * ecore.cs (TypeExpr.IsAttribute): New property.
13834 (TypeExpr.GetInterfaces): New method.
13836 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13837 TypeExpr instead of a Type.
13838 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13839 (Interface.DefineType): Don't pass the interface types to the
13840 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13841 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13843 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13844 instead of a `Type[]'.
13845 (TypeManager.RegisterBuilder): Likewise.
13846 (TypeManager.AddUserInterface): Likewise.
13847 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13848 `Type[]' and also return a `TypeExpr[]'.
13849 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13851 2003-11-08 Martin Baulig <martin@ximian.com>
13853 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13856 2003-11-08 Martin Baulig <martin@ximian.com>
13858 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13859 TypeManager.ResolveExpressionTypes().
13861 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13862 instead of an Expression.
13863 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13864 (TypeExpression): New public class; formerly known as `TypeExpr'.
13866 * expression.cs (ComposedCast): Derive from TypeExpr.
13868 * typemanager.cs (TypeManager.system_*_expr): These are now
13869 TypExpr's instead of Expression's.
13870 (TypeManager.ResolveExpressionTypes): New public static function;
13871 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13874 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13876 * expression.cs (New.DoResolve): Do not dereference value that
13877 might be a null return.
13879 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13880 sure that the constant value has the right type. Fixes an
13881 unreported bug, similar to 50425.
13883 * const.cs (Const.LookupConstantValue): Call
13884 ImplicitStandardConversionExists before doing a conversion to
13885 avoid havng the TypeManager.ChangeType do conversions.
13887 Reduced the number of casts used
13889 (Const.ChangeType): New routine to enable reuse of the constant
13890 type changing code from statement.
13892 * typemanager.cs (ChangeType): Move common initialization to
13893 static global variables.
13897 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13898 every value type to go through, even if it was void. Fix that.
13900 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13901 character of the define, and the is_identifier_part_character for
13902 the rest of the string.
13904 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13906 * expression.cs (UnaryMutator.EmitCode): When I updated
13907 LocalVariableReference.DoResolve, I overdid it, and dropped an
13908 optimization done on local variable references.
13910 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13912 * ecore.cs: Convert the return from Ldlen into an int.
13914 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13916 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13917 the accessibility, this is a special case for toplevel non-public
13918 classes (internal for instance).
13920 2003-10-20 Nick Drochak <ndrochak@gol.com>
13922 * ecore.cs: Fix typo and build. Needed another right paren.
13924 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13926 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13927 `internal' case regular and protected, but not allowing protected
13928 to be evaluated later. Bug 49840
13930 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13932 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13933 to kb.Nlast, and not the kb.nFirst to isolate the switch
13936 Extract the underlying type, so enumerations of long/ulong are
13937 treated like long/ulong.
13939 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13941 * expression.cs (New): Overload the meaning of RequestedType to
13942 track the possible creation of the NewDelegate type, since
13943 DoResolve is invoked more than once for new constructors on field
13946 See bugs: #48800 and #37014
13948 * cs-parser.jay (declare_local_constants): Take an arraylist
13949 instead of a single constant.
13951 (local_constant_declaration): It should take a
13952 constant_declarators, not a constant_declarator. Fixes 49487
13954 * convert.cs: Fix error report.
13956 2003-10-13 Jackson Harper <jackson@ximian.com>
13958 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13961 2003-11-03 Martin Baulig <martin@ximian.com>
13963 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13964 `out bool has_type_arg'; if set, we need to pass the type to
13966 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13967 Stelem_Any/Ldelem_Any for generic parameters.
13969 2003-11-02 Martin Baulig <martin@ximian.com>
13971 * expression.cs (Invocation.EmitCall): Use
13972 `TypeManager.IsValueType()' to check whether it's a value type.
13973 Don't set `struct_call' when calling a method on a type parameter.
13975 2003-11-02 Martin Baulig <martin@ximian.com>
13977 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13978 and removed the TypeBuilder argument.
13980 * typemanager.cs (TypeManager.IsValueType): Return
13981 `t.IsGenericParameter || t.IsValueType'.
13983 2003-10-25 Martin Baulig <martin@ximian.com>
13985 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13986 call ConstructedType.Resolve() on it.
13988 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13990 2003-10-25 Martin Baulig <martin@ximian.com>
13992 * class.cs (TypeContainer.GetClassBases): Changed
13993 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13994 CS8214 reporting here.
13995 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13996 instead of a `Type' for our parent. In case of a recursive
13997 declaration (see tests/gen-23.cs for an example), our parent is a
13998 ConstructedType and it doesn't have its type set. So, first
13999 create our own TypeBuilder, then call constructed.Resolve() to get
14000 the parent's type and finally TypeBuilder.SetParent() it.
14002 * ecore.cs (TypeExpr.Name): New public virtual property.
14005 (ConstructedType): We're now a TypeExpr and not just an Expression.
14006 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14007 arguments here; this is done later.
14008 (ConstructedType.Resolve): New public method to resolve the type
14009 arguments and bind them.
14011 2003-10-21 Martin Baulig <martin@ximian.com>
14013 * convert.cs: Use `TypeManager.IsValueType' instead of
14014 'type.IsValueType' everywhere.
14016 * typemanager.cs (TypeManager.IsValueType): Return true for type
14017 parameters. The reason for this is that we need to box a type
14018 parameter when converting it to a reference type.
14020 * cs-parser.jay: Added support for default value expressions.
14022 * generics.cs (DefaultValueExpression): New public class.
14024 2003-10-17 Martin Baulig <martin@ximian.com>
14026 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14027 TypeContainer so we can also use this for Interfaces.
14028 (TypeParameter.Resolve): Likewise.
14030 * interface.cs (Interface.DefineType): Added support for generic
14033 * cs-parser.jay: Added support for generic structs and interfaces.
14035 2003-10-17 Martin Baulig <martin@ximian.com>
14037 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14038 call generic methods :-)
14040 2003-10-16 Martin Baulig <martin@ximian.com>
14042 * cs-parser.jay (namespace_or_type_name): Only create a
14043 GenericMemberAccess if we actually have type arguments.
14045 2003-10-13 Martin Baulig <martin@ximian.com>
14047 * class.cs (Method.Define): If we're a generic method, call
14048 TypeBuilder.DefineGenericMethod () before resolving
14050 (MethodData): Added .ctor which takes an additional MethodBuilder
14051 argument; this is used for generic methods.
14052 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14053 we already have a MethodBuilder.
14055 2003-10-10 Martin Baulig <martin@ximian.com>
14057 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14058 instead of a `DeclSpace'. This is used for generic methods.
14060 * cs-parser.jay (method_header): Added support for generic
14061 methods; create a `GenericMethod' instance and pass it to the
14062 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14063 parameters and locals.
14065 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14066 since we already have the location. Check whether we're a generic
14067 type declaration or a generic method and create the correct type
14070 * generic.cs (TypeParameter.DefineMethod): New public method.
14071 (GenericMethod): New public class; derives from DeclSpace and is
14072 used for generic methods.
14074 2003-10-09 Martin Baulig <martin@ximian.com>
14076 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14078 (MethodCore.DoDefineParameters): Removed the TypeContainer
14079 argument; use the DeclSpace which was passed to the .ctor instead.
14080 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14081 TypeContainer; we only need a DeclSpace here.
14083 2003-10-09 Martin Baulig <martin@ximian.com>
14085 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14087 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14088 EmitContext's .ctor.
14090 2003-10-09 Martin Baulig <martin@ximian.com>
14092 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14093 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14094 AsAccessible(), moved them as well.
14096 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14098 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14100 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14101 generation for >=, as spotted by Paolo, bug 48679.
14102 Patch from David Waite.
14104 * cs-tokenizer.cs: Add handling for #pragma.
14106 * cs-parser.jay: Allow for both yield and yield return in the
14107 syntax. The anti-cobolization of C# fight will go on!
14109 * class.cs (TypeBuilder.DefineType): Catch error condition here
14110 (Parent.DefineType erroring out and returning null).
14112 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14113 coping with enumerations variables, we were mistakenly processing
14114 them as a regular value type instead of built-in types. Fixes the
14117 * typemanager.cs (IsBuiltinOrEnum): New method.
14119 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14121 * cs-parser.jay: Upgrade: yield now needs the return clause.
14123 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14125 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14127 2003-09-29 Martin Baulig <martin@ximian.com>
14129 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14130 inflated generic methods.
14132 * generics.cs (ConstructedType): Distinguish between open and
14133 closed constructed types; correctly resolve the arguments.
14135 2003-09-22 Martin Baulig <martin@ximian.com>
14137 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14138 all type arguments meet their constraints.
14140 2003-09-19 Martin Baulig <martin@ximian.com>
14142 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14143 `MemberCache parent' argument. Normally, an interface doesn't
14144 have a parent type except System.Object, but we use this in gmcs
14145 for generic type parameters.
14147 2003-09-18 Martin Baulig <martin@ximian.com>
14149 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14150 on `type.IsInterface'; don't check whether the type has a parent
14151 to determine whether it's an interface.
14153 2003-09-17 Martin Baulig <martin@ximian.com>
14155 * generic.cs (ConstructedType.ToString): Always use `name' as the
14158 2003-09-15 Martin Baulig <martin@ximian.com>
14160 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14162 * generic.cs (Constraints.Resolve): New public method; this is
14163 called to resolve the constraint types and to check whether all
14164 the constraints are correct.
14165 (Constraints.Types): New public property.
14166 (TypeParameter.Resolve): New public method; resolves all the
14167 type's constraints.
14169 * class.cs (TypeContainer.DefineType): Call
14170 TypeParameter.Resolve() before actually defining the type.
14172 2003-09-15 Martin Baulig <martin@ximian.com>
14174 * class.cs (TypeContainer.DefineType): Added an error flag to
14175 avoid reporting duplicate CS0146's ("class definition is
14178 * driver.cs (Driver.MainDriver): Abort if
14179 RootContext.ResolveTree() reported any errors.
14181 2003-09-07 Martin Baulig <martin@ximian.com>
14183 * report.cs (Error, Warning): Added overloaded versions which take
14184 a `params object[] args' and call String.Format().
14186 2003-09-07 Martin Baulig <martin@ximian.com>
14188 * decl.cs (DeclSpace..ctor): Don't call
14189 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14190 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14191 (DeclSpace.RecordDecl): New method.
14193 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14195 2003-09-02 Ravi Pratap <ravi@ximian.com>
14197 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14198 value attributes to be applied to ParameterBuilders.
14200 * class.cs (MethodCore.LabelParameters): Make static and more
14201 generic so that it can be used from other places - like interface
14202 methods, for instance.
14204 * interface.cs (Interface.Emit): Call LabelParameters before
14205 emitting attributes on the InterfaceMethod.
14207 2003-09-07 Martin Baulig <martin@ximian.com>
14209 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14210 if the number of type parameters doesn't match.
14212 2003-09-04 Martin Baulig <martin@ximian.com>
14214 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14215 for arrays of generic type params (ie. `!0[]').
14217 2003-09-04 Martin Baulig <martin@ximian.com>
14219 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14222 2003-09-04 Martin Baulig <martin@ximian.com>
14224 * decl.cs (DeclSpace.LookupGeneric): New method.
14225 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14228 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14229 argument, not just a string.
14230 (TypeParameter.Define): New public method; this is called to
14231 actually define the generic parameter; after this, you can use the
14232 new `Type' property to get the type.
14234 2003-09-04 Martin Baulig <martin@ximian.com>
14236 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14237 is now an ArrayList; initialize the result of the `TypeParameters'
14239 (DeclSpace.GetGenericData): Removed.
14240 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14241 implement this in a different way.
14242 (DeclSpace.GetTypeParameters): Removed; there's now a
14243 `TypeParameters' property.
14244 (DeclSpace.TypeParameters): New public property.
14246 * generic.cs (Constraints): Make this class public.
14247 (TypeParameter): New public class.
14249 2003-09-04 Martin Baulig <martin@ximian.com>
14251 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14252 generic parameters.
14254 * class.cs (TypeContainer.DefineType): Call
14255 TypeBuilder.DefineGenericParameter () on all generic parameters if
14256 this is a generic type.
14258 2003-08-28 Martin Baulig <martin@ximian.com>
14260 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14263 * sample-hello.cs: Compile this with gmcs: "gmcs
14264 /r:sample-stack.dll sample-hello.cs".
14266 2003-08-28 Martin Baulig <martin@ximian.com>
14268 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14269 the parameters to the generic type.
14271 2003-08-28 Martin Baulig <martin@ximian.com>
14273 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14275 2003-08-28 Martin Baulig <martin@ximian.com>
14277 * cs-parser.jay (opt_type_argument_list): Use
14278 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14279 (primary_expression): Replace `qualified_identifier' with `type_name'.
14280 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14282 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14283 parser to check whether it is syntactically a type parameter list;
14284 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14287 2003-08-26 Martin Baulig <martin@ximian.com>
14289 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14290 resolving aliases; fixes #47927.
14292 2003-08-26 Martin Baulig <martin@ximian.com>
14294 * statement.cs (Using.DoResolve): This is internally emitting a
14295 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14296 do not always return. Fixes #47681.
14298 2003-08-26 Martin Baulig <martin@ximian.com>
14300 * decl.cs (MemberCore): Moved WarningNotHiding(),
14301 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14303 (AdditionResult): Make this nested in DeclSpace.
14304 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14305 argument; call NamespaceEntry.Define() unless we're nested in a
14308 * namespace.cs (Namespace.DefineName): New public function. This
14309 is called from DeclSpace's .ctor to add
14310 (Namespace.Lookup): Include DeclSpaces in the lookup.
14312 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14314 * const.cs (Const): Derive from MemberBase, not MemberCore.
14316 2003-08-25 Martin Baulig <martin@ximian.com>
14318 * convert.cs (Convert.ExplicitReferenceConversion): When
14319 converting from an interface type to a class, unbox if the target
14320 type is a struct type. Fixes #47822.
14322 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14324 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14327 2003-08-22 Martin Baulig <martin@ximian.com>
14329 * class.cs (TypeManager.DefineType): When defining a nested type,
14330 call DefineType() on our parent; fixes #47801.
14332 2003-08-22 Martin Baulig <martin@ximian.com>
14334 * class.cs (MethodData.Define): While checking if a method is an
14335 interface implementation, improve the test a bit more to fix #47654.
14337 2003-08-22 Martin Baulig <martin@ximian.com>
14339 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14340 correctly; fixes #47722.
14342 2003-08-22 Martin Baulig <martin@ximian.com>
14344 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14345 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14347 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14349 2003-08-22 Martin Baulig <martin@ximian.com>
14351 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14352 can only be assigned in static constructors. Fixes #47161.
14354 2003-08-22 Martin Baulig <martin@ximian.com>
14356 Rewrote and improved the flow analysis code.
14358 * flowbranching.cs (FlowBranching): Make this class abstract.
14359 (FlowBranching.CreateBranching): New static function to create a
14360 new flow branching.
14361 (FlowBranchingBlock, FlowBranchingException): New classes.
14362 (FlowBranching.UsageVector.Type): New public readonly field.
14363 (FlowBranching.UsageVector.Breaks): Removed the setter.
14364 (FlowBranching.UsageVector.Returns): Removed the setter.
14365 (FlowBranching.UsageVector): Added Break(), Return(),
14366 NeverReachable() and Throw() methods to modify the reachability.
14367 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14368 done by FlowBranching.Merge().
14369 (FlowBranching.UsageVector.MergeChild): New method; merges the
14370 merge result into the current vector.
14371 (FlowBranching.Merge): New abstract method to merge a branching.
14373 2003-08-12 Martin Baulig <martin@ximian.com>
14375 * expression.cs (Indirection.CacheTemporaries): Create the
14376 LocalTemporary with the pointer type, not its element type.
14378 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14380 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14381 token was a keyword or not.
14383 Add `error' options where an IDENTIFIER was expected; Provide
14384 CheckToken and CheckIdentifierToken convenience error reporting
14387 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14389 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14390 NameSpaceEntry NameSpaceEntry.
14392 (LookupInterfaceOrClass): Avoid creating a full qualified name
14393 from namespace and name: avoid doing lookups when we know the
14394 namespace is non-existant. Use new Tree.LookupByNamespace which
14395 looks up DeclSpaces based on their namespace, name pair.
14397 * driver.cs: Provide a new `parser verbose' to display the
14398 exception thrown during parsing. This is turned off by default
14399 now, so the output of a failure from mcs is more graceful.
14401 * namespace.cs: Track all the namespaces defined in a hashtable
14404 (IsNamespace): New method
14406 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14408 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14409 we know that we need to concatenate (full typename can never be
14414 * statement.cs: Use a bitfield; Do not initialize to null things
14415 which are done by the constructor by default.
14417 * cs-parser.jay: bug fix, parameter was 4, not 3.
14419 * expression.cs: Just use the property;
14421 * statement.cs: No need for GetVariableInfo method.
14423 2003-08-08 Martin Baulig <martin@ximian.com>
14425 * flowanalysis.cs (FlowReturns): This is now nested in the
14426 `FlowBranching' class.
14427 (MyBitVector): Moved this here from statement.cs.
14428 (FlowBranching.SiblingType): New enum type.
14429 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14431 2003-08-07 Martin Baulig <martin@ximian.com>
14433 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14434 `FlowBranching' class and called `BranchingType'.
14436 2003-08-07 Martin Baulig <martin@ximian.com>
14438 * flowanalysis.cs: Moved all the control flow analysis code into
14441 2003-08-07 Martin Baulig <martin@ximian.com>
14443 * assign.cs (Assign.DoResolve): `target' must either be an
14444 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14447 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14449 * expression.cs (BinaryMethod): This kind of expression is created by the
14450 Binary class if it determines that the operator has to be handled
14453 (BinaryDelegate): This kind of expression is created if we are
14454 dealing with a + or - operator on delegates.
14456 (Binary): remove method, argumetns, and DelegateOperator: when
14457 dealing with methods,
14459 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14461 * statement.cs (Block): use bitfields for the three extra booleans
14462 we had in use. Remove unused topblock parameter.
14464 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14466 * assign.cs: Drop extra unneeded tests.
14468 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14470 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14472 * statement.cs (Foreach): Use VariableStorage instead of
14475 * codegen.cs (VariableStorage): New class used by clients that
14476 require a variable stored: locals or fields for variables that
14477 need to live across yield.
14479 Maybe provide a convenience api for EmitThis+EmitLoad?
14481 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14484 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14486 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14487 RemapParameterLValue): New methods that are used to turn a
14488 precomputed FieldInfo into an expression like this:
14492 The idea is to use this instead of making LocalVariableReference
14493 have more than one meaning.
14495 * cs-parser.jay: Add error production to BASE.
14497 * ecore.cs: Deal with TypeManager.GetField returning null, which
14498 is now a valid return value.
14500 (FieldExprNoAddress): New expression for Fields whose address can
14503 * expression.cs (LocalVariableReference): During the resolve
14504 phases, create new expressions if we are in a remapping context.
14505 Remove code that dealt with remapping here.
14507 (ParameterReference): same.
14509 (ProxyInstance): New expression, like the `This' expression, but
14510 it is born fully resolved. We know what we are doing, so remove
14511 the errors that are targeted to user-provided uses of `this'.
14513 * statement.cs (Foreach): our variable is now stored as an
14514 Expression; During resolution, follow the protocol, dont just
14515 assume it will return this.
14517 2003-08-06 Martin Baulig <martin@ximian.com>
14519 * support.cs (SeekableStreamReader.cs): New public class.
14521 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14522 SeekableStreamReader instead of the normal StreamReader.
14524 2003-08-04 Martin Baulig <martin@ximian.com>
14526 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14527 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14528 deambiguate casts and delegate invocations.
14529 (parenthesized_expression): Use the new tokens to ensure this is
14530 not a cast of method invocation.
14532 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14533 when reading a `)' and Deambiguate_CloseParens () was previously
14536 * expression.cs (ParenthesizedExpression): New class. This is
14537 just used for the CS0075 test.
14538 (Binary.DoResolve): Check for CS0075.
14540 2003-07-29 Ravi Pratap <ravi@ximian.com>
14542 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14543 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14544 reference comparison.
14546 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14547 examine the ReturnType for equality - this is necessary in the
14548 cases of implicit and explicit operators whose signature also
14549 includes the return type.
14551 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14553 * namespace.cs: Cache the result of the namespace computation,
14554 instead of computing it every time.
14556 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14558 * decl.cs: Use a global arraylist that we reuse over invocations
14559 to avoid excesive memory consumption. Reduces memory usage on an
14560 mcs compile by one meg (45 average).
14562 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14563 private, work around that.
14565 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14567 * literal.cs (IntLiteral): Define Zero and One static literals.
14569 * cs-parser.jay (integer_literal): use static literals to reduce
14570 memory usage for the most used literals (0, 1 and -1). 211kb
14571 reduced in memory usage.
14573 Replace all calls to `new ArrayList' with `new
14574 ArrayList(4)' which is a good average number for most allocations,
14575 and also requires only 16 bytes of memory for its buffer by
14578 This reduced MCS memory usage in seven megabytes for the RSS after
14581 2003-07-28 Ravi Pratap <ravi@ximian.com>
14583 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14584 handle params methods the correct way by forming only one
14585 applicable set with params and normal methods in them. Earlier we
14586 were looking at params methods only if we found no normal methods
14587 which was not the correct thing to do.
14589 (Invocation.BetterFunction): Take separate arguments indicating
14590 when candidate and the best method are params methods in their
14593 This fixes bugs #43367 and #46199.
14595 * attribute.cs: Documentation updates.
14597 (CheckAttribute): Rename to CheckAttributeTarget.
14598 (GetValidPlaces): Rename to GetValidTargets.
14600 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14601 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14605 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14607 * codegen.cs: Compute IsGeneric correctly.
14609 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14612 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14613 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14614 regressions, and I was chasing more bugs than I required.
14616 * interface.cs: Use expressions for base type names (like classes
14617 and structs have been doing for a while now), and resolve that.
14618 This patch should probably go into head as well.
14620 This makes it one less user of FindType.
14622 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14624 This compiler can not self host currently. Need to fix that.
14626 * Makefile: compile to `gmcs.exe'
14628 * driver.cs: Turn on v2 by default on gmcs.
14630 * generic.cs (ConstructedType): Does no longer take a container
14631 type argument; That will be taken care of later.
14633 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14634 Use SimpleName to resolve for now, so we can continue the work on
14635 the parser, until we get Type.GetType that understands generics.
14637 (ConstructedType.ToString): Implement
14639 (TypeArguments.Resolve): Resolve the child expressions as types.
14641 * cs-parser.jay: Rename interface_constraints to
14642 type_parameter_constraints
14644 (namespace_or_type_name): Only use constructed types for the basic
14645 construction, we will deal with identifier<...> later.
14647 (type/type_name): No longer call DecomposeQI, as
14648 namespace_or_type_name is always decoded now.
14650 2003-07-22 Ravi Pratap <ravi@ximian.com>
14652 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14653 closely: we eliminate methods in base types when we have an
14654 applicable method in a top-level type.
14656 Please see section 14.5.5.1 for an exact description of what goes
14659 This fixes bug #45127 and a host of other related to corlib compilation.
14661 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14662 array is the method corresponding to the top-level type (this is
14663 because of the changes made to icall.c) so we change this
14666 (MethodGroupExpr.Name): This too.
14668 * typemanager.cs (GetElementType): New method which does the right
14669 thing when compiling corlib.
14671 * everywhere: Make use of the above in the relevant places.
14673 2003-07-22 Martin Baulig <martin@ximian.com>
14675 * cs-parser.jay (invocation_expression): Moved
14676 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14677 `cast_expression', but create a InvocationOrCast which later
14678 resolves to either an Invocation or a Cast.
14680 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14681 method; call this before EmitStatement() to make sure that this
14682 expression can be used as a statement.
14684 * expression.cs (InvocationOrCast): New class; resolves to either
14685 an Invocation or a Cast.
14687 * statement.cs (StatementExpression): Call ResolveStatement() on
14688 the ExpressionStatement before emitting it.
14690 2003-07-21 Martin Baulig <martin@ximian.com>
14692 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14693 `ref' and `out' attributes match; fixes #46220.
14694 (MemberAccess.ResolveMemberAccess): You can't reference a type
14695 through an expression; fixes #33180.
14696 (Indexers.GetIndexersForType): Don't return the indexers from
14697 interfaces the class implements; fixes #46502.
14699 2003-07-21 Martin Baulig <martin@ximian.com>
14701 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14702 CS0661 checks; fixes bug #30442.
14704 2003-07-21 Martin Baulig <martin@ximian.com>
14706 * decl.cs (AdditionResult): Added `Error'.
14708 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14710 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14711 cs0031.cs actually work.
14713 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14715 * cs-parser.jay (namespace_name): do not use
14716 namespace_or_type_name, use qualified_identifier, because
14717 namespace_or_type_name will soon return a composed expression
14718 instead of a string.
14720 (namespace_or_type_name): Instead of returning a string, now this
14721 production returns an expression.
14723 * codegen.cs (EmitContext): Setup IsGeneric property based on
14724 whether our DeclSpace is generic, our the method is generic.
14726 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14727 the method is generic.
14729 * cs-parser.jay (type_arguments, opt_type_argument_list,
14730 type_parameters, type_parameter_list, opt_type_parameter_list,
14731 type_parameter,, opt_type_parameter_constraints_clauses,
14732 type_parameter_constraints_clauses,
14733 type_parameter_constraint_clause, type_parameter_constraint,
14734 interface_constraints): Add new production
14736 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14737 DeclSpace is generic or not.
14739 (DeclSpace.SetParameterInfo): New routine, used to set the
14740 parameter info for a type.
14742 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14743 returns a GenericTypeExpr
14745 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14746 generic, lookup the generic argument.
14748 * attribute.cs: Do not allow TypeParameterExpressions in
14751 * class.cs: Do not allow the Main method to be defined in a
14754 * expression.cs (SizeOf): Do not allow generic types to be used as
14755 arguments to sizeof.
14757 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14758 it: whether a type is generic or not. Only works for types we are
14759 currently building for now.
14761 2003-07-20 Martin Baulig <martin@ximian.com>
14763 * namespace.cs: Fixed that bug which caused a crash when compiling
14764 the debugger's GUI.
14766 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14768 * typemanager.cs (LookupTypeReflection): Never expose types which
14769 are NotPublic, NestedPrivate, NestedAssembly, or
14770 NestedFamANDAssem. We used to return these, and later do a check
14771 that would report a meaningful error, but the problem is that we
14772 would not get the real match, if there was a name override.
14774 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14776 * namespace.cs (Namespace, Name): Do not compute the namespace
14777 name dynamically, compute it in the constructor. This reduced
14778 memory usage by 1697 KB.
14780 * driver.cs: Use --pause to pause at the end.
14782 2003-07-17 Peter Williams <peter@newton.cx>
14784 * Makefile: Change the name of the test target so that it doesn't
14785 conflict with the recursive test target.
14787 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14789 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14790 AddressOf): Do not use EmitThis, that was wrong, use the actual
14793 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14795 * class.cs (MethodData.Define): While checking if a method is an
14796 interface implementation, improve the test: If we are not public
14797 (use new test here: use the computed MethodAttributes directly,
14798 instead of the parsed modifier flags) check if the `implementing'
14799 method comes from an interface or not.
14801 * pending.cs (VerifyPendingMethods): Slightly better error
14804 * makefile: add test target that does the mcs bootstrap.
14806 2003-07-16 Ravi Pratap <ravi@ximian.com>
14808 * interface.cs (Define): Do nothing here since there are no
14809 members to populate etc. Move the attribute emission out of here
14810 since this was just totally the wrong place to put it. Attribute
14811 application happens during the 'Emit' phase, not in the 'Define'
14814 (Emit): Add this method and move the attribute emission here
14816 * rootcontext.cs (EmitCode): Call the Emit method on interface
14819 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14821 * expression.cs (OverloadResolve): Report error only if Location
14822 is not 'Null' which means that there was a probe going on.
14824 2003-07-14 Martin Baulig <martin@ximian.com>
14826 * expression.cs (ConditionalLogicalOperator): New public class to
14827 implement user defined conditional logical operators.
14828 This is section 14.11.2 in the spec and bug #40505.
14830 2003-07-14 Martin Baulig <martin@ximian.com>
14832 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14834 2003-07-14 Martin Baulig <martin@ximian.com>
14836 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14838 * ecore.cs (IVariable.VerifyFixed): New interface method.
14840 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14841 operator, check whether the variable is actually fixed. Fixes bug
14842 #36055. Set a variable definitely assigned when taking its
14843 address as required by the spec.
14845 * statement.cs (LocalInfo.IsFixed): New field.
14846 (LocalInfo.MakePinned): Set `IsFixed' to true.
14848 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14850 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14851 for .ctors, ensure that we only ask for members declared in the
14852 attribute type (BindingFlags.DeclaredOnly).
14856 * expression.cs (Error_WrongNumArguments): Report error 1501
14857 correctly the way CSC does.
14859 2003-07-13 Martin Baulig <martin@ximian.com>
14861 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14862 lookup on the fully qualified name, to make things like "X.X" work
14863 where "X.X" is a fully qualified type name, but we also have a
14864 namespace "X" in the using list. Fixes #41975.
14866 2003-07-13 Martin Baulig <martin@ximian.com>
14868 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14869 function. If we're a CompoundAssign, we need to create an embedded
14870 CompoundAssign, not an embedded Assign.
14871 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14874 2003-07-13 Martin Baulig <martin@ximian.com>
14876 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14877 work to fix bug #46088.
14879 2003-07-13 Ravi Pratap <ravi@ximian.com>
14881 * class.cs (Operator.Emit): Do not emit attributes here - it is
14882 taken care of by the Method class that we delegate too. This takes
14883 care of bug #45876.
14885 2003-07-10 Martin Baulig <martin@ximian.com>
14887 * expression.cs (TypeOfVoid): New class.
14888 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14890 2003-07-10 Martin Baulig <martin@ximian.com>
14892 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14895 2003-07-10 Martin Baulig <martin@ximian.com>
14897 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14898 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14900 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14902 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14904 2003-07-10 Martin Baulig <martin@ximian.com>
14906 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14907 of decimal. Fixes #42850.
14909 NOTE: I also fixed the created byte blob, but this doesn't work on
14910 the MS runtime and csc never produces any byte blobs for decimal
14913 2003-07-10 Martin Baulig <martin@ximian.com>
14915 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14916 structs; fixes #32068.
14917 (Block.AddChildVariableNames): Fixed #44302.
14919 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14921 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14923 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14925 * attribute.cs: And this test is onger needed.
14927 2003-07-08 Martin Baulig <martin@ximian.com>
14929 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14930 inaccessible types. Fixes #36313.
14932 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14934 * namespace.cs (NamespaceEntry): Create implicit entries for all
14935 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14936 implicit entries for N1.N2 and N1.
14938 2003-07-08 Martin Baulig <martin@ximian.com>
14940 Rewrote the handling of namespaces to fix a lot of the issues
14941 wrt. `using' aliases etc.
14943 * namespace.cs (Namespace): Splitted this class into a
14944 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14946 * typemanager.cs (TypeManager.IsNamespace): Removed.
14947 (TypeManager.ComputeNamespaces): Only compute namespaces from
14948 loaded assemblies here, not the namespaces from the assembly we're
14949 currently compiling.
14951 2003-07-08 Martin Baulig <martin@ximian.com>
14953 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14955 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14957 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14960 I thought about the memory savings here, but LookupTypeReflection
14961 is used under already very constrained scenarios. Compiling
14962 corlib or mcs only exposes one hit, so it would not really reduce
14963 any memory consumption.
14965 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14967 * typemanager.cs: fixes bug #45889 by only adding public types from
14968 other assemblies to the list of known types.
14970 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14972 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14973 on the type we resolved.
14975 2003-07-05 Martin Baulig <martin@ximian.com>
14977 * pending.cs (PendingImplementation.ParentImplements): Don't
14978 create the proxy if the parent is abstract.
14980 * class.cs (TypeContainer.DefineIndexers): Process explicit
14981 interface implementations first. Fixes #37714.
14983 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14985 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14986 defined recursively; but since we modify the input parameters
14987 (left is set to `this' temporarily), we reset this value if the
14988 left_is_explicit is false, which gives the original semantics to
14991 * literal.cs (NullPointer): new class used to represent a null
14992 literal in a pointer context.
14994 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14995 type is a pointer, use a NullPointer object instead of a
14996 NullLiteral. Closes 43687
14998 (ExplicitConversion): Convert pointer values using
14999 the conv opcode to the proper type.
15001 * ecore.cs (New): change ValueTypeVariable property into a method,
15002 that returns whether the valuetype is suitable for being used.
15004 * expression.cs (Binary.DoNumericPromotions): Only return if we
15005 the int constant was a valid uint, and we can return both left and
15006 right as uints. If not, we continue processing, to trigger the
15007 type conversion. This fixes 39018.
15009 * statement.cs (Block.EmitMeta): During constant resolution, set
15010 the CurrentBlock property on the emitcontext, so that we resolve
15011 constants propertly.
15013 2003-07-02 Martin Baulig <martin@ximian.com>
15015 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15016 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15018 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15019 than emitting it here.
15021 * statement.cs: Fixed some more flow analysis bugs.
15023 2003-07-02 Martin Baulig <martin@ximian.com>
15025 * class.cs (MethodData.Define): When implementing interface
15026 methods, set Final unless we're Virtual.
15028 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15029 check work for interface methods.
15031 2003-07-01 Martin Baulig <martin@ximian.com>
15033 * ecore.cs (EmitContext.This): Replaced this property with a
15034 GetThis() method which takes a Location argument. This ensures
15035 that we get the correct error location for a CS0188.
15037 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15039 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15040 ImplicitStandardConversion.
15042 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15044 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15046 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15049 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15051 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15054 (MethodData.Define): Turn off initlocals for unsafe methods.
15056 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15058 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15059 complete; Fixes #37521.
15061 * delegate.cs: Use Modifiers.TypeAttr to compute the
15062 TypeAttributes, instead of rolling our own. This makes the flags
15063 correct for the delegates.
15065 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15067 * class.cs (Constructor.Define): Set the private flag for static
15068 constructors as well.
15070 * cs-parser.jay (statement_expression): Set the return value to
15071 null, to avoid a crash when we catch an error.
15073 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15075 * cs-parser.jay: Applied patch from Jackson that adds support for
15076 extern and unsafe modifiers to destructor declarations.
15078 * expression.cs: Report error 21 if the user is trying to index a
15081 * driver.cs: Add an error message, suggested by the bug report.
15083 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15084 if we do not have a ": this ()" constructor initializer. Fixes 45149
15086 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15088 * namespace.cs: Add some information to reduce FAQs.
15090 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15092 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15093 underlying enumeration types. Fixes #43915.
15095 * expression.cs: Treat ushort/short as legal values to be used in
15096 bitwise operations.
15098 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15100 * delegate.cs: transfer custom attributes for paramenters from
15101 the delegate declaration to Invoke and BeginInvoke.
15103 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15105 * attribute.cs: handle custom marshalers and emit marshal info
15108 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15110 * makefile.gnu: Added anonymous.cs to the compiler sources.
15112 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15114 * iterators.cs: Change the name of the proxy class to include two
15117 * cs-parser.jay: Update grammar to include anonymous methods.
15119 * anonymous.cs: new file.
15121 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15123 * class.cs (Field.Define): Add missing test for pointers and
15126 2003-05-27 Ravi Pratap <ravi@ximian.com>
15128 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15129 we use the stobj opcode.
15131 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15132 since it wasn't the correct fix.
15134 It still is puzzling that we are required to use stobj for IntPtr
15135 which seems to be a ValueType.
15137 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15139 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15140 during regular simple name resolution. Now, the trick is that
15141 instead of returning for processing the simplename, we do a
15142 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15143 contextual lookup type). If a match is found, return that, if
15144 not, return for further composition.
15146 This fixes long-standing 30485.
15148 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15149 using the address to initialize an object, do an Stobj instead of
15150 using the regular Stelem.
15152 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15153 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15154 Because if we are a BaseIndexerAccess that value will be true.
15157 * statement.cs (GotoCase.Resolve): Return after reporting an
15158 error, do not attempt to continue.
15160 * expression.cs (PointerArithmetic.Emit): If our operand is a
15161 long, convert our constants to match the operand before
15162 multiplying. Convert to I type before adding. Fixes 43670.
15164 2003-05-14 Ravi Pratap <ravi@ximian.com>
15166 * enum.cs (ImplicitConversionExists) : Rename to
15167 ImplicitEnumConversionExists to remove ambiguity.
15169 * ecore.cs (NullCast): New type of cast expression class which
15170 basically is very similar to EmptyCast with the difference being
15171 it still is a constant since it is used only to cast a null to
15173 (eg. (string) null)
15175 * convert.cs (ImplicitReferenceConversion): When casting a null
15176 literal, we return a NullCast.
15178 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15179 should be around anymore.
15181 The renaming (reported was slightly wrong). Corrections:
15183 ConvertImplicitStandard -> ImplicitConversionStandard
15184 ConvertExplicitStandard -> ExplicitConversionStandard
15186 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15187 before passing them in !
15189 * convert.cs (ImplicitConversionStandard): When comparing for
15190 equal expr and target types, ensure that expr is not a
15193 In general, we must not be checking (expr_type ==
15194 target_type) in the top level conversion methods
15195 (ImplicitConversion, ExplicitConversion etc). This checking is
15196 done in the methods that they delegate to.
15198 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15200 * convert.cs: Move Error_CannotConvertType,
15201 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15202 ImplicitNumericConversion, ImplicitConversionExists,
15203 ImplicitUserConversionExists, StandardConversionExists,
15204 FindMostEncompassedType, FindMostSpecificSource,
15205 FindMostSpecificTarget, ImplicitUserConversion,
15206 ExplicitUserConversion, GetConversionOperators,
15207 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15208 TryImplicitIntConversion, Error_CannotConvertImplicit,
15209 ConvertImplicitRequired, ConvertNumericExplicit,
15210 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15211 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15214 Perform the following renames:
15216 StandardConversionExists -> ImplicitStandardConversionExists
15217 ConvertImplicit -> ImplicitConversion
15218 ConvertImplicitStandard -> ImplicitStandardConversion
15219 TryImplicitIntConversion -> ImplicitIntConversion
15220 ConvertImplicitRequired -> ImplicitConversionRequired
15221 ConvertNumericExplicit -> ExplicitNumericConversion
15222 ConvertReferenceExplicit -> ExplicitReferenceConversion
15223 ConvertExplicit -> ExplicitConversion
15224 ConvertExplicitStandard -> ExplicitStandardConversion
15226 2003-05-19 Martin Baulig <martin@ximian.com>
15228 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15229 (TypeInfo): Added support for structs having structs as fields.
15231 * ecore.cs (FieldExpr): Implement IVariable.
15232 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15233 VariableInfo for the field.
15235 2003-05-18 Martin Baulig <martin@ximian.com>
15237 * expression.cs (This.DoResolve): Report a CS0027 if we're
15238 emitting a field initializer.
15240 2003-05-18 Martin Baulig <martin@ximian.com>
15242 * expression.cs (This.ResolveBase): New public function.
15243 (This.DoResolve): Check for CS0188.
15245 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15248 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15249 `instance_expression' to null if we don't have any non-static
15252 2003-05-18 Martin Baulig <martin@ximian.com>
15254 Reworked the way how local variables and parameters are handled by
15255 the flow analysis code.
15257 * statement.cs (TypeInfo, VariableMap): New public classes.
15258 (VariableInfo): New public class. This is now responsible for
15259 checking whether a variable has been assigned. It is used for
15260 parameters and local variables.
15261 (Block.EmitMeta): Take the InternalParameters as argument; compute
15262 the layout of the flow vectors here.
15263 (Block.LocalMap, Block.ParameterMap): New public properties.
15264 (FlowBranching): The .ctor doesn't get the InternalParameters
15265 anymore since Block.EmitMeta() now computes the layout of the flow
15267 (MyStructInfo): This class is now known as `StructInfo' and nested
15268 in `TypeInfo'; we don't access this directly anymore.
15270 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15271 property and removed IsAssigned(), IsFieldAssigned(),
15272 SetAssigned() and SetFieldAssigned(); we now call them on the
15273 VariableInfo so we don't need to duplicate this code everywhere.
15275 * expression.cs (ParameterReference): Added `Block block' argument
15277 (LocalVariableReference, ParameterReference, This): The new
15278 VariableInfo class is now responsible for all the definite
15281 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15282 IsParameterAssigned, SetParameterAssigned): Removed.
15284 2003-05-18 Martin Baulig <martin@ximian.com>
15286 * typemanager.cs (InitCoreTypes): Try calling
15287 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15288 the 3-args-version. Corlib now also needs our `void_type'.
15289 (GetMethod): Added overloaded version which takes an optional
15290 `bool report_errors' to allow lookups of optional methods.
15292 2003-05-12 Martin Baulig <martin@ximian.com>
15294 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15295 only used for locals and not for parameters.
15297 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15299 * support.cs (InternalParameters.ParameterType): Return the
15300 ExternalType of the parameter.
15302 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15305 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15307 * class.cs (MethodData.Define): Do not set the `newslot' on
15308 interface members, if they are also flagged as "override".
15310 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15311 better code for ++i and i++. This only works for static fields
15312 and local variables.
15314 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15315 want to pull the DeclSpace out of the builder_to_declspace instead
15316 of the TypeBuilder (like in TypeContainer.FindMembers).
15318 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15319 instead of LookupTypeContainer. Fixes the crash on .NET for
15320 looking up interface members.
15322 * const.cs: Create our own emit context during the Definition
15323 stage, so that constants are evaluated in the proper context, when
15324 a recursive definition happens.
15326 2003-05-11 Martin Baulig <martin@ximian.com>
15328 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15329 new block for a switch section.
15330 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15331 the adding/lookup in the switch block. Fixes #39828.
15333 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15335 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15336 functionality: I needed to convert the data after I had performed
15337 the add/sub operation into the operands type size.
15339 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15340 pass the type for the box operation, otherwise the resulting
15341 object would have been of type object.
15343 (BoxedCast): Add constructor to specify the type to box as.
15345 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15347 * iterators.cs: I was reusing the `count' variable inadvertently,
15348 take steps to not allow this to happen.
15350 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15352 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15353 by creating an array at the point where the params starts and
15354 putting all those arguments there, then adjusting the size of the
15357 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15359 * expression.cs (New.AddressOf): Implement interface
15360 IMemoryLocation. This is used when the `new' operator is used in
15361 the context of an invocation to a method on a value type.
15363 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15366 * namespace.cs: Also check the using aliases here.
15368 * driver.cs: Move the test for using validity after the types have
15369 been entered, so we do a single pass that also includes the using
15372 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15373 in the regular case. CreateSiblingForFinally is doing extra
15376 * attribute.cs (GetAttributeArgumentExpression): Store the result
15377 on an out value, and use the return value to indicate failure
15378 instead of using null (which is a valid return for Constant.GetValue).
15380 * statement.cs: Perform the analysis flow for the increment
15381 portion after the statement, because this will be the real flow of
15382 execution. Fixes #42385
15384 * codegen.cs (EmitContext.EmitArgument,
15385 EmitContext.EmitStoreArgument): New helper functions when the
15386 RemapToProxy flag is set.
15388 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15391 Add support for remapping parameters.
15393 * iterators.cs: Propagate parameter values; Store parameter
15394 values in the proxy classes.
15396 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15398 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15399 need a proxy reference; I do not know what I was thinking
15401 * cs-parser.jay (constructor_initializer): catch another error,
15402 and display nice message.
15404 (field_declaration): catch void field declaration
15405 to flag a better error.
15407 * class.cs (MemberBase.CheckBase): Report an error instead of a
15408 warning if a new protected member is declared in a struct.
15409 (Field.Define): catch the error of readonly/volatile.
15411 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15413 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15414 volatile variable is taken
15416 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15418 * statement.cs (Fixed.Resolve): Report an error if we are not in
15421 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15423 * typemanager.cs: reuse the code that handles type clashes for
15424 delegates and enumerations.
15426 * class.cs (Report28): Always report.
15428 * expression.cs (EncodeAsAttribute): Allow nulls here.
15430 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15432 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15433 the functionality for testing whether an expression is valid for
15434 an attribute here. Also handle the case of arrays of elements
15437 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15438 encoding a linear array into an array of objects that are suitable
15439 to be passed to an CustomAttributeBuilder.
15441 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15443 * ecore.cs: (FieldExpr): Handle field remapping here.
15445 * iteratators.cs: Pass the instance variable (if the method is an
15446 instance method) to the constructors, so we can access the field
15447 variables on the class.
15449 TODO: Test this with structs. I think the THIS variable on
15450 structs might have to be a pointer, and not a refenrece
15452 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15454 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15455 local variables to fields in a proxy class.
15457 * iterators.cs (PopulateProxy): Rename our internal fields to
15459 Create a <THIS> field if we are an instance method, so we can
15460 reference our parent container variables.
15461 (MapVariable): Called back from the EmitContext code to enter a
15462 new variable to field mapping into the proxy class (we just create
15466 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15467 for using the remapped locals to fields.
15469 I placed the code here, because that gives the same semantics to
15470 local variables, and only changes the Emit code.
15472 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15473 statements inside iterators.
15474 (VariableInfo): Add a FieldBuilder for the cases when we are
15475 remapping local variables to fields in a proxy class
15477 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15478 current_block != null.
15480 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15481 not cope with strings, as it has been moved to the
15482 TableSwitchEmit. Fixed bug in switch generation.
15484 * expression.cs (New.DoResolve): Provide more context for the user
15485 when reporting an error.
15487 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15490 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15491 check the permissions for it. Note than in a type-resolution
15492 context the check was already present in DeclSpace.ResolveType,
15493 but was missing from the MemberAccess.
15495 (ArrayCreation.CheckIndices): warn if the user has
15496 more nested levels of expressions, but there are no more
15497 dimensions specified. Avoids crash on bug 41906.
15499 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15501 * statement.cs (Block): replace Implicit bool, for a generic
15503 New flag: `Unchecked'. This is used during the EmitMeta phase
15504 (which is out-of-line with the regular Resolve/Emit process for a
15505 statement, as this is done ahead of time, but still gets a chance
15506 to call constant resolve).
15508 (Block.Flags): new enum for adding a new flag.
15510 (Block.EmitMeta): track the state of unchecked.
15512 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15513 to enable constant resolution to work there as well.
15515 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15517 * typemanager.cs (ienumerable_type): Also look up
15518 System.Collections.IEnumerable.
15520 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15522 TODO: Test more than one conditional per method.
15524 * class.cs (Indexer.Define): Report the location where the user is
15525 referencing the unsupported feature.
15527 (MethodData): Overload the use of `conditionals' to
15528 minimize the creation of needless ArrayLists. This saves roughly
15529 212kb on my machine.
15531 (Method): Implement the new IIteratorContainer interface.
15532 (Method.SetYields): Implement the method by setting the ModFlags
15533 to contain METHOD_YIELDS.
15535 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15536 which just got set to null.
15538 * iterators.cs: New file.
15540 (Yield, YieldBreak): New statements.
15542 * statement.cs (Return.Resolve): Flag an error if we are used in
15543 an iterator method.
15545 * codegen.cs (InIterator): New flag set if the code is being
15546 compiled in an iterator method.
15548 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15549 internal modifier, and we just use it to avoid adding extra
15550 fields, as this is seldom used.
15552 * cs-parser.jay: Add yield_statement (yield and yield break).
15554 * driver.cs: New flag -v2 to turn on version 2 features.
15556 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15557 hashtable when v2 is enabled.
15559 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15561 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15562 there is already a namespace defined with this name.
15564 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15565 people upgraded their corlibs.
15567 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15568 always use fully qualified types, no need to use the compiler
15571 (TypeManager.IsNamespace): Use binarysearch.
15573 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15574 AddDelegate): I did not quite use the new IsValid API properly: I
15575 have to pass the short-name and the fullname. I was passing only
15576 the basename instead of the fullname sometimes.
15578 (TypeContainer.DefineType): call NamespaceClash.
15580 * interface.cs (Interface.DefineType): use NamespaceClash before
15583 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15586 * enum.cs: (Enum.DefineType): use NamespaceClash before
15589 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15590 speed increase. First, use the negative_hits cache when we get a
15591 negative. Second, add the type with its full original name
15592 instead of the new . and + encoded name (reflection uses + to
15593 separate type from a nested type). Use LookupTypeReflection
15594 directly which bypasses the type->name hashtable (that we already
15595 know does not contain the type.
15597 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15598 location/container type.
15600 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15602 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15604 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15606 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15607 method is being referenced in the method group from a static
15608 context, and report error 120 if so.
15610 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15613 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15614 is created, we create the A namespace).
15616 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15619 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15621 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15622 invocation to ModuleBuilder.GetType with the same values will
15623 return a new type instance, so we need to cache its return
15626 * expression.cs (Binary.ResolveOperator): Only allow the compare
15627 operators on enums if they are of the same type.
15629 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15630 types of ValueType on their own case. Before we were giving them
15631 the same treatment as objects.
15633 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15634 fullname. Short name is used to compare against container name.
15635 Fullname is used to check against defined namespace names.
15637 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15638 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15640 (Method.CheckBase): Call parent.
15641 (MemberBase.CheckBase): Check for protected members on sealed
15643 (PropertyBase.CheckBase): Call parent.
15644 (Field.Define): Call parent.
15646 * report.cs: Negative error codes are now mapped to 8000 - code,
15647 so that the display is render more nicely.
15649 * typemanager.cs: Do not use try/catch, instead report a regular
15652 (GetPointerType, GetReferenceType): These methods provide
15653 mechanisms to obtain the T* and T& from a T. We had the code
15654 previously scattered around the code base, and it also used
15655 TypeManager.LookupType that would go through plenty of caches.
15656 This one goes directly to the type source.
15658 In some places we did the Type.GetType followed by
15659 ModuleBuilder.GetType, but not in others, so this unifies the
15660 processing as well.
15662 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15663 statements now that we have namespace information.
15665 * typemanager.cs (IsNamespace): New method, returns whether the
15666 string presented is a namespace or not.
15668 (ComputeNamespaces): New public entry point, computes the list of
15669 available namespaces, using the GetNamespaces API call in Mono, or
15670 the slower version in MS.NET.
15672 Now before we start the semantic analysis phase, we have a
15673 complete list of namespaces including everything that the user has
15676 Deleted old code to cache namespaces in .nsc files.
15678 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15680 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15681 class/struct location definition Location for the implicit
15682 constructor location.
15684 (Operator.Define): Use the location of the operator for the
15685 implicit Method definition.
15687 (Constructor.Emit): use the constructor location for the implicit
15688 base initializer constructor.
15690 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15691 and the Expression class now contains two new methods:
15693 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15694 isolate type lookup from the rest of the resolution process.
15696 Since we use Expressions to hold type definitions due to the way
15697 we parse the input we have historically overloaded Resolve to
15698 perform the Type lookups if a special flag is passed. Now this is
15699 eliminated and two methods take their place.
15701 The differences in the two methods between xStep and xTerminal is
15702 that xStep is involved in our current lookup system that uses
15703 SimpleNames to compose a name, while xTerminal is used just to
15704 catch the case where the simplename lookup failed.
15706 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15708 * expression.cs (ResolveMemberAccess): Remove redundant code.
15709 TypeExpr expressions are always born fully resolved.
15711 * interface.cs (PopulateMethod): Do not lookup the types twice.
15712 We were doing it once during SemanticAnalysis and once during
15715 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15716 in local variable type definitions, were being returned as a
15717 SimpleName (we decomposed everything into a string), that is
15718 because primary_expression was being used instead of a type in the
15719 grammar (reduce/reduce conflicts).
15721 The part that was wrong is that we converted the expression into a
15722 string (an oversimplification in one hand, compounded with primary
15723 expressions doing string concatenation).
15729 Would return "A.B.C[]" as a SimpleName. This stopped things like
15730 using clauses from working on this particular context. And a type
15731 was being matched directly against "A.B.C[]".
15733 We now use the correct approach, and allow for ComposedCast to be
15734 part of the unary expression. So the "A.B.C []" become a composed
15735 cast of "A.B.C" (as a nested group of MemberAccess with a
15736 SimpleName at the end) plus the rank composition "[]".
15740 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15742 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15743 for the access level checking.
15745 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15746 `TypeContainer container', because I kept getting confused when I
15747 was debugging this code.
15749 * expression.cs (Indexers): Instead of tracking getters/setters,
15750 we now track them in parallel. We create one arraylist less, but
15751 most importantly it is possible now for the LValue code to find a
15752 matching get for a set.
15754 (IndexerAccess.DoResolveLValue): Update the code.
15755 GetIndexersForType has been modified already to extract all the
15756 indexers from a type. The code assumed it did not.
15758 Also make the code set the correct return type for the indexer.
15759 This was fixed a long time ago for properties, but was missing for
15760 indexers. It used to be void_type.
15762 (Binary.Emit): Test first for doubles instead of
15763 floats, as they are more common.
15765 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15766 when dealing with floats and the <=, >= operators. This fixes bug
15769 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15770 to load the array value by emitting a load on the foreach variable
15771 type. This was incorrect.
15773 We now emit the code to load an element using the the array
15774 variable type, and then we emit the conversion operator.
15778 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15780 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15782 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15784 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15785 test for protection before we test for signatures.
15787 (MethodSignature.ToString): implement.
15789 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15790 to the case where we reduced into a LongConstant.
15792 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15793 depend on whether the information is acurrate, because the
15794 Microsoft runtime will always claim that the array type is public,
15795 regardless of the real state.
15797 If the type is a pointer, another problem happens: the type is
15798 reported as non-public in Microsoft.
15800 In both cases we have to call CheckAccessLevel recursively with
15801 the underlying type as the argument to be tested.
15803 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15805 * assign.cs (Assign.Emit): If we are dealing with a compound
15806 assignment expression, we should use the code path that stores the
15807 intermediate result in a temporary value. This fixes #40903.
15809 *expression.cs (Indirection.ToString): Provide ToString method for
15812 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15814 * class.cs: Null out fields holding references to Block objects so
15815 they can be garbage collected.
15817 * expression.cs (OverloadResolve): Remove unused local.
15819 2003-04-07 Martin Baulig <martin@ximian.com>
15821 * codegen.cs (EmitContext.CurrentFile): New public field.
15822 (EmitContext.Mark): Use the CurrentFile to check whether the
15823 location is in the correct file.
15824 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15826 2003-04-07 Martin Baulig <martin@ximian.com>
15828 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15830 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15831 location. [FIXME: The location argument which gets passed to this
15832 method is sometimes wrong!]
15834 2003-04-07 Nick Drochak <ndrochak@gol.com>
15836 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15838 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15840 * expression.cs (Indirection.EmitAssign): We were using the
15841 temporary, but returning immediately instead of continuing the
15844 2003-04-06 Martin Baulig <martin@ximian.com>
15846 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15847 if it's a nested child, but also deriving from the outer class.
15850 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15851 nested child, but also deriving from the outer class. See
15853 (FilterWithClosure): We may access private members of the outer
15854 class if we're a nested child and deriving from the outer class.
15855 (RealMemberLookup): Only set `closure_private_ok' if the
15856 `original_bf' contained BindingFlags.NonPublic.
15858 2003-04-05 Martin Baulig <martin@ximian.com>
15860 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15861 probe if its a type parameter, and if so, flag an error.
15863 * decl.cs: Move here the SetParameterInfo code from class.cs.
15864 Handle IsGeneric here.
15866 Handle a variety of errors in the parameter info definition.
15868 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15869 type parameters here.
15871 * cs-parser.jay (class_declaration): report errors for parameters
15874 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15876 * generic.cs: New file, contains support code for generics.
15878 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15879 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15881 Update parser for the above removals.
15883 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15884 now taken care of in the parser.
15886 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15888 * class.cs (Event.Define): Do not allow abstract events to have
15891 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15893 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15894 block in event declarations.
15896 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15897 value type, get its address.
15899 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15900 leaving a class on the stack instead of a boolean value (int
15901 0/1). Change the code so we compare against null, and then the
15902 result against zero.
15904 * class.cs (TypeContainer.GetClassBases): We were checking for the
15905 parent class being sealed too late.
15907 * expression.cs (Binary.Emit): For <= and >= when dealing with
15908 floating point values, use cgt.un and clt.un instead of cgt and
15911 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15913 * statement.cs: Apply the same optimization as MS: skip the
15914 GetEnumerator returning an IEnumerator, and use the one returning a
15915 CharEnumerator instead. This allows us to avoid the try-finally block
15918 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15920 * cs-parser.jay: Attributes cannot be applied to
15921 namespaces. Fixes #40473
15923 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15926 (Add*): check if the name is valid using the full name for constants,
15927 fields, properties and events.
15929 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15931 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15932 char constants to be part of the enumeration.
15934 * expression.cs (Conditional.DoResolve): Add support for operator
15935 true. Implements the missing functionality from 14.12
15937 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15938 operator true/false as required by the spec.
15940 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15941 implicit conversion to boolean.
15943 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15944 also one where the type implements `operator true'.
15946 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15947 get an expression that will invoke operator true based on an
15950 (GetConversionOperators): Removed the hack that called op_True
15953 (Expression.ResolveBoolean): Move this from Statement.
15955 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15957 * ecore.cs (FieldExpr): do not allow initialization of initonly
15958 fields on derived classes
15960 2003-03-13 Martin Baulig <martin@ximian.com>
15962 * statement.cs (Block.Emit): Call ig.BeginScope() and
15963 ig.EndScope() when compiling with debugging info; call
15964 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15966 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15968 * expression.cs (Indexers): Do not construct immediately, allow
15969 for new members to be appended as we go. Fixes 38143
15971 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15973 * expression.cs: save/restore context when resolving an unchecked
15976 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15978 * cfold.cs: Catch division by zero in modulus operator during
15981 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15983 * interface.cs (Interface.DefineMembers): Avoid defining members
15986 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15988 * driver.cs: handle the +/- options for -noconfig
15990 * statement.cs (Unckeched.Resolve): Also track the state of
15991 unchecked in the Resolve phase.
15993 2003-02-27 Martin Baulig <martin@ximian.com>
15995 * ecore.cs (Expression.MemberLookup): Don't create a
15996 MethodGroupExpr for something which is not a method. Fixes #38291.
15998 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16000 * class.cs (MemberBase.CheckParameters): Also check that the type
16001 is unmanaged if it is a pointer.
16003 * expression.cs (SizeOf.Resolve): Add location information.
16005 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16006 a managed type is declared.
16008 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16009 parameter modifiers as well. Fixes bug 38606
16011 * class.cs: Very sad. Am backing out the speed up changes
16012 introduced by the ArrayList -> Array in the TypeContainer, as they
16013 were not actually that much faster, and introduced a bug (no error
16014 reports on duplicated methods).
16016 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16017 source first, this will guarantee that we have a valid expression
16018 before calling in lower levels functions that will require a
16019 resolved object. Then use this original_source in the
16020 target.ResolveLValue instead of the original source that was
16023 Another change. Use target.Resolve instead of LValueResolve.
16024 Although we are resolving for LValues, we will let the Assign code
16025 take care of that (it will be called again from Resolve). This
16026 basically allows code like this:
16028 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16029 class Y { void A (X x) { x [0] += o; }
16031 The problem was that the indexer was trying to resolve for
16032 set_Item (idx, object o) and never finding one. The real set_Item
16033 was set_Item (idx, X). By delaying the process we get the right
16038 2003-02-23 Martin Baulig <martin@ximian.com>
16040 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16041 while calling DoEmit ().
16043 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16044 source files; if you use the #line directive inside a method, the
16045 compiler stops emitting line numbers for the debugger until it
16046 reaches the end of the method or another #line directive which
16047 restores the original file.
16049 2003-02-23 Martin Baulig <martin@ximian.com>
16051 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16053 2003-02-23 Martin Baulig <martin@ximian.com>
16055 * statement.cs (Block.AddChildVariableNames): We need to call this
16056 recursively, not just for our immediate children.
16058 2003-02-23 Martin Baulig <martin@ximian.com>
16060 * class.cs (Event.Define): Always make the field private, like csc does.
16062 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16063 actually work, fixes bug #37521.
16065 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16067 * delegate.cs: When creating the various temporary "Parameters"
16068 classes, make sure that we call the ComputeAndDefineParameterTypes
16069 on those new parameters (just like we do with the formal ones), to
16070 allow them to be resolved in the context of the DeclSpace.
16072 This fixes the bug that Dick observed in Bugzilla #38530.
16074 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16076 * expression.cs (ResolveMemberAccess): When resolving a constant,
16077 do not attempt to pull a constant if the value was not able to
16078 generate a valid constant.
16080 * const.cs (LookupConstantValue): Do not report more errors than required.
16082 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16084 * expression.cs: fixes bug #38328.
16086 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16088 * class.cs: Changed all the various members that can be part of a
16089 class from being an ArrayList to be an Array of the right type.
16090 During the DefineType type_list, interface_list, delegate_list and
16091 enum_list are turned into types, interfaces, delegates and enums
16094 And during the member population, indexer_list, event_list,
16095 constant_list, field_list, instance_constructor_list, method_list,
16096 operator_list and property_list are turned into their real arrays.
16098 Although we could probably perform this operation earlier, for
16099 good error reporting we need to keep the lists and remove the
16100 lists for longer than required.
16102 This optimization was triggered by Paolo profiling the compiler
16103 speed on the output of `gen-sample-program.pl' perl script.
16105 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16106 not crash in methods like MemberLookupFailed that use this field.
16108 This problem arises when the compiler fails to resolve a type
16109 during interface type definition for example.
16111 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16113 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16114 inherit from System.Object, so we have to stop at null, not only
16115 when reaching System.Object.
16117 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16119 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16120 DeclaredOnly because the parent indexer might have had a different
16121 name, but did not loop until the top of the hierarchy was reached.
16123 The problem this one fixes is 35492: when a class implemented an
16124 indexer from an interface, we were getting the interface method
16125 (which was abstract) and we were flagging an error (can not invoke
16128 This also keeps bug 33089 functioning, and test-148 functioning.
16130 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16131 out if a method is special is to see if it is declared in a
16132 property or event, or whether it is one of the predefined operator
16133 names. This should fix correctly #36804.
16135 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16137 The goal here is to remove the dependency on EmptyCast.Peel ().
16138 Killing it completely.
16140 The problem is that currently in a number of places where
16141 constants are expected, we have to "probe" for an EmptyCast, and
16142 Peel, which is not the correct thing to do, as this will be
16143 repetitive and will likely lead to errors.
16145 The idea is to remove any EmptyCasts that are used in casts that
16146 can be reduced to constants, so we only have to cope with
16149 This bug hunt was triggered by Bug 37363 and the desire to remove
16150 the duplicate pattern where we were "peeling" emptycasts to check
16151 whether they were constants. Now constants will always be
16154 * ecore.cs: Use an enumconstant here instead of wrapping with
16157 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16158 throwing me off. By handling this we can get rid of a few hacks.
16160 * statement.cs (Switch): Removed Peel() code.
16162 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16164 * class.cs: Location information for error 508
16166 * expression.cs (New.DoResolve): Add a guard against double
16167 resolution of an expression.
16169 The New DoResolve might be called twice when initializing field
16170 expressions (see EmitFieldInitializers, the call to
16171 GetInitializerExpression will perform a resolve on the expression,
16172 and later the assign will trigger another resolution
16174 This leads to bugs (#37014)
16176 * delegate.cs: The signature for EndInvoke should contain any ref
16177 or out parameters as well. We were not doing this in the past.
16179 * class.cs (Field.Define): Do not overwrite the type definition
16180 inside the `volatile' group. Turns out that volatile enumerations
16181 were changing the type here to perform a validity test, which
16184 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16186 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16187 and structs, we do not want to load the instance variable
16189 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16190 enum_type has to be handled like an object reference (implicit
16191 conversions exists from this to object), but the regular IsClass
16192 and IsValueType tests will never return true for this one.
16194 Also we use TypeManager.IsValueType instead of type.IsValueType,
16195 just for consistency with the rest of the code (this is only
16196 needed if we ever use the construct exposed by test-180.cs inside
16197 corlib, which we dont today).
16199 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16201 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16204 2003-02-09 Martin Baulig <martin@ximian.com>
16206 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16207 (Namespace.DefineNamespaces): New static public method; this is
16208 called when we're compiling with debugging to add all namespaces
16209 to the symbol file.
16211 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16212 pass it to the Namespace's .ctor.
16214 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16215 and MethodBase arguments; pass the namespace ID to the symwriter;
16216 pass the MethodBase instead of the token to the symwriter.
16217 (SymbolWriter.DefineNamespace): New method to add a namespace to
16220 2003-02-09 Martin Baulig <martin@ximian.com>
16222 * symbolwriter.cs: New file. This is a wrapper around
16223 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16224 methods here in near future.
16226 2003-02-09 Martin Baulig <martin@ximian.com>
16228 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16229 ILGenerator.MarkSequencePoint() which are actually used by the
16232 2003-02-09 Martin Baulig <martin@ximian.com>
16234 * location.cs (SourceFile): New public sealed class. This
16235 contains the name and an index which is used in the location's token.
16236 (Location): Reserve an appropriate number of bits in the token for
16237 the source file instead of walking over that list, this gives us a
16238 really huge performance improvement when compiling with debugging.
16240 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16241 `SourceFile' argument instead of a string.
16242 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16243 but don't parse/tokenize here, we need to generate the list of all
16244 source files before we do that.
16245 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16248 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16249 instead of a string.
16251 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16254 2003-02-09 Martin Baulig <martin@ximian.com>
16256 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16257 filename on `#line default'.
16259 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16261 * statement.cs: don't clear the pinned var when the fixed statement
16262 returns from the method (fixes bug#37752).
16264 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16266 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16269 2003-02-07 Martin Baulig <martin@ximian.com>
16271 * driver.cs: Removed the `--debug-args' command line argument.
16273 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16274 automatically by the AsssemblyBuilder.
16275 (CodeGen.InitializeSymbolWriter): We don't need to call any
16276 initialization function on the symbol writer anymore. This method
16277 doesn't take any arguments.
16279 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16281 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16282 from referenced assemblies as well.
16284 2003-02-02 Martin Baulig <martin@ximian.com>
16286 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16288 2003-02-02 Martin Baulig <martin@ximian.com>
16290 * class.cs (Constructor.Emit): Open the symbol writer before
16291 emitting the constructor initializer.
16292 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16293 single-stepping through constructor initializers.
16295 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16297 * class.cs: Handle error 549: do not allow virtual methods in
16300 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16302 * decl.cs: Check access levels when resolving types
16304 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16306 * statement.cs: Add parameters and locals set in catch blocks that might
16307 return to set vector
16309 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16311 * class.cs (Operator): Set the SpecialName flags for operators.
16313 * expression.cs (Invocation.DoResolve): Only block calls to
16314 accessors and operators on SpecialName methods.
16316 (Cast.TryReduce): Handle conversions from char constants.
16319 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16321 * statement.cs: small memory and time optimization in FlowBranching.
16323 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16325 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16326 problem that the last fix but in the other sid (Set).
16328 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16329 access when there is no indexer in the hierarchy.
16331 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16333 * class.cs: Combine some if statements.
16335 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16337 * driver.cs: fixed bug #37187.
16339 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16341 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16342 any indexer, it's needed to build a list with all the indexers in the
16343 hierarchy (AllGetters), else we have problems. Fixes #35653.
16345 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16347 * class.cs (MethodData.Define): It is wrong for an interface
16348 implementation to be static in both cases: explicit and implicit.
16349 We were only handling this in one case.
16351 Improve the if situation there to not have negations.
16353 * class.cs (Field.Define): Turns out that we do not need to check
16354 the unsafe bit on field definition, only on usage. Remove the test.
16356 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16358 * driver.cs: use assembly.Location instead of Codebase (the latest
16359 patch made mcs fail when using MS assemblies).
16361 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16363 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16364 get the path to *corlib.dll.
16366 2003-01-21 Nick Drochak <ndrochak@gol.com>
16370 * typemanager.cs: Remove compiler warnings
16372 2003-01-20 Duncan Mak <duncan@ximian.com>
16374 * AssemblyInfo.cs: Bump the version number to 0.19.
16376 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16378 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16380 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16382 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16384 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16386 * cs-parser.jay: Small fix: we were not comparing the constructor
16387 name correctly. Thanks to Zoltan for the initial pointer.
16389 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16391 * cs-tokenizer.cs: Set file name when specified with #line
16393 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16395 * cs-parser.jay: Only perform the constructor checks here if we
16396 are named like the class; This will help provider a better
16397 error. The constructor path is taken when a type definition is
16398 not found, but most likely the user forgot to add the type, so
16399 report that rather than the constructor error.
16401 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16403 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16406 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16408 * cs-parser.jay: Add cleanup call.
16410 2003-01-13 Duncan Mak <duncan@ximian.com>
16412 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16413 consistent with other methods.
16415 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16417 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16419 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16421 * attribute.cs: only set GuidAttr to true when we have a
16424 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16428 * typemanager.cs: fixes to allow mcs compile corlib with the new
16429 Type.IsSubclassOf fix.
16431 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16433 * expression.cs (LocalVariableReference.DoResolve): Classify a
16434 constant as a value, not as a variable. Also, set the type for
16437 * cs-parser.jay (fixed_statement): take a type instead of a
16438 pointer_type, so we can produce a better error message later.
16440 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16443 (For.DoEmit): Make inifinite loops have a
16444 non-conditional branch back.
16446 (Fixed.DoEmit): First populate the pinned variables, then emit the
16447 statement, then clear the variables. Before I was emitting the
16448 code once for each fixed piece.
16451 2003-01-08 Martin Baulig <martin@ximian.com>
16453 * statement.cs (FlowBranching.MergeChild): A break in a
16454 SWITCH_SECTION does not leave a loop. Fixes #36155.
16456 2003-01-08 Martin Baulig <martin@ximian.com>
16458 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16459 lives in the same number space than `param_map'. Fixes #36154.
16461 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16463 * cs-parser.jay (constructor_declaration): Set the
16464 Constructor.ModFlags before probing for it. This makes the
16465 compiler report 514, 515 and 132 (the code was there, but got
16468 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16469 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16470 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16472 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16474 * enum.cs: create the enum static fields using the enum type.
16476 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16478 * class.cs: don't try to create the ParamBuilder for the return
16479 type if it's not needed (and handle it breaking for the ms runtime
16482 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16484 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16486 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16488 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16489 the command. This showed up while compiling the JANET source
16490 code, which used \r as its only newline separator.
16492 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16494 * class.cs (Method.Define): If we are an operator (because it
16495 reuses our code), then set the SpecialName and HideBySig. #36128
16497 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16499 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16500 exception, report error 120 `object reference required'.
16502 * driver.cs: Add --pause option, used during to measure the size
16503 of the process as it goes with --timestamp.
16505 * expression.cs (Invocation.DoResolve): Do not allow methods with
16506 SpecialName to be invoked.
16508 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16510 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16511 number before adding it.
16513 2002-12-21 Ravi Pratap <ravi@ximian.com>
16515 * ecore.cs (StandardImplicitConversion): When in an unsafe
16516 context, we allow conversion between void * to any other pointer
16517 type. This fixes bug #35973.
16519 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16521 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16522 is not thrown when extensionless outputs are used
16524 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16526 * rootcontext.cs: fixed compilation of corlib.
16528 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16530 * attribute.cs (Attributes.Contains): Add new method.
16532 * class.cs (MethodCore.LabelParameters): if the parameter is an
16533 `out' parameter, check that no attribute `[In]' has been passed.
16535 * enum.cs: Handle the `value__' name in an enumeration.
16537 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16539 * decl.cs: Added special case to allow overrides on "protected
16542 2002-12-18 Ravi Pratap <ravi@ximian.com>
16544 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16545 since it makes much more sense.
16547 (Attributes.ctor): Don't require a Location parameter.
16549 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16551 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16552 since we already have that information per attribute.
16554 * everywhere : make appropriate changes.
16556 * class.cs (LabelParameters): Write the code which actually
16557 applies attributes to the return type. We can't do this on the MS
16558 .NET runtime so we flag a warning in the case an exception is
16561 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16563 * const.cs: Handle implicit null conversions here too.
16565 2002-12-17 Ravi Pratap <ravi@ximian.com>
16567 * class.cs (MethodCore.LabelParameters): Remove the extra
16568 Type [] parameter since it is completely unnecessary. Instead
16569 pass in the method's attributes so that we can extract
16570 the "return" attribute.
16572 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16574 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16575 of ignoring it and letting the compile continue.
16577 * typemanager.cs (ChangeType): use an extra argument to return an
16578 error condition instead of throwing an exception.
16580 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16582 * expression.cs (Unary.TryReduce): mimic the code for the regular
16583 code path. Perform an implicit cast in the cases where we can
16584 implicitly convert to one of the integral types, and then reduce
16585 based on that constant. This fixes bug #35483.
16587 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16589 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16591 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16593 * namespace.cs: fixed bug #35489.
16595 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16597 * class.cs: Remove some dead code.
16599 * cs-parser.jay: Estimate the number of methods needed
16600 (RootContext.MethodCount);
16602 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16603 numbers instead of StringBuilders.
16605 * support.cs (PtrHashtable): Add constructor with initial size;
16606 We can now reduce reallocations of the method table.
16608 2002-12-10 Ravi Pratap <ravi@ximian.com>
16610 * attribute.cs (ApplyAttributes): Keep track of the emitted
16611 attributes on a per-target basis. This fixes bug #35413.
16613 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16615 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16616 default to the Windows 1252 encoding.
16618 (UnixParseOption): Support version, thanks to Alp for the missing
16621 * AssemblyInfo.cs: Add nice assembly information.
16623 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16626 * cs-parser.jay: Allow a trailing comma before the close bracked
16627 in the attribute_section production.
16629 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16630 address of the instance was being taken, I will take this out,
16631 because we take the address of the object immediately here.
16633 2002-12-09 Ravi Pratap <ravi@ximian.com>
16635 * typemanager.cs (AreMultipleAllowed): Take care of the most
16636 obvious case where attribute type is not in the current assembly -
16639 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16641 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16642 definitions, instead of doing that afterwards.
16644 Also we use a nice little hack, depending on the constructor, we
16645 know if we are a "composed" name or a simple name. Hence, we
16646 avoid the IndexOf test, and we avoid
16648 * codegen.cs: Add code to assist in a bug reporter to track down
16649 the source of a compiler crash.
16651 2002-12-07 Ravi Pratap <ravi@ximian.com>
16653 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16654 types have been emitted for a given element and flag an error
16655 if something which does not have AllowMultiple set is used more
16658 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16659 attribute types and their corresponding AllowMultiple properties
16661 (AreMultipleAllowed): Check the property for a given type.
16663 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16664 property in the case we have a TypeContainer.
16666 (Attributes.AddAttribute): Detect duplicates and just skip on
16667 adding them. This trivial fix catches a pretty gross error in our
16668 attribute emission - global attributes were being emitted twice!
16670 Bugzilla bug #33187 is now fixed.
16672 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16674 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16675 instead of pp_and).
16677 * expression.cs (Binary.ResolveOperator): I can only use the
16678 Concat (string, string, string) and Concat (string, string,
16679 string, string) if the child is actually a concatenation of
16682 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16684 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16685 context where we need a 2-character lookahead.
16687 * pending.cs (PendingImplementation): Rework so we can keep track
16688 of interface types all the time, and flag those which were
16689 implemented by parents as optional.
16691 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16693 * expression.cs (Binary.ResolveOperator): Use
16694 String.Concat(string,string,string) or
16695 String.Concat(string,string,string,string) when possible.
16697 * typemanager: More helper methods.
16700 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16702 * pending.cs: remove the bogus return from GetMissingInterfaces()
16703 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16705 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16707 * namespace.cs: avoid duplicated 'using xxx' being added to
16708 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16709 when we get more than one 'using' statement for the same namespace.
16710 Report a CS0105 warning for it.
16712 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16714 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16715 of calling getChar/putback, uses internal knowledge of it.
16717 (xtoken): Reorder tokenizer so most common patterns are checked
16718 first. This reduces the compilation time in another 5% (from 8.11s
16719 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16721 The parsing time is 22% of the compilation in mcs, and from that
16722 64% is spent on the tokenization process.
16724 I tried using a binary search for keywords, but this is slower
16725 than the hashtable. Another option would be to do a couple of
16728 * Not use a StringBuilder, instead use an array of chars,
16729 with a set value. Notice that this way we could catch
16730 the 645 error without having to do it *afterwards*.
16732 * We could write a hand-parser to avoid the hashtable
16733 compares altogether.
16735 The identifier consumption process takes 37% of the tokenization
16736 time. Another 15% is spent on is_number. 56% of the time spent
16737 on is_number is spent on Int64.Parse:
16739 * We could probably choose based on the string length to
16740 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16743 Another 3% is spend on wrapping `xtoken' in the `token' function.
16745 Handle 0xa0 as whitespace (#34752)
16747 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16749 * typemanager.cs (IsCLRType): New routine to tell whether a type
16750 is one of the builtin types.
16752 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16753 typecode in more places instead of doing pointer comparissions.
16754 We could leverage some knowledge about the way the typecodes are
16757 New code to cache namespaces in assemblies, it is currently not
16758 invoked, to be used soon.
16760 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16762 * expression.cs (Binary.ResolveOperator): specially handle
16763 strings, and do not perform user-defined operator overloading for
16766 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16768 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16769 internalcall as it is a pretty simple operation; Avoid whenever
16770 possible to call Char.IsLetter.
16772 (consume_identifier): Cut by half the number of
16773 hashtable calls by merging the is_keyword and GetKeyword behavior.
16775 Do not short-circuit, because if we do, we
16776 report errors (ie, #if false && true would produce an invalid
16780 2002-11-24 Martin Baulig <martin@ximian.com>
16782 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16783 check constant ranges and report a CS0221. Fixes #33186.
16785 2002-11-24 Martin Baulig <martin@ximian.com>
16787 * cs-parser.jay: Make this work for uninitialized variable
16788 declarations in the `for' initializer. Fixes #32416.
16790 2002-11-24 Martin Baulig <martin@ximian.com>
16792 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16793 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16795 2002-11-24 Martin Baulig <martin@ximian.com>
16797 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16798 argument; if true, we also check for user-defined conversions.
16799 This is only needed if both arguments are of a user-defined type.
16800 Fixes #30443, added test-175.cs.
16801 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16803 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16805 2002-11-24 Martin Baulig <martin@ximian.com>
16807 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16808 function to get the store opcode.
16809 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16810 only emit the Ldelema if the store opcode is Stobj. You must run
16811 both test-34 and test-167 to test this. Fixes #34529.
16813 2002-11-23 Martin Baulig <martin@ximian.com>
16815 * ecore.cs (Expression.MemberLookup): Added additional
16816 `qualifier_type' argument which is used when we're being called
16817 from MemberAccess.DoResolve() and null if we're called from a
16819 (Expression.MemberLookupFailed): New method to report errors; this
16820 does the CS1540 check and reports the correct error message.
16822 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16823 argument for the CS1540 check and redone the way how we're dealing
16824 with private members. See the comment in the source code for details.
16825 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16826 `closure_start_type' to `closure_qualifier_type' and check whether
16827 it's not null. It was not this filter being broken, it was just
16828 being called with the wrong arguments.
16830 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16831 and pass it the correct `qualifier_type'; this also does the error
16834 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16836 * expression.cs (Invocation.EmitParams): If the we are dealing
16837 with a non-built-in value type, load its address as well.
16839 (ArrayCreation): Use a a pretty constant instead
16840 of the hardcoded value 2. Use 6 instead of 2 for the number of
16841 static initializers.
16843 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16844 because they are not really value types, just glorified integers.
16846 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16848 * ecore.cs: Remove redundant code for enumerations, make them use
16849 the same code path as everything else, fixes the casting issue
16850 with enumerations in Windows.Forms.
16852 * attribute.cs: Do only cast to string if it is a string, the
16853 validation happens later.
16855 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16856 people upgrade their corlibs.
16858 * ecore.cs: Oops, enumerations were not following the entire code path
16860 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16862 * typemanager.cs (FilterWithClosure): Commented out the test for
16863 1540 in typemanager.cs, as it has problems when accessing
16864 protected methods from a parent class (see test-174.cs).
16866 * attribute.cs (Attribute.ValidateGuid): new method.
16867 (Attribute.Resolve): Use above.
16869 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16871 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16873 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16874 handling for enumerations, as we only needed the TypeContainer
16875 functionality to begin with (this is required for the fix below to
16876 work for enums that reference constants in a container class for
16879 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16881 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16882 a valid TypeBuilder to perform lookups on.o
16884 * class.cs (InheritableMemberSignatureCompare): Use true in the
16885 call to GetGetMethod and GetSetMethod, because we are comparing
16886 the signature, and we need to get the methods *even* if they are
16889 (PropertyBase.CheckBase): ditto.
16891 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16892 GotoCase.Resolve): Use Peel on EmpytCasts.
16894 * ecore.cs (EmptyCast): drop child, add Peel method.
16896 2002-11-17 Martin Baulig <martin@ximian.com>
16898 * ecore.cs (EmptyCast.Child): New public property.
16900 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16901 label resolved to an EmptyCast. Fixes #34162.
16902 (GotoCase.Resolve): Likewise.
16903 (Block.EmitMeta): Likewise.
16905 2002-11-17 Martin Baulig <martin@ximian.com>
16907 * expression.cs (Invocation.BetterConversion): Prefer int over
16908 uint; short over ushort; long over ulong for integer literals.
16909 Use ImplicitConversionExists instead of StandardConversionExists
16910 since we also need to check for user-defined implicit conversions.
16911 Fixes #34165. Added test-173.cs.
16913 2002-11-16 Martin Baulig <martin@ximian.com>
16915 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16916 with the `true' and `false' literals. Fixes #33151.
16918 2002-11-16 Martin Baulig <martin@ximian.com>
16920 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16921 October 22nd; don't do the cs1540 check for static members.
16923 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16924 now using our own filter here and doing the cs1540 check again.
16926 2002-11-16 Martin Baulig <martin@ximian.com>
16928 * support.cs (InternalParameters): Don't crash if we don't have
16929 any fixed parameters. Fixes #33532.
16931 2002-11-16 Martin Baulig <martin@ximian.com>
16933 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16934 when looking up static methods to make this work on Windows.
16937 2002-11-16 Martin Baulig <martin@ximian.com>
16939 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16940 a setter rather than using PropertyInfo.CanWrite.
16942 2002-11-15 Nick Drochak <ndrochak@gol.com>
16944 * class.cs: Allow acces to block member by subclasses. Fixes build
16947 2002-11-14 Martin Baulig <martin@ximian.com>
16949 * class.cs (Constructor.Emit): Added the extern/block check.
16952 2002-11-14 Martin Baulig <martin@ximian.com>
16954 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16955 iteration while looking for indexers, this is needed because the
16956 indexer may have a different name in our base classes. Fixed the
16957 error reporting (no indexers at all, not get accessor, no
16958 overloaded match). Fixes bug #33089.
16959 (IndexerAccess.DoResolveLValue): Likewise.
16961 2002-11-14 Martin Baulig <martin@ximian.com>
16963 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16964 indexers. Fixes the first part of bug #33089.
16965 (MethodSignature.InheritableMemberSignatureCompare): Added support
16968 2002-11-13 Ravi Pratap <ravi@ximian.com>
16970 * attribute.cs (Attribute.Resolve): Catch the
16971 NullReferenceException and report it since it isn't supposed to
16974 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16976 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16977 LogicalOr and LogicalAnd that can benefit from recursively
16978 handling EmitBranchable. The code now should be nice for Paolo.
16980 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16982 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16983 the Type lookups, as we perform quite a number of lookups on
16984 non-Types. This can be removed once we can deterministically tell
16985 whether we have a type or a namespace in advance.
16987 But this might require special hacks from our corlib.
16991 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16992 and double which avoids a conversion from an integer to a double.
16994 * expression.cs: tiny optimization, avoid calling IsConstant,
16995 because it effectively performs the lookup twice.
16997 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16999 But a bogus return here to keep the semantics of the old code
17000 until the Mono runtime is fixed.
17002 * pending.cs (GetMissingInterfaces): New method used to remove all
17003 the interfaces that are already implemented by our parent
17004 classes from the list of pending methods.
17006 * interface.cs: Add checks for calls after ResolveTypeExpr.
17008 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17010 * class.cs (Class.Emit): Report warning 67: event not used if the
17011 warning level is beyond 3.
17013 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17014 being a NullLiteral.
17016 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17019 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17020 path that might fail if a type can not be resolved.
17022 * expression.cs (Binary.Emit): Emit unsigned versions of the
17025 * driver.cs: use error 5.
17027 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17029 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17031 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17033 * cs-parser.jay (switch_section): A beautiful patch from Martin
17034 Baulig that fixed 33094.
17036 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17038 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17039 Check whether the base is abstract and report an error if so.
17041 * expression.cs (IndexerAccess.DoResolveLValue,
17042 IndexerAccess.DoResolve): ditto.
17044 (Invocation.DoResolve): ditto.
17046 (Invocation.FullMethodDesc): Improve the report string.
17048 * statement.cs (Block): Eliminate IsVariableDefined as it is
17049 basically just a wrapper for GetVariableInfo.
17051 * ecore.cs (SimpleName): Use new
17053 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17054 type, as we return the actual parameter ref/unref state on a
17057 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17059 * support.cs: Return proper flags REF/OUT fixing the previous
17062 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17063 not used to mean `ref' but `ref or out' in ParameterReference
17065 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17066 full type signature instead of calling TypeManger.CSharpName
17069 * support.cs (InternalParameters.ParameterDesc): Do not compare
17070 directly to the modflags, because REF/OUT will actually be bitsets
17073 * delegate.cs (VerifyMethod): Check also the modifiers.
17075 * cs-tokenizer.cs: Fix bug where floating point values with an
17076 exponent where a sign was missing was ignored.
17078 * driver.cs: Allow multiple assemblies to be specified in a single
17081 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17083 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17084 because identifiers after a parenthesis would end up in this kind
17085 of production, and we needed to desamiguate it for having casts
17088 (UserDefinedType *) xxx
17090 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17092 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17093 we should set on the Bindingflags.NonPublic, but not turn on
17094 private_ok. private_ok controls whether a Private member is
17095 returned (this is chekced on the filter routine), while the
17096 BindingFlags.NonPublic just controls whether private/protected
17097 will be allowed. This fixes the problem part of the problem of
17098 private properties being allowed to be used in derived classes.
17100 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17101 so we can call the children DoResolveLValue method (this will
17102 properly signal errors on lvalue assignments to base properties)
17104 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17105 getter are null, and we have a property info, we know that this
17106 happened because the lookup failed, so we report an error 122 for
17107 protection level violation.
17109 We also silently return if setter and getter are null in the
17110 resolve functions, this condition only happens if we have flagged
17111 the error before. This is the other half of the problem.
17113 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17114 not have accessibility information, that is why we were returning
17115 true in the filter function in typemanager.cs.
17117 To properly report 122 (property is inaccessible because of its
17118 protection level) correctly, we report this error in ResolveAccess
17119 by failing if both the setter and the getter are lacking (ie, the
17122 DoResolve and DoLResolve have been modified to check for both
17123 setter/getter being null and returning silently, the reason being
17124 that I did not want to put the knowledge about this error in upper
17127 int old = Report.Errors;
17128 x = new PropertyExpr (...);
17129 if (old != Report.Errors)
17134 So the property expr is returned, but it is invalid, so the error
17135 will be flagged during the resolve process.
17137 * class.cs: Remove InheritablePropertySignatureCompare from the
17138 class, as we no longer depend on the property signature to compute
17139 whether it is possible to implement a method or not.
17141 The reason is that calling PropertyInfo.GetGetMethod will return
17142 null (in .NET, in Mono it works, and we should change this), in
17143 cases where the Get Method does not exist in that particular
17148 class X { public virtual int A { get { return 1; } } }
17150 class Z : Y { public override int A { get { return 2; } } }
17152 Would fail in Z because the parent (Y) would not have the property
17153 defined. So we avoid this completely now (because the alternative
17154 fix was ugly and slow), and we now depend exclusively on the
17157 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17158 reference method, instead of using the property.
17160 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17161 routines are gone now.
17163 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17164 names, they were incorrectly named.
17166 * cs-tokenizer.cs: Return are more gentle token on failure.
17168 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17169 had an out-of-sync index variable, which caused it to remove from
17170 the list of pending methods the wrong method sometimes.
17172 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17174 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17175 CanWrite, because those refer to this particular instance of the
17176 property, and do not take into account the fact that we can
17177 override single members of a property.
17179 Constructor requires an EmitContext. The resolution process does
17180 not happen here, but we need to compute the accessors before,
17181 because the resolution does not always happen for properties.
17183 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17184 subclass, before we did not update this flag, but we did update
17187 (GetAccessors): Drop this routine, as it did not work in the
17188 presence of partially overwritten set/get methods.
17190 Notice that this broke the cs1540 detection, but that will require
17193 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17197 * driver.cs: issue a warning instead of an error if we don't support
17198 debugging for the platform. Also ignore a couple of errors that may
17199 arise when trying to write the symbols. Undo my previous patch.
17201 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17203 * driver.cs: ignore /debug switch except for Unix platforms.
17205 2002-10-23 Nick Drochak <ndrochak@gol.com>
17207 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17209 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17211 * driver.cs: Do not make mcs-debug conditional, so we do not break
17212 builds that use it.
17214 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17215 review this patch. But basically after all the children variables
17216 have been merged, the value of "Breaks" was not being set to
17217 new_breaks for Switch blocks. I think that it should be set after
17218 it has executed. Currently I set this to the value of new_breaks,
17219 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17220 conservative, but I do not understand this code very well.
17222 I did not break anything in the build, so that is good ;-)
17224 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17226 2002-10-20 Mark Crichton <crichton@gimp.org>
17228 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17230 2002-10-20 Nick Drochak <ndrochak@gol.com>
17232 * cfold.cs: Fixed compile blocker.
17234 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17236 * driver.cs: I was chekcing the key, not the file.
17238 2002-10-19 Ravi Pratap <ravi@ximian.com>
17240 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17241 message that we were generating - we just need to silently return
17244 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17246 * class.cs (Event.Define): Change my previous commit, as this
17247 breaks the debugger. This is a temporary hack, as it seems like
17248 the compiler is generating events incorrectly to begin with.
17250 * expression.cs (Binary.ResolveOperator): Added support for
17251 "U operator - (E x, E y)"
17253 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17256 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17257 init-only variables, but this path did not take into account that
17258 there might be also instance readonly variables. Correct this
17261 This fixes bug 32253
17263 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17266 * driver.cs: Change the extension for modules to `netmodule'
17268 * cs-parser.jay: Improved slightly the location tracking for
17269 the debugger symbols.
17271 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17272 modifiers that were specified instead of the hardcoded value
17273 (FamAndAssem). This was basically ignoring the static modifier,
17274 and others. Fixes 32429.
17276 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17277 fixed a bug in the process (32476)
17279 * expression.cs (ArrayAccess.EmitAssign): Patch from
17280 hwang_rob@yahoo.ca that fixes bug 31834.3
17282 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17284 * driver.cs: Make the module extension .netmodule.
17286 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17288 * driver.cs: Report an error if the resource file is not found
17289 instead of crashing.
17291 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17292 false, like Emit does.
17294 2002-10-16 Nick Drochak <ndrochak@gol.com>
17296 * typemanager.cs: Remove unused private member. Also reported mcs
17297 bug to report this as a warning like csc.
17299 2002-10-15 Martin Baulig <martin@gnome.org>
17301 * statement.cs (Statement.Emit): Made this a virtual method; emits
17302 the line number info and calls DoEmit().
17303 (Statement.DoEmit): New protected abstract method, formerly knows
17304 as Statement.Emit().
17306 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17308 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17310 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17311 have fixed a remaining problem: not every AddXXXX was adding a
17312 fully qualified name.
17314 Now everyone registers a fully qualified name in the DeclSpace as
17315 being defined instead of the partial name.
17317 Downsides: we are slower than we need to be due to the excess
17318 copies and the names being registered this way.
17320 The reason for this is that we currently depend (on the corlib
17321 bootstrap for instance) that types are fully qualified, because
17322 we dump all the types in the namespace, and we should really have
17323 types inserted into the proper namespace, so we can only store the
17324 basenames in the defined_names array.
17326 2002-10-10 Martin Baulig <martin@gnome.org>
17328 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17329 from bug #31834, see the bug report for a testcase which is
17332 2002-10-10 Martin Baulig <martin@gnome.org>
17334 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17335 flow analysis code for this.
17337 * statement.cs (Do, While, For): Tell the flow analysis code about
17339 (FlowBranching.UsageVector): Added support for infinite loops.
17340 (Block.Resolve): Moved the dead code elimination here and use flow
17343 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17345 * class.cs (Field.Define): Catch cycles on struct type
17348 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17349 fields if the fields are static. We only need to check instance
17352 * expression.cs (As.DoResolve): Test for reference type.
17354 * statement.cs (Using.ResolveExpression): Use
17355 ConvertImplicitRequired, not ConvertImplicit which reports an
17357 (Using.ResolveLocalVariableDecls): ditto.
17359 * expression.cs (Binary.ResolveOperator): Report errors in a few
17360 places where we had to.
17362 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17364 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17366 * expression.cs: Use StoreFromPtr instead of extracting the type
17367 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17369 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17370 an enumeration value to a System.Enum, but System.Enum is not a
17371 value type, but an class type, so we need to box.
17373 (Expression.ConvertExplicit): One codepath could return
17374 errors but not flag them. Fix this. Fixes #31853
17376 * parameter.cs (Resolve): Do not allow void as a parameter type.
17378 2002-10-06 Martin Baulig <martin@gnome.org>
17380 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17381 if it's a class type and not a struct. Fixes #31815.
17383 2002-10-06 Martin Baulig <martin@gnome.org>
17385 * statement.cs: Reworked the flow analysis code a bit to make it
17386 usable for dead code elimination.
17388 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17390 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17392 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17394 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17395 to fix the test 165, will investigate deeper.
17397 2002-10-04 Martin Baulig <martin@gnome.org>
17399 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17400 finally blocks actually work.
17401 (Try.Resolve): We don't need to create a sibling for `finally' if
17402 there is no finally block.
17404 2002-10-04 Martin Baulig <martin@gnome.org>
17406 * class.cs (Constructor.Define): The default accessibility for a
17407 non-default constructor is private, not public.
17409 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17411 * class.cs (Constructor): Make AllowedModifiers public, add
17414 * cs-parser.jay: Perform the modifiers test here, as the
17415 constructor for the Constructor class usually receives a zero
17416 because of the way we create it (first we create, later we
17417 customize, and we were never checking the modifiers).
17419 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17420 is a version of LookupTypeReflection that includes the type-name
17421 cache. This can be used as a fast path for functions that know
17422 the fully qualified name and are only calling into *.GetType() to
17423 obtain a composed type.
17425 This is also used by TypeManager.LookupType during its type
17428 (LookupType): We now also track the real type name, as sometimes
17429 we can get a quey for the real type name from things like
17430 ComposedCast. This fixes bug 31422.
17432 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17433 complete type fullname, it does not have to go through the type
17434 resolution system to obtain the composed version of the type (for
17435 obtaining arrays or pointers).
17437 (Conditional.Emit): Use the EmitBoolExpression to
17438 generate nicer code, as requested by Paolo.
17440 (ArrayCreation.CheckIndices): Use the patch from
17441 hwang_rob@yahoo.ca to validate the array initializers.
17443 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17445 * class.cs (ConstructorInitializer.Emit): simplify code by using
17446 Invocation.EmitCall, and at the same time, fix the bugs in calling
17447 parent constructors that took variable arguments.
17449 * ecore.cs (Expression.ConvertNumericExplicit,
17450 Expression.ImplicitNumericConversion): Remove the code that
17451 manually wrapped decimal (InternalTypeConstructor call is now gone
17454 * expression.cs (Cast.TryReduce): Also handle decimal types when
17455 trying to perform a constant fold on the type.
17457 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17459 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17460 that only turned off an error report, and did nothing else.
17462 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17464 * driver.cs: Handle and ignore /fullpaths
17466 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17468 * expression.cs (Binary.ResolveOperator): Catch the case where
17469 DoNumericPromotions returns true,
17471 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17473 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17475 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17478 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17480 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17481 conversion exists, but it is also required that the conversion be
17482 performed. This manifested in "(Type64Enum) 2".
17484 * class.cs (TypeManager.AddMethod): The fix is not to change
17485 AddEnum, because that one was using a fully qualified name (every
17486 DeclSpace derivative does), but to change the AddMethod routine
17487 that was using an un-namespaced name. This now correctly reports
17488 the duplicated name.
17490 Revert patch until I can properly fix it. The issue
17491 is that we have a shared Type space across all namespaces
17492 currently, which is wrong.
17494 Options include making the Namespace a DeclSpace, and merge
17495 current_namespace/current_container in the parser.
17497 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17499 * cs-parser.jay: Improve error reporting when we get a different
17500 kind of expression in local_variable_type and
17501 local_variable_pointer_type.
17503 Propagate this to avoid missleading errors being reported.
17505 * ecore.cs (ImplicitReferenceConversion): treat
17506 TypeManager.value_type as a target just like object_type. As
17511 Is valid, and needs to result in the int 1 being boxed before it
17512 is assigned to the value type v.
17514 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17515 to validate the enumeration name.
17517 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17518 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17519 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17521 * ecore.cs (TryImplicitIntConversion): When doing an
17522 implicit-enumeration-conversion, check if the type is 64-bits and
17523 perform a conversion before passing to EnumConstant.
17525 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17527 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17528 report ambiguous type references. Unlike the MS version, we
17529 report what the ambiguity is. Innovation at work ;-)
17531 (DeclSpace.FindType): Require a location argument to
17532 display when we display an ambiguous error.
17534 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17536 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17538 * expression.cs (EmitDynamicInitializers): Apply patch from
17539 hwang_rob@yahoo.ca that fixes the order in which we emit our
17542 2002-09-21 Martin Baulig <martin@gnome.org>
17544 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17545 delegate takes no arguments.
17547 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17549 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17552 * expression.cs: Extract the underlying type.
17554 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17556 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17558 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17560 * class.cs (TypeContainer.DefineType): We can not use the nice
17561 PackingSize with the size set to 1 DefineType method, because it
17562 will not allow us to define the interfaces that the struct
17565 This completes the fixing of bug 27287
17567 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17568 means also structs. This fixes part of the problem.
17569 (Expresion.ImplicitReferenceConversionExists): ditto.
17571 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17572 error if there were no errors reported during the type lookup
17573 process, to avoid duplicates or redundant errors. Without this
17574 you would get an ambiguous errors plus a type not found. We have
17575 beaten the user enough with the first error.
17577 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17580 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17581 during the resolution process, stop the lookup, this avoids
17582 repeated error reports (same error twice).
17584 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17586 * typemanager.cs (LookupType): Redo the type lookup code to match
17587 the needs of System.Reflection.
17589 The issue is that System.Reflection requires references to nested
17590 types to begin with a "+" sign instead of a dot. So toplevel
17591 types look like: "NameSpace.TopLevelClass", and nested ones look
17592 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17595 2002-09-19 Martin Baulig <martin@gnome.org>
17597 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17598 says that a method always returns or always throws an exception,
17599 don't report the CS0161.
17601 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17602 set `Returns = new_returns'.
17604 2002-09-19 Martin Baulig <martin@gnome.org>
17606 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17607 to an enum constant, check for a CS0176.
17609 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17611 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17612 for operators that must be in pairs and report errors.
17614 * ecore.cs (SimpleName.DoResolveType): During the initial type
17615 resolution process, when we define types recursively, we must
17616 check first for types in our current scope before we perform
17617 lookups in the enclosing scopes.
17619 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17621 (Invocation.VerifyArgumentsCompat): Call
17622 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17623 I thought we were supposed to always call this, but there are a
17624 few places in the code where we dont do it.
17626 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17628 * driver.cs: Add support in -linkres and -resource to specify the
17629 name of the identifier.
17631 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17633 * ecore.cs (StandardConversionExists): Sync with the conversion
17634 code: allow anything-* to void* conversions.
17636 (FindMostSpecificSource): Use an Expression argument
17637 instead of a Type, because we might be handed over a Literal which
17638 gets a few more implicit conversions that plain types do not. So
17639 this information was being lost.
17641 Also, we drop the temporary type-holder expression when not
17644 2002-09-17 Martin Baulig <martin@gnome.org>
17646 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17647 this is an explicit interface implementation.
17649 2002-09-17 Martin Baulig <martin@gnome.org>
17651 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17652 different `IndexerName' attributes.
17654 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17655 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17656 virtual CommonResolve().
17658 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17660 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17661 and convert that to the UnderlyingType.
17663 * statement.cs (Foreach.Resolve): Indexers are just like variables
17664 or PropertyAccesses.
17666 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17667 inside quoted strings, we were not doing this before.
17669 2002-09-16 Martin Baulig <martin@gnome.org>
17671 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17672 resolve it. This is needed for the definite assignment check of the
17673 instance expression, fixes bug #29846.
17674 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17676 2002-09-16 Nick Drochak <ndrochak@gol.com>
17678 * parameter.cs: Fix compile error. Cannot reference static member
17679 from an instance object. Is this an mcs bug?
17681 2002-09-14 Martin Baulig <martin@gnome.org>
17683 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17684 multiple times. Fixes bug #30295, added test-166.cs.
17686 2002-09-14 Martin Baulig <martin@gnome.org>
17688 * statement.cs (Block.Emit): Don't emit unreachable code.
17689 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17690 `break' statements.
17691 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17693 2002-09-14 Martin Baulig <martin@gnome.org>
17695 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17698 2002-09-14 Martin Baulig <martin@gnome.org>
17700 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17701 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17702 be false on the ms runtime.
17704 2002-09-13 Martin Baulig <martin@gnome.org>
17706 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17707 the CS0038 error message.
17709 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17711 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17712 constant inside, return it.
17714 2002-09-12 Martin Baulig <martin@gnome.org>
17716 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17717 implicit conversion can be done between enum types.
17719 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17720 check whether an implicit conversion to the current enum's UnderlyingType
17721 exists and report an error if not.
17723 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17724 without debugging support.
17726 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17727 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17729 2002-09-12 Martin Baulig <martin@gnome.org>
17731 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17733 * ecore.cs (IMemberExpr.DeclaringType): New property.
17734 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17735 nonstatic member of an outer type (CS0038).
17737 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17739 * driver.cs: Activate the using-error detector at warning level
17740 4 (at least for MS-compatible APIs).
17742 * namespace.cs (VerifyUsing): Small buglett fix.
17744 * pending.cs (PendingImplementation): pass the container pointer.
17746 * interface.cs (GetMethods): Allow for recursive definition. Long
17747 term, I would like to move every type to support recursive
17748 definitions, not the current ordering mechanism that we have right
17751 The situation is this: Attributes are handled before interfaces,
17752 so we can apply attributes to interfaces. But some attributes
17753 implement interfaces, we will now handle the simple cases
17754 (recursive definitions will just get an error).
17756 * parameter.cs: Only invalidate types at the end if we fail to
17759 2002-09-09 Martin Baulig <martin@gnome.org>
17761 * ecore.cs (PropertyExpr.Emit): Also check for
17762 TypeManager.system_int_array_get_length so this'll also work when
17763 compiling corlib. Fixes #30003.
17765 2002-09-09 Martin Baulig <martin@gnome.org>
17767 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17768 and throw an exception if we can't get the type's size. Fixed #30040,
17771 2002-09-09 Martin Baulig <martin@gnome.org>
17773 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17775 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17776 context. Fixes bug #30027.
17778 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17779 virtual functions. Fixes bug #30043, added test-164.cs.
17781 2002-09-08 Ravi Pratap <ravi@ximian.com>
17783 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17785 2002-09-08 Nick Drochak <ndrochak@gol.com>
17787 * driver.cs: Use an object to get the windows codepage since it's not a
17790 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17792 * statement.cs (For.Emit): for infinite loops (test == null)
17793 return whether there is a break inside, not always "true".
17795 * namespace.cs (UsingEntry): New struct to hold the name of the
17796 using definition, the location where it is defined, and whether it
17797 has been used in a successful type lookup.
17799 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17804 2002-09-06 Ravi Pratap <ravi@ximian.com>
17806 * attribute.cs : Fix incorrect code which relied on catching
17807 a NullReferenceException to detect a null being passed in
17808 where an object was expected.
17810 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17812 * statement.cs (Try): flag the catch variable as assigned
17814 * expression.cs (Cast): Simplified by using ResolveType instead of
17815 manually resolving.
17817 * statement.cs (Catch): Fix bug by using ResolveType.
17819 2002-09-06 Ravi Pratap <ravi@ximian.com>
17821 * expression.cs (BetterConversion): Special case for when we have
17822 a NullLiteral as the argument and we have to choose between string
17823 and object types - we choose string the way csc does.
17825 * attribute.cs (Attribute.Resolve): Catch the
17826 NullReferenceException and report error #182 since the Mono
17827 runtime no more has the bug and having this exception raised means
17828 we tried to select a constructor which takes an object and is
17831 2002-09-05 Ravi Pratap <ravi@ximian.com>
17833 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17834 message (1502, 1503) when we can't locate a method after overload
17835 resolution. This is much more informative and closes the bug
17838 * interface.cs (PopulateMethod): Return if there are no argument
17839 types. Fixes a NullReferenceException bug.
17841 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17842 expressions too. Previously we were checking only in one place for
17843 positional arguments leaving out named arguments.
17845 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17846 type to the enum type is not allowed. Remove code corresponding to
17849 (ConvertNumericExplicit): Allow explicit conversions from
17850 the underlying type to enum type. This precisely follows the spec
17851 and closes a bug filed by Gonzalo.
17853 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17856 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17858 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17860 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17861 it was important that we stored the right value after the
17862 reduction in `converted'.
17864 2002-09-04 Martin Baulig <martin@gnome.org>
17866 * location.cs (Location.SymbolDocument): Use full pathnames for the
17869 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17871 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17872 of the expression resolve mechanism, because that will catch the
17873 SimpleName error failures.
17875 (Conditional): If we can not resolve the
17876 expression, return, do not crash.
17878 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17881 (location): display token name instead of its number.
17883 2002-08-28 Martin Baulig <martin@gnome.org>
17885 * expression.cs (Binary.ResolveOperator): Don't silently return
17886 but return an error if an operator cannot be applied between two
17889 2002-08-28 Martin Baulig <martin@gnome.org>
17891 * class.cs (Constructor.Define): Set the permission attributes
17892 correctly instead of making all constructors public.
17894 2002-08-28 Martin Baulig <martin@gnome.org>
17896 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17897 for private members before reporting a CS0103; if we find anything,
17900 2002-08-28 Martin Baulig <martin@gnome.org>
17902 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17903 to check whether `closure_start_type == closure_invocation_type',
17904 we also need to check whether `m.DeclaringType == closure_invocation_type'
17905 before bypassing the permission checks. We might be accessing
17906 protected/private members from the base class.
17907 (TypeManager.RealMemberLookup): Only set private_ok if private
17908 members were requested via BindingFlags.NonPublic.
17910 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17912 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17913 MethodGroupExpr.IsExplicitImpl if appropriate.
17914 (Invocation.DoResolve): Don't report the CS0120 for explicit
17915 interface implementations.
17917 2002-08-27 Martin Baulig <martin@gnome.org>
17919 * expression.cs (Invocation.DoResolve): If this is a static
17920 method and we don't have an InstanceExpression, we must report
17923 2002-08-25 Martin Baulig <martin@gnome.org>
17925 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17926 `==' between a valuetype and an object.
17928 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17930 * ecore.cs (TypeExpr): Provide a ToString method.
17932 2002-08-24 Martin Baulig <martin@gnome.org>
17934 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17935 now called proggie.dbg and it's a binary file.
17937 2002-08-23 Martin Baulig <martin@gnome.org>
17939 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17941 2002-08-23 Martin Baulig <martin@gnome.org>
17943 * struct.cs (MyStructInfo.ctor): Make this work with empty
17944 structs; it's not allowed to use foreach() on null.
17946 2002-08-23 Martin Baulig <martin@gnome.org>
17948 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17949 writer the full pathname of the generated assembly.
17951 2002-08-23 Martin Baulig <martin@gnome.org>
17953 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17954 A `finally' block never returns or breaks; improved handling of
17957 2002-08-23 Martin Baulig <martin@gnome.org>
17959 * statement.cs (Throw.Resolve): Allow `throw null'.
17961 2002-08-23 Martin Baulig <martin@gnome.org>
17963 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17964 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17965 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17966 MemberLookup would return a wrong event if this is an explicit
17967 interface implementation and the class has an event with the same
17970 2002-08-23 Martin Baulig <martin@gnome.org>
17972 * statement.cs (Block.AddChildVariableNames): New public method.
17973 (Block.AddChildVariableName): Likewise.
17974 (Block.IsVariableNameUsedInChildBlock): Likewise.
17975 (Block.AddVariable): Check whether a variable name has already
17976 been used in a child block.
17978 * cs-parser.jay (declare_local_variables): Mark all variable names
17979 from the current block as being used in a child block in the
17982 2002-08-23 Martin Baulig <martin@gnome.org>
17984 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17985 find the symbol writer.
17987 * driver.cs: csc also allows the arguments to /define being
17988 separated by commas, not only by semicolons.
17990 2002-08-23 Martin Baulig <martin@gnome.org>
17992 * interface.cs (Interface.GetMembers): Added static check for events.
17994 2002-08-15 Martin Baulig <martin@gnome.org>
17996 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17997 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17999 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18000 why the MethodData.EmitDestructor() change was necessary.
18002 2002-08-20 Martin Baulig <martin@gnome.org>
18004 * class.cs (TypeContainer.FindMembers): Added static check for events.
18006 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18008 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18009 use Type.GetEvents(), not Type.FindMembers().
18011 2002-08-20 Martin Baulig <martin@gnome.org>
18013 * decl.cs (MemberCache): Added a special method cache which will
18014 be used for method-only searched. This ensures that a method
18015 search will return a MethodInfo with the correct ReflectedType for
18018 2002-08-20 Martin Baulig <martin@gnome.org>
18020 * decl.cs (DeclSpace.FindMembers): Made this public.
18022 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18024 * delegate.cs: fixed build on windows.
18025 [FIXME: Filed as bug #29150: MCS must report these errors.]
18027 2002-08-19 Ravi Pratap <ravi@ximian.com>
18029 * ecore.cs (StandardConversionExists): Return a false
18030 if we are trying to convert the void type to anything else
18031 since that is not allowed.
18033 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18034 we flag error 70 in the event an event is trying to be accessed
18035 directly from outside the declaring type.
18037 2002-08-20 Martin Baulig <martin@gnome.org>
18039 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18040 MemberCache from typemanager.cs to decl.cs.
18042 2002-08-19 Martin Baulig <martin@gnome.org>
18044 * class.cs (TypeContainer): Implement IMemberContainer.
18045 (TypeContainer.DefineMembers): Create the MemberCache.
18046 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18047 return public members if BindingFlags.Public was given, check
18048 whether members are static.
18050 2002-08-16 Martin Baulig <martin@gnome.org>
18052 * decl.cs (DeclSpace.Define): Splitted this in Define and
18053 DefineMembers. DefineMembers is called first and initializes the
18056 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18057 DefineMembers() on all our DeclSpaces.
18059 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18060 but call DefineMembers() on all nested interfaces. We call their
18061 Define() in our new Define() function.
18063 * interface.cs (Interface): Implement IMemberContainer.
18064 (Interface.Define): Moved all code except the attribute stuf to
18066 (Interface.DefineMembers): Initialize the member cache.
18068 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18069 need this anymore since we can use MemberCache.FindMembers directly.
18071 2002-08-19 Martin Baulig <martin@gnome.org>
18073 * typemanager.cs (MemberCache): When creating the cache for an
18074 interface type, add all inherited members.
18075 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18076 to `out bool used_cache' and documented it.
18077 (TypeManager.MemberLookup): If we already used the cache in the first
18078 iteration, we don't need to do the interfaces check.
18080 2002-08-19 Martin Baulig <martin@gnome.org>
18082 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18083 here from IMemberFinder and don't implement this interface anymore.
18084 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18086 * typemanager.cs (IMemberFinder): This interface is now only used by
18087 classes which actually support the member cache.
18088 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18089 since we only put DeclSpaces into this Hashtable.
18090 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18091 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18093 2002-08-16 Martin Baulig <martin@gnome.org>
18095 * typemanager.cs (ICachingMemberFinder): Removed.
18096 (IMemberFinder.MemberCache): New property.
18097 (TypeManager.FindMembers): Merged this with RealFindMembers().
18098 This function will never be called from TypeManager.MemberLookup()
18099 so we can't use the cache here, just the IMemberFinder.
18100 (TypeManager.MemberLookup_FindMembers): Check whether the
18101 IMemberFinder has a MemberCache and call the cache's FindMembers
18103 (MemberCache): Rewrote larger parts of this yet another time and
18104 cleaned it up a bit.
18106 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18108 * driver.cs (LoadArgs): Support quoting.
18110 (Usage): Show the CSC-like command line arguments.
18112 Improved a few error messages.
18114 2002-08-15 Martin Baulig <martin@gnome.org>
18116 * typemanager.cs (IMemberContainer.Type): New property.
18117 (IMemberContainer.IsInterface): New property.
18119 The following changes are conditional to BROKEN_RUNTIME, which is
18120 defined at the top of the file.
18122 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18123 class'es members, but add all members from TypeHandle.ObjectType
18124 if we're an interface.
18125 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18126 is the current type.
18127 (MemberCache.CacheEntry.Container): Removed this field.
18128 (TypeHandle.GetMembers): Include inherited members.
18130 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18132 * typemanager.cs: fixed compilation and added a comment on a field that
18135 2002-08-15 Martin Baulig <martin@gnome.org>
18137 * class.cs (ConstructorInitializer.Resolve): In the
18138 Expression.MemberLookup call, use the queried_type as
18141 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18142 declared' attribute, it's always true.
18143 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18144 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18145 temporary wrapper for FindMembers which tells MemberLookup whether
18146 members from the base classes are included in the return value.
18147 This will go away soon.
18148 (TypeManager.MemberLookup): Use this temporary hack here; once the
18149 new MemberCache is completed, we don't need to do the DeclaredOnly
18150 looping here anymore since the MemberCache will take care of this.
18151 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18152 (MemberCache): When creating the MemberCache for a class, get
18153 members from the current class and all its base classes.
18154 (MemberCache.CacheEntry.Container): New field. This is a
18155 temporary hack until the Mono runtime is fixed to distinguish
18156 between ReflectedType and DeclaringType. It allows us to use MCS
18157 with both the MS runtime and the unfixed Mono runtime without
18158 problems and without accecting performance.
18159 (MemberCache.SearchMembers): The DeclaredOnly looping from
18160 TypeManager.MemberLookup is now done here.
18162 2002-08-14 Martin Baulig <martin@gnome.org>
18164 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18165 Type.GetFields on dynamic types but get the fields from the
18166 corresponding TypeContainer.
18167 (MyStructInfo.GetStructInfo): Added check for enum types.
18169 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18170 (MemberList.SyncRoot): Implemented.
18171 (TypeManager.FilterWithClosure): No need to check permissions if
18172 closure_start_type == closure_invocation_type, don't crash if
18173 closure_invocation_type is null.
18175 2002-08-13 Martin Baulig <martin@gnome.org>
18177 Rewrote TypeContainer.FindMembers to use a member cache. This
18178 gives us a speed increase of about 35% for the self-hosting MCS
18179 build and of about 15-20% for the class libs (both on GNU/Linux).
18181 * report.cs (Timer): New class to get enhanced profiling. This
18182 whole class is "TIMER" conditional since it remarkably slows down
18185 * class.cs (MemberList): New class. This is an IList wrapper
18186 which we're now using instead of passing MemberInfo[]'s around to
18187 avoid copying this array unnecessarily.
18188 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18189 (ICachingMemberFinder, IMemberContainer): New interface.
18190 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18191 has already been checked, otherwise use it for the name comparision.
18192 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18193 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18194 if possible. Returns a MemberList, not a MemberInfo [].
18195 (TypeHandle): New class, implements IMemberContainer. We create
18196 one instance of this class per type, it contains a MemberCache
18197 which is used to do the member lookups.
18198 (MemberCache): New class. Each instance of this class contains
18199 all members of a type and a name-based hash table.
18200 (MemberCache.FindMembers): This is our new member lookup
18201 function. First, it looks up all members of the requested name in
18202 the hash table. Then, it walks this list and sorts out all
18203 applicable members and returns them.
18205 2002-08-13 Martin Baulig <martin@gnome.org>
18207 In addition to a nice code cleanup, this gives us a performance
18208 increase of about 1.4% on GNU/Linux - not much, but it's already
18209 half a second for the self-hosting MCS compilation.
18211 * typemanager.cs (IMemberFinder): New interface. It is used by
18212 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18213 Enum, Delegate or Interface.
18214 (TypeManager.finder_to_member_finder): New PtrHashtable.
18215 (TypeManager.finder_to_container): Removed.
18216 (TypeManager.finder_to_delegate): Removed.
18217 (TypeManager.finder_to_interface): Removed.
18218 (TypeManager.finder_to_enum): Removed.
18220 * interface.cs (Interface): Implement IMemberFinder.
18222 * delegate.cs (Delegate): Implement IMemberFinder.
18224 * enum.cs (Enum): Implement IMemberFinder.
18226 * class.cs (TypeContainer): Implement IMemberFinder.
18228 2002-08-12 Martin Baulig <martin@gnome.org>
18230 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18232 2002-08-12 Martin Baulig <martin@gnome.org>
18234 * ecore.cs (ITypeExpression): New interface for expressions which
18236 (TypeExpression): Renamed to TypeLookupExpression.
18237 (Expression.DoResolve): If we're doing a types-only lookup, the
18238 expression must implement the ITypeExpression interface and we
18239 call DoResolveType() on it.
18240 (SimpleName): Implement the new ITypeExpression interface.
18241 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18242 hack, the situation that we're only looking up types can't happen
18243 anymore when this method is called. Moved the type lookup code to
18244 DoResolveType() and call it.
18245 (SimpleName.DoResolveType): This ITypeExpression interface method
18246 is now doing the types-only lookup.
18247 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18248 (ResolveFlags): Added MaskExprClass.
18250 * expression.cs (MemberAccess): Implement the ITypeExpression
18252 (MemberAccess.DoResolve): Added support for a types-only lookup
18253 when we're called via ITypeExpression.DoResolveType().
18254 (ComposedCast): Implement the ITypeExpression interface.
18256 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18257 Expression.Resolve() with ResolveFlags.Type instead.
18259 2002-08-12 Martin Baulig <martin@gnome.org>
18261 * interface.cs (Interface.Define): Apply attributes.
18263 * attribute.cs (Attribute.ApplyAttributes): Added support for
18264 interface attributes.
18266 2002-08-11 Martin Baulig <martin@gnome.org>
18268 * statement.cs (Block.Emit): Only check the "this" variable if we
18269 do not always throw an exception.
18271 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18272 whether the property has a set accessor.
18274 2002-08-11 Martin Baulig <martin@gnome.org>
18276 Added control flow analysis support for structs.
18278 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18279 with control flow analysis turned off.
18280 (IVariable): New interface.
18281 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18282 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18283 (FieldExpr.DoResolve): Resolve the instance expression with flow
18284 analysis turned off and do the definite assignment check after the
18285 resolving when we know what the expression will resolve to.
18287 * expression.cs (LocalVariableReference, ParameterReference):
18288 Implement the new IVariable interface, only call the flow analysis
18289 code if ec.DoFlowAnalysis is true.
18290 (This): Added constructor which takes a Block argument. Implement
18291 the new IVariable interface.
18292 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18293 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18294 This does the definite assignment checks for struct members.
18296 * class.cs (Constructor.Emit): If this is a non-static `struct'
18297 constructor which doesn't have any initializer, call
18298 Block.AddThisVariable() to tell the flow analysis code that all
18299 struct elements must be initialized before control returns from
18302 * statement.cs (MyStructInfo): New public class.
18303 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18304 argument to this indexer. If non-zero, check an individual struct
18305 member, not the whole struct.
18306 (FlowBranching.CheckOutParameters): Check struct members.
18307 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18308 overloaded versions of these methods which take an additional
18309 `int field_idx' argument to check struct members.
18310 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18311 overloaded versions of these methods which take an additional
18312 `string field_name' argument to check struct member.s
18313 (VariableInfo): Implement the IVariable interface.
18314 (VariableInfo.StructInfo): New public property. Returns the
18315 MyStructInfo instance of the variable if it's a struct or null.
18316 (Block.AddThisVariable): New public method. This is called from
18317 Constructor.Emit() for non-static `struct' constructor which do
18318 not have any initializer. It creates a special variable for the
18319 "this" instance variable which will be checked by the flow
18320 analysis code to ensure that all of the struct's fields are
18321 initialized before control returns from the constructor.
18322 (UsageVector): Added support for struct members. If a
18323 variable/parameter is a struct with N members, we reserve a slot
18324 in the usage vector for each member. A struct is considered fully
18325 initialized if either the struct itself (slot 0) or all its
18326 members are initialized.
18328 2002-08-08 Martin Baulig <martin@gnome.org>
18330 * driver.cs (Driver.MainDriver): Only report an error CS5001
18331 if there were no compilation errors.
18333 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18334 `UnsafeContext' property to determine whether the parent is in
18335 unsafe context rather than checking the parent's ModFlags:
18336 classes nested in an unsafe class are unsafe as well.
18338 2002-08-08 Martin Baulig <martin@gnome.org>
18340 * statement.cs (UsageVector.MergeChildren): Distinguish between
18341 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18342 we return. Added test17() and test18() to test-154.cs.
18344 2002-08-08 Martin Baulig <martin@gnome.org>
18346 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18347 Family access, make sure the invoking type isn't a subclass of the
18348 queried type (that'd be a CS1540).
18350 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18351 this method which takes an additional `Type invocation_type'.
18353 * expression.cs (BaseAccess.DoResolve): Use the base type as
18354 invocation and query type.
18355 (MemberAccess.DoResolve): If the lookup failed and we're about to
18356 report a CS0122, try a lookup with the ec.ContainerType - if this
18357 succeeds, we must report a CS1540.
18359 2002-08-08 Martin Baulig <martin@gnome.org>
18361 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18362 (MethodGroupExpr): Implement the IMemberExpr interface.
18364 * expression (MemberAccess.ResolveMemberAccess): No need to have
18365 any special code for MethodGroupExprs anymore, they're now
18368 2002-08-08 Martin Baulig <martin@gnome.org>
18370 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18371 Family, FamANDAssem and FamORAssem permissions.
18372 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18374 2002-08-08 Martin Baulig <martin@gnome.org>
18376 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18377 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18380 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18382 * driver.cs: implemented /resource option to embed managed resources.
18384 2002-08-07 Martin Baulig <martin@gnome.org>
18386 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18387 (FieldBase.HasFieldInitializer): New public property.
18388 (FieldBase.GetInitializerExpression): New public method. Resolves and
18389 returns the field initializer and makes sure it is only resolved once.
18390 (TypeContainer.EmitFieldInitializers): Call
18391 FieldBase.GetInitializerExpression to get the initializer, this ensures
18392 that it isn't resolved multiple times.
18394 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18395 the resolving process (SimpleName/MemberLookup) that we're currently
18396 emitting a field initializer (which must not access any instance members,
18397 this is an error CS0236).
18399 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18400 argument, if the `IsFieldInitializer' flag is set, we must report and
18401 error CS0236 and not an error CS0120.
18403 2002-08-07 Martin Baulig <martin@gnome.org>
18405 * ecore.cs (IMemberExpr): New public interface.
18406 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18407 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18408 if the expression is an IMemberExpr.
18410 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18411 to be null, implicitly default to `this' if we're non-static in
18412 this case. Simplified the code a lot by using the new IMemberExpr
18413 interface. Also fixed bug #28176 here.
18415 2002-08-06 Martin Baulig <martin@gnome.org>
18417 * cs-parser.jay (SimpleLookup): Removed. We need to create
18418 ParameterReferences during semantic analysis so that we can do a
18419 type-only search when resolving Cast, TypeOf and SizeOf.
18420 (block): Pass the `current_local_parameters' to the Block's
18423 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18424 argument to the constructor.
18425 (ConstructorInitializer.Resolve): Create a temporary implicit
18426 block with the parameters.
18428 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18429 references here if we aren't doing a type-only search.
18431 * statement.cs (Block): Added constructor which takes a
18432 `Parameters parameters' argument.
18433 (Block.Parameters): New public property.
18435 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18436 to `Parameters' and made it public readonly.
18438 2002-08-06 Martin Baulig <martin@gnome.org>
18440 * ecore.cs (Expression.Warning): Made this public as well.
18442 * report.cs (Report.Debug): Print the contents of collections.
18444 2002-08-06 Martin Baulig <martin@gnome.org>
18446 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18447 used to tell Resolve() which kinds of expressions it may return.
18448 (Expression.Resolve): Added overloaded version of this method which
18449 takes a `ResolveFlags flags' argument. This can be used to tell
18450 Resolve() which kinds of expressions it may return. Reports a
18452 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18453 ResolveFlags.SimpleName.
18454 (Expression.Error118): Added overloaded version of this method which
18455 takes a `ResolveFlags flags' argument. It uses the flags to determine
18456 which kinds of expressions are allowed.
18458 * expression.cs (Argument.ResolveMethodGroup): New public method.
18459 Resolves an argument, but allows a MethodGroup to be returned.
18460 This is used when invoking a delegate.
18462 * TODO: Updated a bit.
18464 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18466 Fixed compilation with csc.
18468 * ecore.cs: Expression.Error made public. Is this correct? Should
18469 Warning be made public too?
18471 * expression.cs: use ea.Location instead of ea.loc.
18472 [FIXME: Filed as bug #28607: MCS must report these errors.]
18474 2002-08-06 Martin Baulig <martin@gnome.org>
18476 * ecore.cs (Expression.loc): Moved the location here instead of
18477 duplicating it in all derived classes.
18478 (Expression.Location): New public property.
18479 (Expression.Error, Expression.Warning): Made them non-static and
18480 removed the location argument.
18481 (Expression.Warning): Added overloaded version which takes an
18482 `int level' argument.
18483 (Expression.Error118): Make this non-static and removed the
18484 expression and location arguments.
18485 (TypeExpr): Added location argument to the constructor.
18487 * expression.cs (StaticCallExpr): Added location argument to
18489 (Indirection, PointerArithmetic): Likewise.
18490 (CheckedExpr, UnCheckedExpr): Likewise.
18491 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18492 (StringPtr): Likewise.
18495 2002-08-05 Martin Baulig <martin@gnome.org>
18497 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18499 * assign.cs (Assign.DoResolve): Check whether the source
18500 expression is a value or variable.
18502 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18503 while resolving the corresponding blocks.
18505 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18506 an error, don't silently return null.
18508 * statement.cs (Block.AddVariable): Do the error reporting here
18509 and distinguish between CS0128 and CS0136.
18510 (Block.DoResolve): Report all unused labels (warning CS0164).
18511 (LabeledStatement): Pass the location to the constructor.
18512 (LabeledStatement.HasBeenReferenced): New property.
18513 (LabeledStatement.Resolve): Set it to true here.
18515 * statement.cs (Return.Emit): Return success even after reporting
18516 a type mismatch error (CS0126 or CS0127), this is what csc does and
18517 it avoids confusing the users with any consecutive errors.
18519 2002-08-05 Martin Baulig <martin@gnome.org>
18521 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18523 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18525 * expression.cs (MemberAccess.DoResolve): Silently return if an
18526 error has already been reported.
18528 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18529 error has already been reported.
18531 2002-08-05 Martin Baulig <martin@gnome.org>
18533 * statement.cs (UsageVector): Only initialize the `parameters'
18534 vector if we actually have any "out" parameters.
18536 2002-08-05 Martin Baulig <martin@gnome.org>
18538 * expression.cs (Binary.ResolveOperator): When combining delegates,
18539 they must have the same type.
18541 2002-08-05 Martin Baulig <martin@gnome.org>
18543 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18544 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18545 work with the ms runtime and we also don't need it: if we're a
18546 PropertyBuilder and not in the `indexer_arguments' hash, then we
18547 are a property and not an indexer.
18549 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18550 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18551 since the latter one doesn't work with the ms runtime.
18553 2002-08-03 Martin Baulig <martin@gnome.org>
18555 Fixed bugs #27998 and #22735.
18557 * class.cs (Method.IsOperator): New public field.
18558 (Method.CheckBase): Report CS0111 if there's already a method
18559 with the same parameters in the current class. Report CS0508 when
18560 attempting to change the return type of an inherited method.
18561 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18562 and it's not marked abstract or extern.
18563 (PropertyBase): New abstract base class for Property and Indexer.
18564 (PropertyBase.CheckBase): Moved here from Property and made it work
18566 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18567 the same so we can reuse it there.
18568 (Property, Indexer): Derive from PropertyBase.
18569 (MethodSignature.inheritable_property_signature_filter): New delegate
18570 to find properties and indexers.
18572 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18573 argument and improved error reporting.
18575 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18576 EmptyReadOnlyParameters and made it a property.
18578 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18579 version of this method which takes a `PropertyInfo indexer'.
18580 (TypeManager.RegisterIndexer): New method.
18582 * class.cs: Added myself as author of this file :-)
18584 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18586 * class.cs: fixed compilation on windoze.
18588 2002-08-03 Martin Baulig <martin@gnome.org>
18590 * interface.cs (Interface.GetInterfaceBases): Check whether all
18591 base interfaces are at least as accessible than the current one.
18593 * class.cs (TypeContainer.GetClassBases): Check whether base types
18594 are at least as accessible than the current type.
18595 (TypeContainer.AsAccessible): Implemented and made non-static.
18596 (MemberBase.CheckParameters): Report errors if the accessibility
18599 * delegate.cs (Delegate.Delegate): The default visibility is
18600 internal for top-level types and private for nested types.
18601 (Delegate.Define): Report errors if the accessibility checks fail.
18603 * enum.cs (Enum.Enum): The default visibility is internal for
18604 top-level types and private for nested types.
18605 (Enum.DefineType): Compute the correct visibility.
18607 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18608 function which takes a `bool is_toplevel' instead of a TypeContainer.
18610 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18613 2002-08-02 Martin Baulig <martin@gnome.org>
18615 * expression.cs (LocalVariableReferenc): Added constructor which
18616 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18617 (LocalVariableReference.IsReadOnly): New property.
18618 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18619 variable is readonly, use our own readonly flag to do this; you can
18620 use the new constructor to get a writable reference to a read-only
18623 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18624 reference to the local variable.
18626 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18628 * rootcontext.cs (ResolveCore): Also include System.Exception
18630 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18631 we reach an EmptyStatement.
18633 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18636 * expression.cs (Binary.ResolveOperator): Check error result in
18639 use brtrue/brfalse directly and avoid compares to null.
18641 2002-08-02 Martin Baulig <martin@gnome.org>
18643 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18644 Fixes bug #28407, added test-155.cs.
18646 2002-08-01 Martin Baulig <martin@gnome.org>
18648 * class.cs (Event.EmitDefaultMethod): Make this work with static
18649 events. Fixes #28311, added verify-3.cs.
18651 2002-08-01 Martin Baulig <martin@gnome.org>
18653 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18654 `is_disposable' fields.
18655 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18656 `hm.is_disposable' if we're using the collection pattern.
18657 (Foreach.EmitCollectionForeach): Use the correct type for the
18658 enumerator's local variable, only emit the try/finally block if
18659 necessary (fixes #27713).
18661 2002-08-01 Martin Baulig <martin@gnome.org>
18663 * ecore.cs (Expression.report118): Renamed to Error118 and made
18666 * statement.cs (Throw.Resolve): Check whether the expression is of
18667 the correct type (CS0118) and whether the type derives from
18668 System.Exception (CS0155).
18669 (Catch.Resolve): New method. Do the type lookup here and check
18670 whether it derives from System.Exception (CS0155).
18671 (Catch.CatchType, Catch.IsGeneral): New public properties.
18673 * typemanager.cs (TypeManager.exception_type): Added.
18675 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18677 * driver.cs: Updated About function.
18679 2002-07-31 Martin Baulig <martin@gnome.org>
18681 Implemented Control Flow Analysis.
18683 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18684 (EmitContext.CurrentBranching): Added.
18685 (EmitContext.StartFlowBranching): Added.
18686 (EmitContext.EndFlowBranching): Added.
18687 (EmitContext.KillFlowBranching): Added.
18688 (EmitContext.IsVariableAssigned): Added.
18689 (EmitContext.SetVariableAssigned): Added.
18690 (EmitContext.IsParameterAssigned): Added.
18691 (EmitContext.SetParameterAssigned): Added.
18692 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18693 Added control flow analysis stuff here.
18695 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18696 resolve the expression as lvalue.
18697 (LocalVariableReference.DoResolve): Check whether the variable has
18698 already been assigned.
18699 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18700 the parameter as assigned here.
18701 (ParameterReference.DoResolve): Check whether the parameter has already
18703 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18704 expression as lvalue.
18706 * statement.cs (FlowBranching): New class for the flow analysis code.
18707 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18708 (LabeledStatement.IsDefined): New public property.
18709 (LabeledStatement.AddUsageVector): New public method to tell flow
18710 analyis that the label may be reached via a forward jump.
18711 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18713 (VariableInfo.Number): New public field. This is used by flow analysis
18714 to number all locals of a block.
18715 (Block.CountVariables): New public property. This is the number of
18716 local variables in this block (including the locals from all parent
18718 (Block.EmitMeta): Number all the variables.
18720 * statement.cs: Added flow analysis support to all classes.
18722 2002-07-31 Martin Baulig <martin@gnome.org>
18724 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18725 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18726 then use this argument.
18728 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18730 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18731 use this to specify /define options.
18733 2002-07-29 Martin Baulig <martin@gnome.org>
18735 * statement.cs (Fixed): Moved all code that does variable lookups
18736 and resolvings from Emit to Resolve.
18738 * statement.cs (For): Moved all code that does variable lookups
18739 and resolvings from Emit to Resolve.
18741 * statement.cs (Using): Moved all code that does variable lookups
18742 and resolvings from Emit to Resolve.
18744 2002-07-29 Martin Baulig <martin@gnome.org>
18746 * attribute.cs (Attribute.Resolve): Explicitly catch a
18747 System.NullReferenceException when creating the
18748 CustromAttributeBuilder and report a different warning message.
18750 2002-07-29 Martin Baulig <martin@gnome.org>
18752 * support.cs (ParameterData.ParameterName): Added method to
18753 get the name of a parameter.
18755 * typemanager.cs (TypeManager.IsValueType): New public method.
18757 2002-07-29 Martin Baulig <martin@gnome.org>
18759 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18760 is a flag which specifies that it's either ref or out.
18761 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18762 the out parameter to `out Parameter.Modifier mod', also set the
18763 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18765 * support.cs (InternalParameters.ParameterModifier): Distinguish
18766 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18767 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18769 * expression.cs (Argument.GetParameterModifier): Distinguish
18770 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18771 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18773 2002-07-29 Martin Baulig <martin@gnome.org>
18775 * expression.cs (ParameterReference.ParameterReference): Added
18776 `Location loc' argument to the constructor.
18778 * cs-parser.jay: Pass location to ParameterReference.
18780 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18782 * statement.cs (Try): Initialize the location.
18784 * cs-parser.jay: pass location to Try.
18786 * expression.cs (Unary.Reduce): Change the prototype to return
18787 whether a constant fold could be performed or not. The result is
18788 returned in an out parameters. In the case of Indirection and
18789 AddressOf, we want to perform the full tests.
18791 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18793 * statement.cs (Statement.Emit): Flag dead code.
18795 2002-07-27 Andrew Birkett <andy@nobugs.org>
18797 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18799 2002-07-27 Martin Baulig <martin@gnome.org>
18801 * class.cs (MethodData.Define): Put back call to
18802 TypeManager.AddMethod(), accidentally commented this out.
18804 * report.cs (Debug): New public method to print debugging information,
18805 this is `[Conditional ("DEBUG")]'.
18807 2002-07-26 Martin Baulig <martin@gnome.org>
18809 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18810 (switch_statement): Push the current_block to the switch_stack and
18811 pop it again when we're done with the switch.
18812 (switch_section): The new block is a child of the current_block.
18813 Fixes bug #24007, added test-152.cs.
18815 2002-07-27 Martin Baulig <martin@gnome.org>
18817 * expression.cs (Invocation.EmitArguments): When calling a varargs
18818 function with only its fixed arguments, we need to pass an empty
18821 2002-07-27 Martin Baulig <martin@gnome.org>
18823 Mono 0.13 has been released.
18825 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18827 * driver.cs: Rename --resource to --linkres, because that is what
18828 we do currently, we dont support --resource yet.
18830 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18832 2002-07-25 Martin Baulig <martin@gnome.org>
18834 * class.cs (MethodData): New public class. This is a `method builder'
18835 class for a method or one accessor of a Property/Indexer/Event.
18836 (MethodData.GetMethodFlags): Moved here from MemberBase.
18837 (MethodData.ApplyAttributes): Likewise.
18838 (MethodData.ApplyObsoleteAttribute): Likewise.
18839 (MethodData.ApplyConditionalAttribute): Likewise.
18840 (MethodData.ApplyDllImportAttribute): Likewise.
18841 (MethodData.CheckAbstractAndExternal): Likewise.
18842 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18843 (MethodData.Emit): Formerly known as Method.Emit().
18844 (MemberBase): Moved everything which was specific to a single
18845 accessor/method to MethodData.
18846 (Method): Create a new MethodData and call Define() and Emit() on it.
18847 (Property, Indexer, Event): Create a new MethodData objects for each
18848 accessor and call Define() and Emit() on them.
18850 2002-07-25 Martin Baulig <martin@gnome.org>
18852 Made MethodCore derive from MemberBase to reuse the code from there.
18853 MemberBase now also checks for attributes.
18855 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18856 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18858 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18859 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18860 (MemberBase.ApplyAttributes): New virtual method; applies the
18861 attributes to a method or accessor.
18862 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18863 (MemberBase.ApplyConditionalAttribute): Likewise.
18864 (MemberBase.ApplyDllImportAttribute): Likewise.
18865 (MemberBase.CheckAbstractAndExternal): Likewise.
18866 (MethodCore.ParameterTypes): This is now a property instead of a
18867 method, it's initialized from DoDefineParameters().
18868 (MethodCore.ParameterInfo): Removed the set accessor.
18869 (MethodCore.DoDefineParameters): New protected virtual method to
18870 initialize ParameterTypes and ParameterInfo.
18871 (Method.GetReturnType): We can now simply return the MemberType.
18872 (Method.GetMethodFlags): Override the MemberBase version and add
18873 the conditional flags.
18874 (Method.CheckBase): Moved some code from Define() here, call
18875 DoDefineParameters() here.
18876 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18877 here to avoid some larger code duplication.
18878 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18879 ensure that abstract and external accessors don't declare a body.
18881 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18882 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18883 lookup in the attribute's parent classes, so we need to abort as soon
18884 as we found the first match.
18885 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18886 the attribute has no arguments.
18888 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18891 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18893 * cs-parser.jay: reverted previous patch.
18895 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18897 * cs-parser.jay: fixed bug #22119.
18899 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18901 * attribute.cs: fixed compilation. The error was:
18902 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18903 be assigned to before control leaves the current method."
18904 [FIXME: Filed as bug #28186: MCS must report this error.]
18906 2002-07-25 Martin Baulig <martin@gnome.org>
18908 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18909 method to pull the condition name ouf of a Conditional attribute.
18910 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18911 the obsolete message and error flag out of an Obsolete attribute.
18913 * class.cs (Method.GetMethodFlags): New public method to get the
18914 TypeManager.MethodFlags for this method.
18915 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18917 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18918 if we're overriding a virtual function, set the new private variable
18919 `parent_method'; call the new TypeManager.AddMethod().
18921 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18922 the MethodBuilder and the Method in a PtrHashtable.
18923 (TypeManager.builder_to_method): Added for this purpose.
18924 (TypeManager.MethodFlags): Added IsObsoleteError.
18925 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18926 Obsolete and Conditional arguments in MethodBuilders. If we discover
18927 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18928 the message from the attribute.
18930 2002-07-24 Martin Baulig <martin@gnome.org>
18932 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18933 preprocessor directives, ensure that the argument to #define/#undef is
18934 exactly one identifier and that it's actually an identifier.
18936 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18939 2002-07-24 Martin Baulig <martin@gnome.org>
18941 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18942 initialize it to TypeManager.object_type in the constructor.
18943 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18944 of the `hm.get_current' method if we're using the collection pattern.
18945 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18946 for the explicit conversion to make it work when we're using the collection
18947 pattern and the `Current' property has a different return type than `object'.
18950 2002-07-24 Martin Baulig <martin@gnome.org>
18952 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18953 does not match, but don't report any errors. This method is called in
18954 order for all methods in a MethodGroupExpr until a matching method is
18955 found, so we don't want to bail out if the first method doesn't match.
18956 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18957 matches, report the 123. Fixes #28070.
18959 2002-07-24 Martin Baulig <martin@gnome.org>
18961 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18962 TypeManager.TypeToCoreType() to the top of the method so the
18963 following equality checks will work. Fixes #28107.
18965 2002-07-24 Martin Baulig <martin@gnome.org>
18967 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18968 operand is of type uint, and the other operand is of type sbyte,
18969 short or int, the operands are converted to type long." -
18970 Actually do what this comment already told us. Fixes bug #28106,
18973 2002-07-24 Martin Baulig <martin@gnome.org>
18975 * class.cs (MethodBase): New abstract class. This is now a base
18976 class for Property, Indexer and Event to avoid some code duplication
18977 in their Define() and DefineMethods() methods.
18978 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18979 generic methods for Define() and DefineMethods().
18980 (FieldBase): Derive from MemberBase, not MemberCore.
18981 (Property): Derive from MemberBase, not MemberCore.
18982 (Property.DefineMethod): Moved all the code from this method to the
18983 new MethodBase.DefineAccessor(), just call it with appropriate
18985 (Property.Define): Call the new Property.DoDefine(), this does some
18986 sanity checks and we don't need to duplicate the code everywhere.
18987 (Event): Derive from MemberBase, not MemberCore.
18988 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18989 accessors, this will also make them work with interface events.
18990 (Indexer): Derive from MemberBase, not MemberCore.
18991 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18992 (Indexer.Define): Use the new MethodBase functions.
18994 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18995 argument to the constructor.
18996 (Interface.FindMembers): Added support for interface events.
18997 (Interface.PopluateEvent): Implemented.
18999 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19001 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19003 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19004 but this is required to check for a method name being the same as
19005 the containing class.
19009 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19011 * interface.cs: initialize variable.
19013 2002-07-23 Martin Baulig <martin@gnome.org>
19015 Implemented the IndexerName attribute in interfaces.
19017 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19018 name if this is an explicit interface implementation.
19019 (Indexer.InterfaceIndexerName): New public variable. If we're
19020 implementing an interface indexer, this is the IndexerName in that
19021 interface. Otherwise, it's the IndexerName.
19022 (Indexer.DefineMethod): If we're implementing interface indexer,
19023 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19024 and Pending.ImplementIndexer methods.
19025 (Indexer.Define): Also define the PropertyBuilder if we're
19026 implementing an interface indexer and this is neither an explicit
19027 interface implementation nor do the IndexerName match the one in
19030 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19031 If a method is defined here, then we always need to create a proxy
19032 for it. This is used when implementing interface indexers.
19033 (Pending.IsInterfaceIndexer): New public method.
19034 (Pending.ImplementIndexer): New public method.
19035 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19036 This is used when implementing interface indexers to define a proxy
19038 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19039 define a proxy if necessary.
19041 * interface.cs (Interface.IndexerName): New public variable.
19042 (Interface.PopulateIndexer): Set the IndexerName.
19043 (Interface.DefineIndexers): New private method. Populate all the
19044 indexers and make sure their IndexerNames match.
19046 * typemanager.cs (IndexerPropertyName): Added support for interface
19049 2002-07-22 Martin Baulig <martin@gnome.org>
19051 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19052 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19053 ret if HasReturnLabel.
19054 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19057 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19058 and set the ec.LoopBeginTryCatchLevel.
19059 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19060 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19061 the current ec.TryCatchLevel, the branch goes out of an exception
19062 block. In this case, we need to use Leave and not Br.
19064 2002-07-22 Martin Baulig <martin@gnome.org>
19066 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19067 block unless the block does not always return or it is contained in
19068 another try { ... } catch { ... } block. Fixes bug #26506.
19069 Added verify-1.cs to the test suite.
19071 2002-07-22 Martin Baulig <martin@gnome.org>
19073 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19074 then we do not always return. Fixes bug #24985.
19076 2002-07-22 Martin Baulig <martin@gnome.org>
19078 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19079 lookup on a per-class level; ie. walk up the class hierarchy until we
19080 found at least one applicable method, then choose the best among them.
19081 Fixes bug #24463 and test-29.cs.
19083 2002-07-22 Martin Baulig <martin@gnome.org>
19085 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19086 return types of the methods. The return type is not part of the
19087 signature and we must not check it to make the `new' modifier work.
19088 Fixes bug #27999, also added test-147.cs.
19089 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19091 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19092 on the method's return type.
19094 2002-07-21 Martin Baulig <martin@gnome.org>
19096 * assign.cs: Make this work if the rightmost source is a constant and
19097 we need to do an implicit type conversion. Also adding a few more tests
19098 to test-38.cs which should have caught this.
19100 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19101 target in the makefile for this. The makefile.gnu is primarily intended
19102 for end-users who don't want to debug the compiler.
19104 2002-07-21 Martin Baulig <martin@gnome.org>
19106 * assign.cs: Improved the Assign class so it can now handle embedded
19107 assignments (X = Y = Z = something). As a side-effect this'll now also
19108 consume less local variables. test-38.cs now passes with MCS, added
19109 a few new test cases to that test.
19111 2002-07-20 Martin Baulig <martin@gnome.org>
19113 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19114 instructions. Fixes bug #27977, also added test-146.cs.
19116 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19118 * cs-tokenizer.cs: fixed getHex ().
19120 2002-07-19 Martin Baulig <martin@gnome.org>
19122 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19123 not Type.GetType() to lookup the array type. This is needed when
19124 we're constructing an array of a user-defined type.
19125 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19126 single-dimensional arrays, but also for single-dimensial arrays of
19129 2002-07-19 Martin Baulig <martin@gnome.org>
19131 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19132 this function is called, it's not allowed to share LocalBuilders
19133 among ILGenerators.
19135 2002-07-19 Martin Baulig <martin@gnome.org>
19137 * expression.cs (Argument.Resolve): Report an error 118 when trying
19138 to pass a type as argument.
19140 2002-07-18 Martin Baulig <martin@gnome.org>
19142 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19143 Conv_R_Un for the signed `long' type.
19145 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19147 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19148 `expr' for the temporary result, as that will fail if we do
19149 multiple resolves on the same expression.
19151 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19153 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19154 ec.TypeContainer for looking up aliases.
19156 * class.cs (TypeContainer): Remove LookupAlias from here.
19158 * decl.cs (DeclSpace); Move here.
19160 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19162 * class.cs (FindMembers): Only call filter if the constructor
19163 bulider is not null.
19165 Also handle delegates in `NestedTypes' now. Now we will perform
19166 type lookups using the standard resolution process. This also
19169 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19170 This uses Expressions (the limited kind that can be parsed by the
19171 tree) instead of strings.
19173 * expression.cs (ComposedCast.ToString): Implement, used to flag
19174 errors since now we have to render expressions.
19176 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19179 * ecore.cs (SimpleName.ToString): ditto.
19181 * cs-parser.jay: Instead of using strings to assemble types, use
19182 Expressions to assemble the type (using SimpleName, ComposedCast,
19183 MemberAccess). This should fix the type lookups in declarations,
19184 because we were using a different code path for this.
19186 * statement.cs (Block.Resolve): Continue processing statements
19187 even when there is an error.
19189 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19191 * class.cs (Event.Define): Also remove the `remove' method from
19192 the list of pending items.
19194 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19195 generate more compact code.
19197 2002-07-17 Martin Baulig <martin@gnome.org>
19199 * const.cs (Const.LookupConstantValue): Add support for constant
19200 `unchecked' and `checked' expressions.
19201 Also adding test case test-140.cs for this.
19203 2002-07-17 Martin Baulig <martin@gnome.org>
19205 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19206 check whether mi.ReturnType implements the IEnumerator interface; the
19207 `==' and the IsAssignableFrom() will fail in this situation.
19209 2002-07-16 Ravi Pratap <ravi@ximian.com>
19211 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19214 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19216 * expression.cs: fixed bug #27811.
19218 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19220 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19221 Molaro: when we are a ref, the value already contains a pointer
19222 value, do not take the address of it.
19224 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19225 * removed mb-parser.jay and mb-tokenizer.cs
19227 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19229 * expression.cs: check against the building corlib void type.
19231 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19233 * ecore.cs: fix for valuetype static readonly fields: when
19234 initializing them, we need their address, not the address of a copy.
19236 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19238 * typemanager.cs: register also enum_type in corlib.
19240 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19242 * class.cs: allow calling this (but not base) initializers in structs.
19244 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19246 * ecore.cs: make sure we compare against the building base types
19249 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19251 * typemanager.cs: fix TypeToCoreType() to handle void and object
19252 (corlib gets no more typerefs after this change).
19254 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19256 * expression.cs (ArrayCreation.EmitArrayArguments): use
19257 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19259 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19260 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19261 array indexes, the runtime actually forbids them.
19263 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19264 for array arguments here.
19266 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19267 instead of the default for ValueTypes.
19269 (New.DoEmit): Use IsValueType instead of
19270 IsSubclassOf (value_type)
19271 (New.DoResolve): ditto.
19272 (Invocation.EmitCall): ditto.
19274 * assign.cs (Assign): ditto.
19276 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19277 Statements *are* currently doing part of their resolution during
19280 Expressions do always resolve during resolve, but statements are
19281 only required to propagate resolution to their children.
19283 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19285 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19287 (LoadAssembly): Do not add the dll if it is already specified
19289 (MainDriver): Add the System directory to the link path at the end,
19290 after all the other -L arguments.
19292 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19293 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19294 ldelem.u1) and using the opposite for sbytes.
19296 This fixes Digger, and we can finally run it.
19298 * driver.cs (UnixParseOption): Move the option parsing here.
19299 (CSCParseOption): Implement CSC-like parsing of options.
19301 We now support both modes of operation, the old Unix way, and the
19302 new CSC-like way. This should help those who wanted to make cross
19303 platform makefiles.
19305 The only thing broken is that /r:, /reference: and /lib: are not
19306 implemented, because I want to make those have the same semantics
19307 as the CSC compiler has, and kill once and for all the confussion
19308 around this. Will be doing this tomorrow.
19310 * statement.cs (Unsafe.Resolve): The state is checked during
19311 resolve, not emit, so we have to set the flags for IsUnsfe here.
19313 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19315 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19316 not catch the Error_ObjectRefRequired in SimpleName (as it is
19317 possible to have a class/instance variable name that later gets
19318 deambiguated), we have to check this here.
19320 2002-07-10 Ravi Pratap <ravi@ximian.com>
19322 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19323 make static and put into Expression.
19325 (Event.Define): Register the private field of the event with the
19326 TypeManager so that GetFieldFromEvent can get at it.
19328 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19329 keep track of the private field associated with an event which
19332 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19335 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19337 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19339 * expression.cs (Binary.EmitBranchable): this routine emits the
19340 Binary expression in a branchable context. This basically means:
19341 we need to branch somewhere, not just get the value on the stack.
19343 This works together with Statement.EmitBoolExpression.
19345 * statement.cs (Statement.EmitBoolExpression): Use
19348 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19350 * statement.cs (For): Reduce the number of jumps in loops.
19352 (For): Implement loop inversion for the For statement.
19354 (Break): We can be breaking out of a Try/Catch controlled section
19355 (foreach might have an implicit try/catch clause), so we need to
19356 use Leave instead of Br.
19358 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19359 now). If the instace expression supports IMemoryLocation, we use
19360 the AddressOf method from the IMemoryLocation to extract the
19361 address instead of emitting the instance.
19363 This showed up with `This', as we were emitting the instance
19364 always (Emit) instead of the Address of This. Particularly
19365 interesting when This is a value type, as we dont want the Emit
19366 effect (which was to load the object).
19368 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19370 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19372 * statement.cs (Checked): Set the CheckedState during the resolve
19373 process too, as the ConvCast operations track the checked state on
19374 the resolve process, and not emit.
19376 * cs-parser.jay (namespace_member_declaration): Flag that we have
19377 found a declaration when we do. This is used to flag error 1529
19379 * driver.cs: Report ok when we display the help only.
19381 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19383 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19385 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19387 * cs-tokenizer.cs (define): We also have to track locally the
19388 defines. AllDefines is just used for the Conditional Attribute,
19389 but we also need the local defines for the current source code.
19391 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19393 * statement.cs (While, For, Do): These loops can exit through a
19394 Break statement, use this information to tell whether the
19395 statement is the last piece of code.
19397 (Break): Flag that we break.
19399 * codegen.cs (EmitContexts): New `Breaks' state variable.
19401 2002-07-03 Martin Baulig <martin@gnome.org>
19403 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19404 modifiers in method declarations in structs. Otherwise, you won't
19405 be able to override things like Object.Equals().
19407 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19409 * class.cs (Method, Property, Indexer): Do not allow the public
19410 modifier to be used in explicit interface implementations.
19412 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19413 override modifiers in method declarations in structs
19415 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19417 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19418 integer or real overflow, report an error
19420 2002-07-02 Martin Baulig <martin@gnome.org>
19422 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19423 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19424 to tell the runtime about our newly created System.Object and
19425 System.ValueType types.
19427 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19429 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19430 struct instead of Ldarg/Starg.
19432 2002-07-02 Martin Baulig <martin@gnome.org>
19434 * expression.cs (Indirection.Indirection): Call
19435 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19437 2002-07-02 Martin Baulig <martin@gnome.org>
19439 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19440 ValueType, call TypeManager.TypeToCoreType() on it.
19441 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19442 the OpCodes.Newarr argument.
19444 2002-07-02 Martin Baulig <martin@gnome.org>
19446 * expression.cs (Invocation.EmitCall): When compiling corlib,
19447 replace all calls to the system's System.Array type to calls to
19448 the newly created one.
19450 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19451 System.Array methods.
19452 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19453 from the system's System.Array type which must be replaced.
19455 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19457 * typemanager.cs: load unverifiable_code_ctor so we can build
19458 corlib using the correct type. Avoid using GetTypeCode() with
19460 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19461 TypeManager.object_type to allow building corlib.
19463 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19465 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19467 2002-07-01 Martin Baulig <martin@gnome.org>
19469 * class.cs: Make the last change actually work, we need to check
19470 whether `ifaces != null' to avoid a crash.
19472 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19474 * class.cs: when we build structs without fields that implement
19475 interfaces, we need to add the interfaces separately, since there is
19476 no API to both set the size and add the interfaces at type creation
19479 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19481 * expression.cs: the dimension arguments to the array constructors
19482 need to be converted if they are a long.
19484 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19486 * class.cs: don't emit ldarg.0 if there is no parent constructor
19487 (fixes showstopper for corlib).
19489 2002-06-29 Martin Baulig <martin@gnome.org>
19491 MCS now compiles corlib on GNU/Linux :-)
19493 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19494 ie. check for MethodImplOptions.InternalCall.
19496 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19497 and TypeManager.attribute_type are null, so we must explicitly check
19498 whether parent is not null to find out whether it's an attribute type.
19499 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19500 and SetBuilder, not only if the property is neither abstract nor external.
19501 This is necessary to set the MethodImplOptions on the accessor methods.
19502 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19503 SetBuilder, see Property.Emit().
19505 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19506 populate "System.Object", "System.ValueType" and "System.Attribute" since
19507 they've already been populated from BootCorlib_PopulateCoreTypes().
19509 2002-06-29 Martin Baulig <martin@gnome.org>
19511 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19512 is the NullLiteral, we also need to make sure that target_type is not
19515 2002-06-29 Martin Baulig <martin@gnome.org>
19517 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19518 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19519 before calling BootstrapCorlib_ResolveDelegate ().
19521 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19523 * statement.cs: fixed build-breaker. All tests passed ok.
19525 2002-06-27 Martin Baulig <martin@gnome.org>
19527 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19528 for System.Decimal when compiling corlib.
19530 2002-06-27 Martin Baulig <martin@gnome.org>
19532 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19533 switch blocks which contain nothing but a default clause.
19535 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19537 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19539 2002-06-27 Martin Baulig <martin@gnome.org>
19541 * ecore.cs (PropertyExpr.PropertyExpr): Call
19542 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19544 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19545 is already a TypeBuilder.
19547 2002-06-27 Martin Baulig <martin@gnome.org>
19549 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19550 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19551 the "from an array-type to System.Array" case. This makes it work
19552 when compiling corlib.
19554 2002-06-27 Martin Baulig <martin@gnome.org>
19556 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19557 non-static PropertyExpr, set its InstanceExpression. This makes
19558 the `ICollection.Count' property work in System/Array.cs.
19560 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19562 * driver.cs: Made error handling more consistent. Errors now
19563 tracked by Report class, so many methods which used to return int
19564 now return void. Main() now prints success/failure and
19565 errors/warnings message.
19567 Renamed '--probe' compiler argument to '--expect-error'. Removed
19568 the magic number return values (123 and 124). Now, if the
19569 expected error occurs, the compiler exits with success (exit value
19570 0). If the compilation completes without seeing that particular
19571 error, the compiler exits with failure (exit value 1). The
19572 makefile in mcs/errors has been changed to handle the new behaviour.
19574 * report.cs: Made 'expected error' number a property and renamed
19575 it from 'Probe' to 'ExpectedError'.
19577 * genericparser.cs: Removed error handling support, since it is
19578 now all done by Report class.
19580 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19581 class, so parse() no longer returns an int.
19583 * namespace.cs: Use Report.Error instead of GenericParser.error
19585 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19587 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19588 TypeContainer.AddOperator): At the front of the list put the
19589 explicit implementations, so they get resolved/defined first.
19591 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19593 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19594 interface type is implemented by this TypeContainer. Used during
19595 explicit interface implementation.
19597 (Property.Define, Indexer.Define, Method.Define): Validate that
19598 the given interface in the explicit implementation is one of the
19599 base classes for the containing type.
19601 Also if we are explicitly implementing an interface, but there is
19602 no match in the pending implementation table, report an error.
19604 (Property.Define): Only define the property if we are
19605 not explicitly implementing a property from an interface. Use the
19606 correct name also for those properties (the same CSC uses,
19607 although that is really not needed).
19609 (Property.Emit): Do not emit attributes for explicitly implemented
19610 properties, as there is no TypeBuilder.
19612 (Indexer.Emit): ditto.
19614 Hiding then means that we do not really *implement* a pending
19615 implementation, which makes code fail.
19617 2002-06-22 Martin Baulig <martin@gnome.org>
19619 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19620 the return value of Object.GetType(). [FIXME: we need to do this whenever
19621 we get a type back from the reflection library].
19623 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19625 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19627 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19629 * attribute.cs: Return null if we can not look up the type.
19631 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19632 the interface types found.
19634 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19635 interface types found.
19637 * typemanager.cs (GetInterfaces): Make this routine returns alll
19638 the interfaces and work around the lame differences between
19639 System.Type and System.Reflection.Emit.TypeBuilder in the results
19640 result for GetInterfaces.
19642 (ExpandInterfaces): Given an array of interface types, expand and
19643 eliminate repeated ocurrences of an interface. This expands in
19644 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19647 2002-06-21 Martin Baulig <martin@gnome.org>
19649 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19652 2002-06-21 Martin Baulig <martin@gnome.org>
19654 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19655 and called with one of the core types, return the corresponding typebuilder for
19658 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19661 2002-06-21 Martin Baulig <martin@gnome.org>
19663 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19664 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19665 (Expression.ConvertReferenceExplicit): Likewise.
19667 * expression.cs (ElementAccess.DoResolve): Likewise.
19668 (ElementAccess.DoResolveLValue): Likewise.
19670 2002-06-10 Martin Baulig <martin@gnome.org>
19672 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19673 add the "value" parameter to the parameter list.
19675 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19678 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19680 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19681 the argument to an int, uint, long or ulong, per the spec. Also
19682 catch negative constants in array creation.
19684 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19686 * class.cs: do not allow the same interface to appear twice in
19687 the definition list.
19689 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19691 * ecore.cs: don't use ldlen with System.Array.
19693 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19695 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19697 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19699 * modifiers.cs: produce correct field attributes for protected
19700 internal. Easy fix so miguel can work on ther harder stuff:-)
19702 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19704 * pending.cs: New file. Move the code from class.cs here.
19705 Support clearning the pending flag for all methods (when not doing
19706 explicit interface implementation).
19708 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19710 * rootcontext.cs: added a couple more types needed to bootstrap.
19712 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19714 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19715 constructor in the type, instead of any constructor in the type
19716 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19717 a bug in the Mono runtime when applying the params attribute).
19719 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19720 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19722 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19724 * expression.cs (Unary.ResolveOperator): Use TypeManager
19725 to resolve the type.
19727 2002-06-13 Ravi Pratap <ravi@ximian.com>
19729 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19732 * enum.cs (AddEnumMember): Add support to store the attributes associated
19733 with each member too.
19735 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19736 field builders too - this takes care of the enum member case.
19738 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19740 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19741 address-of operator on both value types and pointers.
19743 2002-06-10 Martin Baulig <martin@gnome.org>
19745 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19746 PropertyBuilder to the `property_builders' list.
19748 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19749 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19750 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19751 find any indexers which are inherited from an interface.
19753 2002-06-09 Martin Baulig <martin@gnome.org>
19755 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19756 the same type as the constant if necessary. There's also a test-130.cs
19759 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19761 * typemanager.cs (TypeManager.ChangeType): Previously known as
19762 Enum.ChangeEnumType().
19764 2002-06-09 Martin Baulig <martin@gnome.org>
19766 * expression.cs (Cast.TryReduce): Added support for consts.
19768 2002-06-08 Ravi Pratap <ravi@ximian.com>
19770 * class.cs (Accessor): Hold attributes information so we can pass
19773 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19774 Modify to pass in attributes attached to the methods.
19776 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19778 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19779 to handle the Accessor kind :-)
19781 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19783 2002-06-08 Martin Baulig <martin@gnome.org>
19785 * expression.cs (Unary.TryReduceNegative): Added support for
19788 2002-06-08 Martin Baulig <martin@gnome.org>
19790 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19791 name can't be found in the `defined_names' - the caller will do a
19792 MemberLookup in this case and thus find methods in System.Enum
19793 such as Enum.IsDefined().
19795 2002-06-08 Martin Baulig <martin@gnome.org>
19797 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19798 Convert.ChangeType() which works with TypeBuilder created types.
19799 (Enum.LookupEnumValue, Enum.Define): Use it here.
19801 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19802 `TypeBuilder.BaseType != null' check.
19803 (TypeContainer.FindMembers): Only lookup parent members if we
19804 actually have a parent.
19805 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19806 (ConstructorInitializer.Resolve): Likewise.
19808 * interface.cs (Interface.FindMembers): Added
19809 `TypeBuilder.BaseType != null' check.
19811 * rootcontext.cs (RootContext.ResolveCore): Added
19812 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19813 classes_second_stage.
19815 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19816 debug_type and trace_type when compiling with --nostdlib.
19818 2002-06-07 Martin Baulig <martin@gnome.org>
19820 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19821 (AddField): Set it to true when adding a non-static field.
19822 (DefineType): Use `have_nonstatic_fields' to find out whether we
19823 have non-static fields, not `Fields != null'.
19825 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19827 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19828 dereferencing a null on the static-field code path)
19830 2002-05-30 Martin Baulig <martin@gnome.org>
19832 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19833 to take command line arguments. Use reflection to call the new
19834 custom `Initialize' function on the symbol writer and pass it the
19835 command line arguments.
19837 * driver.cs (--debug-args): New command line argument to pass command
19838 line arguments to the symbol writer.
19840 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19842 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19843 the target type for indexers and properties. Thanks to Joe for
19846 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19848 * typemanager.cs (MethodFlags): returns the method flags
19849 (Obsolete/ShouldIgnore) that control warning emission and whether
19850 the invocation should be made, or ignored.
19852 * expression.cs (Invocation.Emit): Remove previous hack, we should
19853 not do this on matching a base type, we should do this based on an attribute
19855 Only emit calls to System.Diagnostics.Debug and
19856 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19857 on the command line.
19859 * rootcontext.cs: Global settings for tracing and debugging.
19861 * cs-tokenizer.cs (define): New utility function to track
19862 defines. Set the global settings for TRACE and DEBUG if found.
19864 2002-05-25 Ravi Pratap <ravi@ximian.com>
19866 * interface.cs (Populate*): Pass in the TypeContainer as well as
19867 the DeclSpace as parameters so that we can create EmitContexts and
19868 then use that to apply attributes etc.
19870 (PopulateMethod, PopulateEvent, PopulateProperty)
19871 (PopulateIndexer): Apply attributes everywhere.
19873 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19876 (ApplyAttributes): Update accordingly.
19878 We now apply interface attributes for all members too.
19880 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19882 * class.cs (Indexer.Define); Correctly check if we are explicit
19883 implementation (instead of checking the Name for a ".", we
19884 directly look up if the InterfaceType was specified).
19886 Delay the creation of the PropertyBuilder.
19888 Only create the PropertyBuilder if we are not an explicit
19889 interface implementation. This means that explicit interface
19890 implementation members do not participate in regular function
19891 lookups, and hence fixes another major ambiguity problem in
19892 overload resolution (that was the visible effect).
19894 (DefineMethod): Return whether we are doing an interface
19897 * typemanager.cs: Temporary hack until we get attributes in
19898 interfaces (Ravi is working on that) and we get IndexerName
19899 support in interfaces.
19901 * interface.cs: Register the indexers as properties.
19903 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19904 warning, I have verified that this is a bug in the .NET runtime
19905 (JavaScript suffers of the same problem).
19907 * typemanager.cs (MemberLookup): When looking up members for
19908 interfaces, the parent of an interface is the implicit
19909 System.Object (so we succeed in searches of Object methods in an
19910 interface method invocation. Example: IEnumerable x; x.ToString
19913 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19915 * class.cs (Event): Events should also register if they do
19916 implement the methods that an interface requires.
19918 * typemanager.cs (MemberLookup); use the new GetInterfaces
19921 (GetInterfaces): The code used to lookup interfaces for a type is
19922 used in more than one place, factor it here.
19924 * driver.cs: Track the errors at the bottom of the file, we kept
19927 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19928 instance if the method we are calling is static!
19930 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19932 * attribute.cs (ApplyAttributes): Make this function filter out
19933 the IndexerName attribute (as that attribute in reality is never
19934 applied) and return the string constant for the IndexerName
19937 * class.cs (TypeContainer.Emit): Validate that all the indexers
19938 have the same IndexerName attribute, and if so, set the
19939 DefaultName attribute on the class.
19941 * typemanager.cs: The return value might contain other stuff (not
19942 only methods). For instance, consider a method with an "Item"
19943 property and an Item method.
19945 * class.cs: If there is a problem with the parameter types,
19948 2002-05-24 Ravi Pratap <ravi@ximian.com>
19950 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19951 looks at user defined conversion after making a call to
19952 StandardConversionExists - we need this for overload resolution.
19954 * expression.cs : Update accordingly the various method calls.
19956 This fixes 2 bugs filed against implicit user defined conversions
19958 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19960 * statement.cs: Track the result of the assignment.
19962 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19964 * expression.cs (MemberAccess): Improved error reporting for
19965 inaccessible members.
19967 2002-05-22 Martin Baulig <martin@gnome.org>
19969 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19970 itself with debugging support.
19972 2002-05-22 Martin Baulig <martin@gnome.org>
19974 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19975 Removed, this isn't needed anymore.
19977 2002-05-20 Martin Baulig <martin@gnome.org>
19979 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19980 be underlying type for an enum.
19982 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19984 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19985 that splits out the loading of just the core types.
19987 * rootcontext.cs (ResolveCore): Split the struct resolution in
19988 two, so we can load the enumeration underlying types before any
19991 * expression.cs (Is): Bandaid until we fix properly Switch (see
19992 bug #24985 for details).
19994 * typemanager.cs (ImplementsInterface): The hashtable will contain
19995 a null if there are no interfaces implemented.
19997 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19999 * cs-parser.jay (indexer_declarator): It is fine to have array
20002 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20004 * typemanager.cs: (RegisterBuilder): New function used to register
20005 TypeBuilders that implement interfaces. Since
20006 TypeBuilder.GetInterfaces (as usual) does not work with lame
20008 (AddUserType): register interfaces.
20010 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20011 dealing with TypeBuilder. Also, arrays are showing up as
20012 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20013 methods can not be invoked on them!
20015 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20016 (ImplicitReferenceConversionExists): Split out from
20017 StandardConversionExists.
20019 * expression.cs (As): We were only implementing one of the three
20020 cases for the as operator. We now implement them all.
20021 (Is): Implement the various other cases for Is as well.
20023 * typemanager.cs (CACHE): New define used to control if we want or
20024 not the FindMembers cache. Seems to have a negative impact on
20025 performance currently
20027 (MemberLookup): Nested types have full acess to
20028 enclosing type members
20030 Remove code that coped with instance/static returns for events, we
20031 now catch this in RealFindMembers.
20033 (RealFindMembers): only perform static lookup if the instance
20034 lookup did not return a type or an event.
20036 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20038 * assign.cs (CompoundAssign): We pass more semantic information
20039 now to Compound Assignments than we did before: now we have all
20040 the information at hand, and now we resolve the target *before* we
20041 do the expression expansion, which allows the "CacheValue" method
20042 to have the effect we intended (before, a [x] += 1 would generate
20043 two differen ArrayAccess expressions from the ElementAccess,
20044 during the resolution process).
20046 (CompoundAssign.DoResolve): Resolve target and original_source here.
20048 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20050 * expression.cs (ArrayAccess): dropped debugging information.
20052 * typemanager.cs: Small bug fix: I was always returning i_members,
20053 instead of one of i_members or s_members (depending on which had
20056 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20057 method is invoked before any code generation takes place, and it
20058 is a mechanism to inform that the expression will be invoked more
20059 than once, and that the method should use temporary values to
20060 avoid having side effects
20062 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20064 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20067 * expression.cs (Indirection, ArrayAccess): Add support for
20068 CacheTemporaries in these two bad boys.
20070 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20071 ldobj or ldind_ref.
20072 (StoreFromPtr): Handle stobj as well.
20074 * expression.cs (UnaryMutator): Share more code.
20076 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20077 down: I was not tracking the Filter function as well, which
20078 was affecting the results of the cache.
20080 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20082 * attribute.cs: Remove the hack to handle the CharSet property on
20085 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20087 * attribute.cs (DoResolve): More uglyness, we now only try to
20088 resolve the attribute partially, to extract the CharSet
20089 information (only if we are a StructLayout attribute). Otherwise
20091 (GetExtraTypeInfo): Add some code to conditionally kill in the
20092 future this. I am more and more convinced that the .NET
20093 framework has special code to handle the attribute setting on
20096 * expression.cs (IsParamsMethodApplicable): Revert my previous
20097 foreach change here, it was wrong.
20099 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20101 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20102 (pp_expr): do not abort on unknown input, just return.
20103 (eval): abort if there are pending chars.
20105 * attribute.cs (Attribute.Resolve): Positional parameters are
20106 optional. Deal with that case.
20108 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20109 the Ansi/Unicode/Auto information for the type.
20111 (TypeContainer.DefineType): instantiate the EmitContext here, as
20112 we will be using it during the type definition (to resolve
20113 attributes) and during the emit phase.
20115 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20116 to pull type information out of the attributes
20118 (Attribute.Resolve): track the constructor builder, and allow for
20119 multiple invocations (structs and classes will use this).
20121 * ecore.cs (MemberLookupFinal): new version with all the
20122 parameters customizable.
20124 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20125 constructors. Return if the result value is null (as the error
20126 would have been flagged already by MemberLookupFinal)
20128 Do not allow instances of abstract classes or interfaces to be
20131 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20132 We have to compare the assembly property here when dealing with
20133 FamANDAssem and Assembly access modifiers, because we might be
20134 creating an assembly from *modules* (that means that we are not
20135 getting TypeBuilders for types defined in other modules that are
20136 part of this assembly).
20138 (Method.Emit): If the method is marked abstract and has a body,
20141 (TypeContainer.DefineMembers): If both the defined member and the
20142 parent name match are methods, then do not emit any warnings: let
20143 the Method.Define routine take care of flagging warnings. But if
20144 there is a mismatch (method overrides something else, or method is
20145 overriwritten by something, then emit warning).
20147 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20148 set to null, this means `do not check for the return type on the
20151 (Method.Define): set the return type for the method signature to
20152 null, so that we get methods with the same name and parameters and
20153 different return types. This is used to flag warning 114 (you are
20154 hiding a method, and you probably want to use the new/override
20157 * typemanager.cs (MemberLookup): Implemented proper access
20158 control, closing a long standing set of bug reports. The problem
20159 was that the Framework only has two bits: Public and NonPublic,
20160 and NonPublic includes private and protected methods, but we need
20161 to enforce the FamANDAssem, FamOrAssem and Family.
20163 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20165 * statement.cs (GotoCase): Return true: Ammounts to giving up
20166 knowledge on whether we return or not, and letting the other case
20167 be responsible for it.
20169 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20171 * driver.cs: Do not load directories for each file processed, only
20172 do it if there is a pattern.
20174 * ecore.cs: Report readonly assigns here as well, as we might have
20175 been resolved only by MemberAccess.
20177 (SimpleName.SimpleNameResolve): Also be useful for LValue
20178 resolution. We need this to propagate assign to local readonly variables
20180 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20181 do not want to reuse potential criteria memory.
20183 * class.cs (MyEventBuilder): Set reflected_type;
20185 * ecore.cs (Constantify): Added support for constifying bools.
20187 (RootContext.LookupType): Added a cache for values looked up in
20188 the declaration space.
20190 * typemanager.cs (FindMembers): Now is a front-end to
20191 RealFindMembers, and provides a two-level hashtable-based cache to
20194 15% performance improvement: from 22.5 to 19.2 seconds.
20196 * expression.cs (IsParamsMethodApplicable): use foreach.
20197 (Invocation.DoResolve): ditto.
20198 (New.DoResolve): ditto.
20199 (ArrayCreation.DoResolve): ditto.
20201 * ecore.cs (FindMostEncompassingType): use foreach.
20203 * delegate.cs (NewDelegate.DoResolve): Use foreach
20205 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20206 (RemoveMethods): use foreach.
20208 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20209 nested foreach statements instead of for, and also break out of
20210 the inner loop once a match is found.
20212 (Invocation.OverloadResolve): Use foreach, simplify the code.
20214 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20216 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20217 we actually unwrap the expression to allow for extra information
20220 * expression.cs: Use Shr_Un on unsigned operations.
20222 2002-05-08 Ravi Pratap <ravi@ximian.com>
20224 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20225 applicable operators was not being considered correctly. This closes
20226 the bug Miguel reported.
20228 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20230 * attribute.cs: check that the type derives from System.Attribute
20231 and report the correct error in that case (moved the duplicate code to
20232 its own method, too).
20234 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20236 * attribute.cs: lookup attribute type name as the spec says: first the
20237 bare attribute name and then name + "Attribute" (nant compiles with
20238 mcs after this fix).
20240 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20242 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20243 Because of the way we parse things, we should try to see if a
20244 UIntConstant can fit in an integer.
20246 2002-05-07 Ravi Pratap <ravi@ximian.com>
20248 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20249 when we are in an explicit context.
20251 (ConvertReferenceExplicit): When converting from Iface type S to Class
20252 T make sure the rules are implemented as an OR.
20254 * parameter.cs (ParameterType): Make it a property for now although the
20255 purpose really isn't anything immediate.
20257 * expression.cs (Is*Applicable): Do better checking on the parameter type
20258 of a ref/out parameter. The ones from the system assemblies are already
20259 marked with the correct type so we don't need to do any correction.
20261 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20262 the object type is standard too so include that.
20264 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20266 * ecore.cs (StandardConversionExists): Augment with missing code:
20267 deal with IntConstant, LongConstants and Enumerations.
20269 * assign.cs: Report the error, instead of failing silently
20271 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20272 typecontainer that they are declared, because the
20273 typecontainer/namespace will have the list of using clauses that
20274 need to be applied.
20276 Assembly Attributes were escaping the normal registration
20279 (EmitCode): Apply attributes within an EmitContext that represents
20280 the container they were declared on.
20282 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20284 2002-05-06 Ravi Pratap <ravi@ximian.com>
20286 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20287 Revamp completely - make much cleaner as we now operate only
20290 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20291 to implement the logic detailed in the spec more correctly.
20293 (UserDefinedConversion): Update accordingly.
20295 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20297 * statement.cs: Return flow analysis information up.
20299 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20302 (token): Do not consume an extra character before calling
20305 2002-05-06 Piers Haken <piersh@friskit.com>
20307 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20309 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20311 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20312 EmitContext during the instance constructor initializer
20313 resolution, to stop access to instance variables.
20315 This is mandated by the spec, last paragraph of the `constructor
20316 initializers' section.
20318 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20320 * cs-parser.jay, class.cs (Accessor): new class used to represent
20321 an accessor (get or set). In the past we used `null' to represent
20322 a missing accessor. But this is ambiguous because there was no
20323 way to tell in abstract indexers/properties if one of them was
20326 Now there is a way of addressing that.
20328 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20329 instead of FindMembers.
20331 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20332 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20334 * attribute.cs: Treat indexers and properties as the same in terms
20335 of applying attributes
20337 * ecore.cs (FindMostEncompassedType): Use statically initialized
20338 EmptyExpressions()s like we do elsewhere to avoid creating useless
20339 objects (and we take this out of the tight loop).
20341 (GetConversionOperators): Move the code to extract the actual
20342 operators to a separate routine to clean things up.
20344 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20346 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20347 events are always registered FieldBuilders.
20349 * class.cs (FieldBase): New class shared by Fields
20351 * delegate.cs: If we are a toplevel delegate, use our full name.
20352 If we are a nested delegate, then only use our tail name.
20354 2002-05-02 Ravi Pratap <ravi@ximian.com>
20356 * expression.cs (IsApplicable): Ensure that we add the "&" to
20357 ref/out types before comparing it with the type of the argument.
20359 (IsParamsMethodApplicable): Ditto.
20361 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20364 * delegate.cs : Handle the case when we have more than one applicable
20365 method. Flag an error only when we finish checking all.
20367 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20369 * expression.cs: Add support for boolean static initializers.
20371 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20373 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20375 * parameter.cs (ComputeParameterTypes,
20376 ComputeAndDefineParameterTypes): Better error handling: now we
20377 clear the `types' cache if we fail during any of the type lookups.
20378 We also return the status code correctly to our caller
20380 * delegate.cs: If we fail to define a delegate, abort the extra
20383 * expression.cs (Binary.ResolveOperator): for
20384 operator==(object,object) and operator !=(object, object) we also
20385 have to verify that there is an implicit conversion from one to
20388 (ArrayAccess.DoResolve): Array Access can operate on
20391 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20393 * assign.cs (CompoundAssign): A new class used as a "flag" that
20394 the assignment actually is happening as part of a compound
20395 assignment operator.
20397 During compound assignment, a few new rules exist to enable things
20404 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20405 to the type of x) if y is implicitly convertible to the type of x,
20406 and the operator is a builtin operator and the return type of the
20407 operator is explicitly convertible to the type of x.
20409 * rootcontext.cs: Reset warning level to 2. 4 catches various
20410 "interesting" features in mcs, we must clean this up at some
20411 point, but currently am trying to kill other bugs ;-)
20413 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20414 in container classes as well.
20416 * expression.cs (Binary.ResolveOperator): Handle string case
20417 before anything else (as operator overloading does emit an error
20418 before doing anything else).
20420 This code could go away when we move to a table driven model, but
20421 i could not come up with a good plan last night.
20423 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20425 * typemanager.cs (CSharpName): reimplementation using regex.
20426 * class.cs: added null check for fields in Emit
20427 * rootcontext.cs: set warninglevel to 4
20429 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20431 * typemanager.cs (CSharpName): reimplemented with Lupus
20434 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20436 * statement.cs (If): correclty implement Resolve, because we were
20437 not catching sem errors in there. The same process is needed
20439 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20442 (Statement.Warning_DeadCodeFound): Factorize code.
20443 (While): Report dead code here too.
20445 (Statement): Added Resolve virtual method to allow
20446 for resolution split from the emit code.
20448 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20450 * statement.cs (EmitBoolExpression): No longer try to resolve the
20452 (MakeBoolean): New utility function that resolve, implicitly
20453 converts to boolean and tags the expression.
20456 (If, Do): Implement dead code elimination.
20457 (While): Implement loop inversion
20459 (Do, While, For, If): Resolve the expression prior to calling our
20462 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20465 - added method Report28 (warning: program has more than one entry point)
20466 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20467 - modified method Method.Define, the part at the end of the method
20469 * rootcontext.cs: added static public Location EntryPointLocation;
20471 * ../errors/cs0028.cs : Add test case for the above warning.
20474 - modified method CSharpName to allow arrays of primitive type to
20475 be printed nicely (e.g. instead of System.Int32[][] it now prints
20477 - added method CSharpSignature: returns the signature of a method
20478 in string format to be used in reporting errors, warnings, etc.
20480 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20483 2002-04-26 Ravi Pratap <ravi@ximian.com>
20485 * delegate.cs (Define): Fix extremely silly bug where I was
20486 setting the type of the 'object' parameter of the BeginInvoke
20487 method to System.IAsyncResult instead of System.Object ;-)
20489 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20491 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20494 (Constructor.Emit): return if we fail to initialize the
20495 constructor. Another door closed!
20497 * expression.cs (New.DoResolve): Improve error message (from -6 to
20498 1501). Use DeclaredOnly lookup to find the exact constructor.
20500 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20501 loop. This is useful.
20503 * cs-parser.jay: Adjust the default parameters so that destructors
20504 have the proper signature.
20506 2002-04-26 Martin Baulig <martin@gnome.org>
20508 * driver.cs (LoadAssembly): If `assembly' contains any characters
20509 which are only valid in path names and not in assembly names
20510 (currently slash, backslash and point), use Assembly.LoadFrom ()
20511 instead of Assembly.Load () on the `assembly' (before iteration
20512 over the link_paths).
20514 2002-04-26 Martin Baulig <martin@gnome.org>
20516 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20518 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20520 * class.cs (Property): use the new typemanager.MemberLookup
20522 (TypeContainer.MemberLookup): Implement using the
20523 TypeManager.MemberLookup now.
20525 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20526 and return MemberInfos, so that these can be used without an
20527 EmitContext (what we had before).
20529 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20531 * expression.cs: Fix the case where the argument to params if the
20532 type of the params. I omitted handling this before. Fixed
20534 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20536 * driver.cs: Call BootCorlib_PopulateCoreType
20538 * class.cs (Property.CheckBase): Check for properties only, not
20541 * interface.cs: Temporary hack: try/catch around the
20542 CustomAttributeBuilder, because I am getting an exception that I
20545 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20546 types whose definitions are required to be there (attributes are
20547 defined before standard types).
20549 Compute definitions as we boot the various types, as they are used
20550 immediately (value_type class will need object_type, but if we do
20551 not initialize object_type, we will pass a null, which will let
20552 the runtime pick the System.Object from the existing corlib, which
20553 is not what we want).
20555 2002-04-22 Patrik Torstensson <totte@labs2.com>
20557 * cs-tokenizer.cs: fixed a number of trim() issues.
20559 2002-04-22 Ravi Pratap <ravi@ximian.com>
20561 * expression.cs (Argument.Type): Ensure that we return the correct
20562 type when we have out or ref parameters [in which case we
20565 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20567 * class.cs (Property, Indexer): Allow extern modifier in there.
20569 * typemanager.cs (InitBaseTypes): Initializes object_type and
20570 value_type, since those will be used early on during the bootstrap
20571 process to compile corlib.
20573 (InitCoreTypes): Move code from here to InitBaseTypes.
20575 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20577 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20578 single-dimension arrays as using the ldlen opcode.
20580 Daniel Lewis discovered this optimization.
20582 * typemanager.cs: Add signature for System.Array::get_Length
20584 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20586 * statement.cs: report the error when the foreach does not apply to an
20587 array nor a collection.
20589 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20591 * expression.cs: Add implicit conversions to the operator ~.
20593 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20595 * typemanager.cs: Locate the decimal constructor.
20597 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20599 * attribute.cs: use the new property of TypeOf.
20600 * expression.cs: added 'get' property around typearg.
20602 These changes fix a build breaker reported by NickD. Is this the
20603 correct way to fix? If not, please, revert my changes and make it
20606 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20608 * attribute.cs: Add support for typeof in attribute invocations.
20609 I am not sure that this is right though.
20611 2002-04-14 Duncan Mak <duncan@ximian.com>
20613 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20614 Binary.Operator.Division case.
20616 2002-04-13 Ravi Pratap <ravi@ximian.com>
20618 * class.cs (DefineType): Ensure that we do a proper check on
20619 attribute types and also register it with the TypeManager.
20621 (TypeContainer.Targets): The default for attribute types is
20622 AttributeTargets.All.
20624 * attribute.cs (ApplyAttributes): Registering the attribute type
20625 is done elsewhere, not when we discover we have a Usage attribute.
20627 2002-04-12 Ravi Pratap <ravi@ximian.com>
20629 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20630 and get rid of is_delegate parameter.
20632 * everywhere : update.
20634 2002-04-12 Ravi Pratap <ravi@ximian.com>
20636 * cs-parser.jay (compilation_unit): Revamp completely to use
20637 some new ideas that I got from Rhys' grammar to solve the problems
20638 with assembly level attributes.
20640 (outer_declaration): New grammar production.
20642 (attribute_sections): Add.
20644 (opt_attributes): Base on attribute_sections
20646 (namespace_declaration): Allow opt_attributes to tackle the case
20647 when we have assembly level attributes - we are clever in this
20650 * attribute.cs (ApplyAttributes): Do not worry about assembly
20651 attributes in the non-global context.
20653 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20654 instead of SetGlobalAttributes.
20656 * class.cs, rootcontext.cs : Ensure we define and generate
20657 attribute types before anything else.
20659 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20660 and flag the new error -20 for the case when the attribute type
20661 does not have valid targets specified. csc does not catch this.
20663 * ../errors/errors.txt : update for error # -20
20665 2002-04-11 Ravi Pratap <ravi@ximian.com>
20667 * support.cs (InternalParameters.ParameterModifier): Do some null
20668 checking and return sane values.
20670 * class.cs (Method.Define): If we are a PInvoke method, ensure
20671 that we are static and extern. Report error # 601
20673 * ../errors/cs0601.cs : Add test case for the above error.
20675 2002-04-07 Ravi Pratap <ravi@ximian.com>
20677 * rootcontext.cs (attribute_types): We need to keep type of
20678 all attribute types separately and emit code for them first.
20680 (RegisterAttribute) : Implement.
20682 * class.cs (DefineType): Check if the current Type is a custom
20683 attribute type and register it accordingly.
20685 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20686 adding the first attribute twice and rename to
20688 (SetGlobalAttributes): this.
20690 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20693 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20694 if we are processing global arguments. Hmm, I am unsure of this.
20696 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20698 * expression.cs: added static array of strings to avoid calling
20699 Enum.ToString () for Operator in Binary. Significant recover of
20702 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20704 * class.cs (FindMembers): Allow the Builders of the various
20705 members to be null. If they are skip them. This only happens
20706 during the PInvoke declaration.
20708 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20710 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20711 failure, so we do not keep going afterwards.
20713 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20714 wanted to pass `false' as the `is_delegate' argument. If this is
20715 the case, why not use delegate_type == null to mean `is_delegate =
20716 false' and anything else as is_delegate = true.
20718 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20720 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20721 code for the section, not the beginning of the tests.
20723 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20725 * cfold.cs: Handle operator + (Enum x, Underlying x)
20727 * expression.cs (Binary): same. Warn about errors where we have
20728 Enum/Enum in operator + as well.
20730 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20733 - added support for switch(bool)
20734 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20735 - add TableSwitchEmit() to handle table-based switch statements
20737 2002-04-05 Ravi Pratap <ravi@ximian.com>
20739 * expression.cs (Invocation.OverloadResolve): Factor out code which
20740 does parameter compatibility checking with arguments so that we can
20741 re-use the code even from Delegate.VerifyApplicability
20743 (VerifyArgumentsCompat): Move above code here.
20745 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20746 and instead make a call to the above method.
20748 2002-03-31 Ravi Pratap <ravi@ximian.com>
20750 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20751 We use it to keep track of classes which are attribute types.
20753 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20755 * delegate.cs (Delegate.Define): Correctly define the types in the
20756 presence of fixed and array parameters.
20758 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20761 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20762 include NonPublic after the first iteration.
20764 * class.cs (Indexer.CheckBase): Only check if both parents are
20767 * cs-parser.jay (accessor_body): If empty, set to null.
20769 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20770 same code path here to resolve constants names that we did have in
20771 MemberAccess.DoResolve. There is too much code duplicated here.
20773 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20775 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20777 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20780 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20781 tokens, numbers and strings.
20783 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20786 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20787 asyncronous parameters and the regular parameters.
20789 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20790 specify the target directory.
20792 * expression.cs: (This.DoResolve): Simplify
20793 (As.Emit): Optimize, do not generate IsInst if the expression is
20794 always of the given type.
20796 (Is.DoResolve): Bug fix, we were reporting both always/never for
20799 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20800 creating too many unnecessary arrays.
20802 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20804 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20805 fields instead of rolling our own initializer. Takes care of all
20806 implicit conversions, and drops unnecessary static checks/argument.
20808 2002-03-31 Dick Porter <dick@ximian.com>
20810 * driver.cs: use the GetDirectories() return values properly, and
20811 use "/" as path separator.
20813 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20815 * expression.cs (Unary): Optimize - - expr into expr.
20816 (Binary): Optimize a + (-b) into a -b.
20818 * codegen.cs (CodeGen): Made all methods static.
20820 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20824 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20825 TypeBuilder property.
20827 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20830 * tree.cs: Removed the various RecordXXXX, and replaced with a
20831 single RecordDecl. Removed all the accessor methods, and just
20832 left a single access point Type
20834 * enum.cs: Rename DefineEnum to DefineType.
20836 * decl.cs: New abstract method `DefineType' used to unify the
20837 Defines for Enumerations, Interfaces, TypeContainers and
20840 (FindType): Moved LookupInterfaceOrClass here. Moved the
20841 LookupBaseClasses method that used to live in class.cs and
20842 interface.cs here, and renamed to FindType.
20844 * delegate.cs: Implement DefineType. Take advantage of the
20845 refactored pattern for locating the parent builder without taking
20846 the parent_builder argument (which we know does not work if we are
20847 nested, and triggering a toplevel definition).
20849 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20851 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20852 accessibility of a member has changed during override and report
20855 * class.cs (Method.Define, Property.Define): Only complain on
20856 overrides if the method is private, any other accessibility is
20857 fine (and since we just checked the permission is the same, we are
20860 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20861 and elif are processed always. The other pre-processing
20862 directives are only processed if we are "taking" the path
20864 2002-03-29 Martin Baulig <martin@gnome.org>
20866 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20867 current location is not Null.
20869 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20870 a separate method so we can profile it.
20872 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20873 `span.Seconds' are just seconds, but no minutes or hours.
20874 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20876 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20878 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20879 Remove the gratuitous set of Final:
20881 // If an interface implementation, then we can set Final.
20882 if (((flags & MethodAttributes.Abstract) == 0) &&
20883 implementing.DeclaringType.IsInterface)
20884 flags |= MethodAttributes.Final;
20886 I do not know what I was smoking when I used that.
20889 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20890 step into fixing the name resolution issues for delegates and
20891 unifying the toplevel name resolution.
20893 2002-03-28 Martin Baulig <martin@gnome.org>
20895 * class.cs (Method.Emit): If we have a symbol writer, call its
20896 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20897 tell it about the current method.
20899 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20900 writer that we're going to emit the first byte of IL code for a new
20901 statement (a new source line).
20902 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20903 EmitContext.Mark() before emitting any code.
20905 * location.cs (SymbolDocument): Return null when we're Null.
20907 * statement.cs (Statement): Moved the `Location loc' variable here.
20908 (Statement.EmitBoolExpression): If we have a symbol writer, call
20909 ec.Mark() before emitting any code to tell it that we're at the
20910 beginning of a new statement.
20911 (StatementExpression): Added `Location' argument to the constructor.
20912 (Block): Added public readonly variable `StartLocation' and public
20913 variable `EndLocation'. The latter is to be set using SetEndLocation().
20914 (Block): Added constructor which takes a start and end location.
20915 (Block.SetEndLocation): New method. This sets the end location.
20916 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20917 local variables we create.
20918 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20919 each statement and do also mark the begin and end of the block.
20921 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20922 tell it the current lexer.Location, use Location.Null for the end of the
20924 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20925 current block, set its end location using SetEndLocation().
20926 (statement_expression): StatementExpression constructor now takes the
20927 lexer.Location as additional argument.
20928 (for_statement, declare_local_variables): Likewise.
20929 (declare_local_variables): When creating a new implicit block, use the
20930 new Block constructor and pass it the lexer.Location.
20932 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20934 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20935 members also on the parent interfaces recursively.
20937 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20939 * report.cs: Use new formats, since Gonzalo finished the missing
20942 * expression.cs (Binary.ResolveOperator): added missing operator|
20943 operator& and operator^ for bool/bool.
20945 * cs-parser.jay: CheckDef now takes a Location argument that is
20946 used to report errors more precisly (instead of reporting the end
20947 of a definition, we try to track something which is a lot closer
20948 to the source of the problem).
20950 * cs-tokenizer.cs: Track global token use, so we can properly flag
20951 the use of #define/#undef after the first token has been seen.
20953 Also, rename the reportXXXX to Error_DescriptiveName
20955 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20956 TypeContainer, so that Enum and Interface can use this too.
20958 * class.cs (TypeContainer.LookupInterfaceOrClass,
20959 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20960 `builder' argument. Typically this was used to pass the parent
20961 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20964 The problem is that a nested class could trigger the definition of
20965 a toplevel class, and the builder would be obviously wrong in that
20968 So we drop this argument, and we compute dynamically the
20969 TypeBuilder/ModuleBuilder (the correct information was available
20970 to us anyways from DeclSpace.Parent)
20972 * interface.cs (Interface.DefineInterface): Drop builder
20973 parameter cleanup like class.cs
20975 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20978 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20981 (Try.Emit): Propagate the returns value from the statement.
20983 (Return.Emit): Even if we are leavning
20985 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20987 * modifiers.cs: Fix the computation of MethodAttributes flags.
20989 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20991 * driver.cs: allow compilation of files that start with '/'.
20992 Add a default case when checking the argument of --target.
20994 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20996 * interface.cs: Implement the same search algorithm for types in
20997 the interface code.
20999 * delegate.cs: Do not allow multiple definition.
21001 * Recovered ChangeLog that got accidentally amputated
21003 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21005 * rootcontext.cs: Load manually enum to allow core classes to
21006 contain enumerations.
21008 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21009 Update to new static methods in TypeManager.
21011 * typemanager.cs (GetMethod, GetConstructor): Use our
21012 implementation of FindMembers to find the members, since during
21013 corlib compilation, the types are TypeBuilders and GetMethod and
21014 GetConstructor do not work.
21016 Make all methods in TypeManager static.
21018 (InitCodeHelpers): Split the functionality from
21019 the InitCodeTypes function.
21021 * driver.cs: Call InitCodeHelpers after we have populated the
21024 * cs-parser.jay (delegate_declaration): we did not used to compute
21025 the delegate name correctly for void delegates.
21027 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21029 * rootcontext.cs (RootContext): Init the interface_resolve_order
21030 and type_container_resolve_order always.
21032 (ResolveCore, BootstrapCorlib_ResolveClass,
21033 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21034 compiler when compiling with --nostdlib
21036 * class.cs (TypeContainer.DefineType): Check that our parent is
21037 not null. This test is most important when we are bootstraping
21040 * codegen.cs: Split out the symbol writing code.
21042 2002-03-25 Martin Baulig <martin@gnome.org>
21044 * driver.cs (-g): Made -g an alias for --debug.
21046 2002-03-24 Martin Baulig <martin@gnome.org>
21048 * codegen.cs (SymbolWriter): New public variable. Returns the
21049 current symbol writer.
21050 (CodeGen): Added `bool want_debugging_support' argument to the
21051 constructor. If true, tell the ModuleBuild that we want debugging
21052 support and ask it for the ISymbolWriter.
21053 (Save): If we have a symbol writer, call it's Close() method after
21054 saving the assembly.
21056 * driver.c (--debug): New command line argument to create a
21057 debugger information file.
21059 * location.cs (SymbolDocument): New public property. Returns an
21060 ISymbolDocumentWriter object for the current source file or null
21061 if we don't have a symbol writer.
21063 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21065 * driver.cs (LoadAssembly): Correctly return when all the paths
21066 have been tried and not before.
21068 * statement.cs (Switch.Emit): return the actual coverage for this
21069 statement (returns/not-returns)
21071 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21072 switch of the statement if we are the last switch section. That
21073 kills two problems: try/catch problems (we used to emit an empty
21074 nop at the end) and switch statements where all branches would
21077 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21079 * driver.cs: Add default assemblies (the equivalent to the
21080 Microsoft CSC.RSP file)
21082 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21083 also update tokens_seen and set it to false.
21085 * driver.cs: Implement --recurse for Mike.
21087 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21088 correctly splitting out the paths.
21090 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21092 * interface.cs (Interface.PopulateProperty): Instead of using
21093 `parent' as the declaration space for the set parameters, use
21096 * support.cs (InternalParameters): InternalParameters constructor
21097 takes a DeclSpace instead of a TypeContainer.
21099 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21100 types are being initialized, load the address of it before calling
21103 (New): Provide a mechanism to disable the generation of local
21104 value type temporaries when the caller will be providing us with
21105 an address to store it.
21107 (ArrayCreation.EmitDynamicInitializers): Use it.
21109 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21111 * expression.cs (Invocation.EmitArguments): Only probe for array
21112 property if there is more than one argument. Sorry about that.
21114 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21115 empty param arrays.
21117 * class.cs (Method.LabelParameters): Fix incorrect code path that
21118 prevented the `ParamArrayAttribute' from being applied to the
21121 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21123 * support.cs (ReflectionParameters): Correctly compute whether the
21124 last argument is a params array. Fixes the problem with
21127 * typemanager.cs: Make the assemblies array always be non-null
21128 (empty, but non-null)
21130 * tree.cs (RecordDecl): New function that abstracts the recording
21131 of names. This reports error 101, and provides a pointer to the
21132 previous declaration. Fixes a crash in the compiler.
21134 * cs-parser.jay (constructor_declaration): Update to new grammar,
21135 and provide a constructor_body that can be empty.
21137 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21139 * driver.cs: Add support for --resources.
21141 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21142 Make all types for the various array helper methods be integer.
21144 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21145 CheckState to ConvCast.
21147 (ConvCast): Now it takes a `checked' state argument, to avoid
21148 depending on the emit context for the conversion, and just using
21149 the resolve time setting.
21151 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21152 instead of Invocation.EmitArguments. We do not emit the original
21153 arguments, instead we emit those which have been converted to
21154 unsigned int expressions.
21156 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21158 * codegen.cs: ditto.
21160 * expression.cs (LocalVariableReference): Drop the use of the
21161 Store function that depended on the variable index.
21163 * statement.cs (VariableInfo): Drop the `Idx' property from this
21164 class, as this is not taking into account the indexes for
21165 temporaries tat we generate during the execution, getting the
21168 * class.cs: First emit class initializers, then call the parent
21171 * expression.cs (Binary): Fix opcode emision.
21172 (UnaryMutator.EmitCode): Support checked code generation
21174 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21175 matches for events for both the Static and Instance scans,
21176 pointing to the same element. Fix that.
21178 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21180 * rootcontext.cs (ResolveTree): Always set the
21181 interface_resolve_order, because nested interfaces will be calling
21184 * class.cs (GetInterfaceOrClass): Track the same resolution
21185 process used by TypeManager.LookupType. This fixes the nested
21186 type lookups in class declarations (separate path from
21189 (TypeContainer.DefineType): Also define nested interfaces.
21190 (TypeContainer.RegisterOrder): New public function used to
21191 register the order in which child interfaces need to be closed.
21193 Nested interfaces need to be closed after their parents have been
21196 * interface.cs (InterfaceAttr): Put all the logic for computing
21197 the interface attribute here.
21199 (DefineInterface): Register our interface order with the
21200 RootContext or with the TypeContainer depending on the case.
21202 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21204 * cs-parser.jay: rework foreach statement to work with the new
21205 changes to the policy on SimpleNames.
21207 * report.cs: support Stacktrace on warnings as well.
21209 * makefile: drop --unsafe and /unsafe from the compile.
21211 2002-03-13 Ravi Pratap <ravi@ximian.com>
21213 * ecore.cs (StandardConversionExists): Modify to take an Expression
21214 as the first parameter. Ensure we do null -> reference type conversion
21217 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21218 temporary Expression objects.
21220 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21222 * interface.cs: workaround bug in method overloading resolution
21223 (there is already a bugzilla bug for it).
21225 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21227 We could also solve this problem by having a separate path for
21228 performing type lookups, instead of DoResolve, we could have a
21229 ResolveType entry point, and only participating pieces of the
21230 production (simplename, deref, array) would implement this.
21232 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21233 signal SimpleName to only resolve type names and not attempt to
21234 resolve anything else.
21236 * expression.cs (Cast): Set the flag.
21238 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21240 * class.cs: Only report 108 if there is no `new' modifier.
21242 * cs-parser.jay: rework foreach statement to work with the new
21243 changes to the policy on SimpleNames.
21245 * report.cs: support Stacktrace on warnings as well.
21247 * makefile: drop --unsafe and /unsafe from the compile.
21249 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21251 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21252 lookups here, instead of doing that at parse time. This means
21253 that our grammar will not introduce `LocalVariableReferences' as
21254 expressions at this point. That solves the problem of code like
21258 static void Main ()
21262 This is only half the fix. The full fix requires parameters to
21263 also be handled in this way.
21265 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21266 makes the use more obvious of the DeclSpace. The
21267 ec.TypeContainer.TypeBuilder is now only used to pull the
21268 TypeBuilder for it.
21270 My theory is that I can get rid of the TypeBuilder completely from
21271 the EmitContext, and have typecasts where it is used (from
21272 DeclSpace to where it matters).
21274 The only pending problem is that the code that implements Aliases
21275 is on TypeContainer, and probably should go in DeclSpace.
21277 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21278 lookups here, instead of doing that at parse time. This means
21279 that our grammar will not introduce `LocalVariableReferences' as
21280 expressions at this point. That solves the problem of code like
21284 static void Main ()
21288 This is only half the fix. The full fix requires parameters to
21289 also be handled in this way.
21291 * class.cs (Property.DefineMethod): When implementing an interface
21292 method, set newslot, when implementing an abstract method, do not
21293 set the flag (before we tried never setting it, or always setting
21294 it, which is the difference).
21295 (Indexer.DefineMethod): same.
21296 (Method.DefineMethod): same.
21298 * ecore.cs: Only set the status used flag if we get back a Field.
21300 * attribute.cs: Temporary hack, so Paolo can keep working.
21302 2002-03-08 Ravi Pratap <ravi@ximian.com>
21304 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21305 the unmanaged type in the case we have a MarshalAs attribute.
21307 (Resolve): Handle the case when we are parsing the special MarshalAs
21308 attribute [we need to store the unmanaged type to use later]
21310 * typemanager.cs (marshal_as_attr_type): Built in type for the
21311 MarshalAs Attribute.
21313 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21314 on parameters and accordingly set the marshalling info.
21316 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21318 * class.cs: Optimizing slightly by removing redundant code after
21319 we switched to the `NoTypes' return value.
21320 (Property.DefineMethod): use NoTypes here too.
21322 This fixes the bug I introduced in my last batch of changes.
21324 2002-03-05 Ravi Pratap <ravi@ximian.com>
21326 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21328 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21329 Enums since those are types too.
21331 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21333 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21334 thanks to a call during the lookup process.
21336 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21338 * statement.cs (Foreach): Lots of work to accomodate a particular
21339 kind of foreach statement that I had not kept in mind. It is
21340 possible to have foreachs on classes that provide a GetEnumerator
21341 method that return objects that implement the "pattern" for using
21342 a foreach, there is no need to support GetEnumerator
21345 This is needed to compile nant.
21347 * decl.cs: Only report 114 if the member is not `Finalize' and if
21348 the warning level is at least 2.
21350 * class.cs: Moved the compare function from Method to
21353 (MethodSignature.InheritableMemberSignatureCompare): Add new
21354 filter function that is used to extract inheritable methods from a
21357 (Method.Define): Use the new `inheritable_method_signature_filter'
21360 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21363 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21365 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21367 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21369 * expression.cs: Pass location information to
21370 ConvertImplicitStandard.
21372 * class.cs: Added debugging code to track return values from
21375 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21377 * expression.cs (Is.DoResolve): If either side of the `is' is an
21378 interface, do not flag the warning.
21380 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21383 * report.cs: Allow for --fatal to be used with --probe.
21385 * typemanager.cs (NoTypes): Move the definition for the empty Type
21388 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21390 (TypeContainer.DefineProxy): New function used to proxy to parent
21391 implementations when implementing interfaces.
21392 (TypeContainer.ParentImplements): used to lookup if our parent
21393 implements a public function that is required by an interface.
21394 (TypeContainer.VerifyPendingMethods): Hook this up.
21396 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21397 `modules' and `assemblies' arraylists into arrays. We only grow
21398 these are the very early start up of the program, so this improves
21399 the speedof LookupType (nicely measured).
21401 * expression.cs (MakeByteBlob): Replaced unsafe code with
21402 BitConverter, as suggested by Paolo.
21404 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21405 folding of string concatenation, but if either side is a string,
21406 and the other is not, then return null, and let the runtime use
21407 the concatenation on the string plus the object (using
21408 `Object.ToString').
21410 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21412 Constant Folding has been implemented now.
21414 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21415 the error instead on types that are not supported in one's
21418 * constant.cs (Constant and all children): New set of functions to
21419 perform implict and explicit conversions.
21421 * ecore.cs (EnumConstant): Implement the new functions to perform
21422 conversion by proxying to the child expression.
21424 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21425 own separate setting that can not be turned off from the command
21426 line using --unchecked or --checked and is only controlled using
21427 the checked/unchecked statements and expressions. This setting is
21428 used by the constant folder to flag errors.
21430 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21431 ConstantCheckState as well.
21433 During Resolve, they also have to flag the state, because the
21434 constant folder runs completely in the Resolve phase.
21436 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21439 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21441 * cfold.cs: New file, this file contains the constant folder.
21443 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21444 argument to track whether we are using the resulting address to
21445 load or store a value and provide better error messages.
21447 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21448 new AddressOf arguments.
21450 * statement.cs (Foreach.EmitCollectionForeach): Update
21452 * expression.cs (Argument.Emit): Call AddressOf with proper
21453 arguments to track usage.
21455 (New.DoEmit): Call AddressOf with new arguments.
21457 (Unary.Emit): Adjust AddressOf call.
21459 2002-03-01 Ravi Pratap <ravi@ximian.com>
21461 * cs-parser.jay (member_access): Change the case for pre-defined types
21462 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21465 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21468 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21469 essentially like methods and apply attributes like MethodImplOptions to them too.
21471 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21474 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21475 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21478 * Update code everywhere accordingly.
21480 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21482 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21484 2002-02-28 Ravi Pratap <ravi@ximian.com>
21486 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21487 try performing lookups against those instead of jumping straight into using
21488 the 'using' clauses.
21490 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21492 (LookupType): Perform lookups in implicit parents too.
21494 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21495 sequence as RootContext.LookupType.
21497 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21498 the various cases of namespace lookups into this method.
21500 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21502 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21503 in positional arguments)
21505 * class.cs (Operator): Update the AllowedModifiers to contain
21508 * cs-parser.jay: Update operator declaration to allow for the
21509 operator body to be empty.
21511 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21514 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21516 * class.cs (Method.Emit): Label parameters.
21518 * driver.cs: Return 1 or 0 as the program exit code.
21520 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21522 * expression.cs: Special case the `null' object when trying to
21523 auto-compute the type, as anything can be explicitly converted to
21526 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21527 spotting this Paolo.
21529 (Expression.ImplicitNumericConversion): Perform comparissions of
21530 the type using the underlying type in the case of an enumeration
21531 rather than using the enumeration type for the compare.
21533 Cope with the underlying == type case, which is not possible to
21536 (Expression.ConvertNumericExplicit): Perform comparissions of
21537 the type using the underlying type in the case of an enumeration
21538 rather than using the enumeration type for the compare.
21540 * driver.cs: If the user does not supply an extension, assume .exe
21542 * cs-parser.jay (if_statement): Rewrote so that we can track the
21543 location for the if statement.
21545 * expression.cs (Binary.ConstantFold): Only concat strings when
21546 the operation is "+", not everything ;-)
21548 * statement.cs (Statement.EmitBoolExpression): Take a location
21550 (If, While, Do): Track location.
21552 * expression.cs (Binary.ResolveOperator): In the object + string
21553 case, I was missing a call to ConvertImplicit
21555 2002-02-25 Ravi Pratap <ravi@ximian.com>
21557 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21558 Location arguments. Ensure we use RootContext.LookupType to do our work
21559 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21561 * interface.cs (PopulateMethod): Handle the type of the parameter being
21564 * expression.cs (Invocation.BetterFunction): Handle the case when we
21565 have a params method with no fixed arguments and a call is made with no
21568 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21570 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21571 the verbatim-string-literal
21573 * support.cs (InternalParameters.ParameterModifier): handle null
21575 (InternalParameters.ParameterType): ditto.
21577 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21578 duplicating the name of the variable parameter.
21579 (GetParameterByName): Fix bug where we were not looking up array
21580 paramters if they were the only present (thanks Paolo!).
21581 (GetParameterInfo): We only have an empty set of types if both
21582 fixed and array are set to null.
21583 (GetParameterInfo-idx): Handle FixedParameter == null
21585 * cs-parser.jay: Handle the case where there is no catch
21586 statements (missing null test).
21588 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21590 * driver.cs (MainDriver): Be conservative on our command line
21593 Catch DirectoryNotFoundException when calling GetFiles.
21595 (SplitPathAndPattern): Used to split the input specification into
21596 a path and a pattern that we can feed to Directory.GetFiles.
21598 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21600 * statement.cs (Fixed): Implement the last case of the Fixed
21601 statement (string handling).
21603 * expression.cs (StringPtr): New class used to return a char * to
21604 a string; Used by the Fixed statement.
21606 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21608 * expression.cs (Binary.ResolveOperator): Remove redundant
21609 MemberLookup pn parent type.
21610 Optimize union call, we do not need a union if the types are the same.
21611 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21614 Specialize the use of MemberLookup everywhere, instead of using
21615 the default settings.
21617 (StackAlloc): Implement stackalloc keyword.
21619 * cs-parser.jay: Add rule to parse stackalloc.
21621 * driver.cs: Handle /h, /help, /?
21623 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21624 before we supported unsafe code.
21626 * makefile: add --unsafe to the self compilation of mcs.
21628 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21630 * expression.cs (PointerArithmetic): New class that is used to
21631 perform pointer arithmetic.
21632 (Binary.Resolve): Handle pointer arithmetic
21633 Handle pointer comparission.
21634 (ArrayPtr): Utility expression class that is used to take the
21635 address of an array.
21637 (ElementAccess): Implement array access for pointers
21639 * statement.cs (Fixed): Implement fixed statement for arrays, we
21640 are missing one more case before we are done.
21642 * expression.cs (Indirection): Implement EmitAssign and set the
21643 ExprClass to Variable. This allows pointer dereferences to be
21644 treated as variables, and to have values assigned to them.
21646 * ecore.cs (Expression.StoreFromPtr): New utility function to
21647 store values dereferencing.
21649 2002-02-20 Ravi Pratap <ravi@ximian.com>
21651 * expression.cs (Binary.ResolveOperator): Ensure that we are
21652 not trying to operate on a void type - this fixes the reported
21655 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21656 the parent implementation is sealed.
21658 * ../errors/cs0239.cs : Add.
21660 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21662 * typemanager.cs (unverifiable_code_type): Corresponds to
21663 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21664 which have unsafe code in them.
21666 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21669 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21671 * cs-tokenizer.cs: Add support for @"litreal strings"
21673 Make tokenizer accept pre-processor directives
21674 on any column (remove the old C-like limitation).
21676 * rootcontext.cs (EmitCode): Emit any global attributes.
21677 (AddGlobalAttributes): Used to keep track of assembly attributes.
21679 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21681 * cs-parser.jay: Add support for global attributes.
21683 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21685 * expression.cs (Indirection): New helper class. Unary will
21686 create Indirection classes to be able to implement the
21687 IMemoryLocation interface on it.
21689 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21691 * cs-parser.jay (fixed_statement): reference the right statement.
21693 * statement.cs (Fixed.Emit): Finish implementing the fixed
21694 statement for the &x case.
21696 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21698 * class.cs (Property.Define, Method.Define): Remove newslot when
21701 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21702 wrong. NewSlot should only be used if the `new' keyword is present.
21704 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21705 locating our system dir. Sorry about this.
21707 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21709 * driver.cs (GetSystemDir): Compute correctly the location of our
21710 system assemblies. I was using the compiler directory instead of
21711 the library directory.
21713 2002-02-13 Ravi Pratap <ravi@ximian.com>
21715 * expression.cs (BetterFunction): Put back in what Miguel commented out
21716 since it is the correct fix. The problem is elsewhere ;-)
21718 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21719 parameters of the parms method are themselves compatible or not !
21721 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21722 to check that a class implements an interface before saying that an implicit
21723 conversion was allowed. Use ImplementsInterface to do the checking.
21725 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21727 * class.cs (Method.Define): Track whether we are an explicit
21728 implementation or not. And only call DefineMethodOverride if we
21729 are an explicit implementation.
21731 (Property.DefineMethod): Ditto.
21733 2002-02-11 Ravi Pratap <ravi@ximian.com>
21735 * expression.cs (BetterFunction): Catch hideous bug which was
21736 preventing us from detecting ambiguous calls due to implicit casts i.e
21739 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21741 * support.cs (Pair): Remove un-needed method. I figured why I was
21742 getting the error in cs-parser.jay, the variable in a foreach loop
21743 is readonly, and the compiler does not really treat this as a variable.
21745 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21746 instead of EQUALS in grammar.
21748 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21750 * expression.cs (Unary.DoResolve): Check whether the argument is
21753 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21755 * support.cs: Api for Pair to set a value. Despite the fact that
21756 the variables are public the MS C# compiler refuses to compile
21757 code that accesses the field if the variable is part of a foreach
21760 * statement.cs (Fixed): Begin implementation of the fixed
21763 (Block.AddVariable): Return the VariableInfo on success and null
21764 on failure instead of true/false.
21766 * cs-parser.jay (foreach): Catch errors on variables already
21767 defined (we were ignoring this value before) and properly unwind
21768 the block hierarchy
21770 (fixed_statement): grammar for the fixed statement.
21772 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21774 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21775 pointer types to be incretemented.
21777 (SizeOf): Implement.
21779 * cs-parser.jay (pointer_member_access): Implement
21780 expr->IDENTIFIER production.
21782 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21783 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21786 (Unary): Implement indirection.
21788 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21789 use in non-unsafe context).
21791 (SimpleName.DoResolve): Check for pointers in field access on safe
21794 (Expression.LoadFromPtr): Factor the load-indirect code in this
21795 function. This was duplicated in UnboxCast and ParameterReference
21797 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21799 * expression.cs (ComposedCast): report an error if a pointer cast
21800 is used in a safe region.
21802 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21803 pointer type casts in unsafe context.
21805 * codegen.cs (EmitContext): Set up IsUnsafe.
21807 * cs-parser.jay (non_expression_type): Add productions for pointer
21810 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21811 code. We should not use force into static mode if the method is
21812 not virtual. Fixes bug in MIS
21814 * statement.cs (Do.Emit, While.Emit, For.Emit,
21815 Statement.EmitBoolExpression): Add support to Do and While to
21816 propagate infinite loop as `I do return' semantics.
21818 Improve the For case to also test for boolean constants.
21820 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21821 to the list of attributes we can add.
21823 Remove `EmitContext' argument.
21825 * class.cs (Method.Define): Apply parameter attributes.
21826 (Constructor.Define): Apply parameter attributes.
21827 (MethodCore.LabelParameters): Move here the core of labeling
21830 * support.cs (ReflectionParameters.ParameterModifier,
21831 InternalParameters.ParameterModifier): Use IsByRef on the type and
21832 only return the OUT bit for these parameters instead of in/out/ref
21835 This is because I miss-understood things. The ParameterInfo.IsIn
21836 and IsOut represent whether the parameter has the [In] and [Out]
21839 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21841 * ecore.cs (FieldExpr.Emit): Release temporaries.
21843 * assign.cs (LocalTemporary.Release): new function.
21845 * codegen.cs (EmitContext.GetTemporaryStorage,
21846 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21847 temporary storage. Now we can "put back" localbuilders when we
21850 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21852 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21853 need to make a copy of the variable to generate verifiable code.
21855 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21857 * driver.cs: Compute dynamically the system directory.
21859 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21860 Slower, but more generally useful. Used by the abstract
21861 registering implementation.
21863 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21864 the rules for the special rule on Type/instances. First check if
21865 we have the same name, and if so, try that special static path
21866 rather than the instance path.
21868 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21870 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21873 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21874 Enum, ValueType, Delegate or Array for non-corlib compiles.
21876 * cs-tokenizer.cs: Catch long identifiers (645)
21878 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21881 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21882 fix, we were returning too early, so we were not registering
21883 pending methods from abstract classes.
21885 Do not register pending methods if the class is abstract.
21887 * expression.cs (Conditional.DoResolve): Report circular implicit
21888 conversions when we neecd to compute it for conditional
21891 (Is.DoResolve): If the expression is always of the provided type,
21892 flag warning 183. If the expression can not ever be of the
21893 provided type flag warning 184.
21895 * class.cs: Catch 169 as well.
21897 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21900 2002-01-18 Nick Drochak <ndrochak@gol.com>
21902 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21904 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21906 * interface.cs: (PopulateMethod): Check for pointers being defined
21907 only if the unsafe context is active.
21908 (PopulateProperty): ditto.
21909 (PopulateIndexer): ditto.
21911 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21912 specified. If pointers are present, make sure that they are
21913 present in an unsafe context.
21914 (Constructor, Constructor.Define): ditto.
21915 (Field, Field.Define): ditto.
21916 (Property, Property.Define): ditto.
21917 (Event, Event.Define): ditto.
21919 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21920 hashtable if there are classes or structs defined.
21922 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21923 code, as the constant resolution moved.
21925 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21926 the metadata, so we can flag error 133.
21928 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21929 pointer is being declared in an unsafe context.
21931 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21933 * modifiers.cs (Modifiers.Check): Require a Location argument.
21934 Report error 227 for Unsafe use.
21936 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21938 * statement.cs (For.Emit): If the test is null, then report that
21939 we do `return', as we wont reach anything afterwards.
21941 (Switch.SwitchGoverningType): Track the expression that matched
21944 * driver.cs: Allow negative numbers as an error code to flag.
21946 * cs-parser.jay: Handle 1551.
21948 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21950 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21952 * cs-parser.jay: Report 1518 (type declaration can only contain
21953 class, struct, interface, enum or delegate)
21955 (switch_label): Report 1523 (keywords `case' or `default' must
21958 (opt_switch_sections): Report 1522 (empty switch)
21960 * driver.cs: Report 1515 (response file specified multiple times)
21961 Report 1516 (Source file specified multiple times).
21963 * expression.cs (Argument.Resolve): Signal 1510
21965 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21966 access not allowed in static code)
21968 2002-01-11 Ravi Pratap <ravi@ximian.com>
21970 * typemanager.cs (IsPointerType): Utility method which we are going
21973 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21974 the object type, so we take care of that.
21976 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21978 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21979 added to non-params parameters :-)
21981 * typemanager.cs (CSharpName): Include 'void' type too.
21983 (void_ptr_type): Include in the set of core types.
21985 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21988 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21991 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21992 completely forgotten about it.
21994 2002-01-10 Ravi Pratap <ravi@ximian.com>
21996 * cs-parser.jay (pointer_type): Add. This begins our implementation
21997 of parsing rules for unsafe code.
21999 (unsafe_statement): Implement.
22001 (embedded_statement): Modify to include the above.
22003 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22005 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22006 if the current context is an unsafe one.
22008 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22009 are handled differently, we need separate rules for them.
22011 (local_variable_declaration): Update to use local_variable_pointer_type
22012 to allow variable declarations of unmanaged pointer types.
22014 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22015 in unsafe contexts.
22017 * ../errors/cs0214.cs : Add.
22019 2002-01-16 Nick Drochak <ndrochak@gol.com>
22021 * makefile: remove 'response' file when cleaning.
22023 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22025 * cs-parser.jay: Report 1524.
22027 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22029 * typemanager.cs (RegisterMethod): drop checking if we have
22030 registered this from here
22032 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22034 * class.cs (Method.EmitDestructor): Implement calling our base
22037 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22038 value of InFinally.
22040 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22041 this routine and will wrap the call in a try/catch block. Deal
22044 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22046 * ecore.cs (Expression.MemberLookup): instead of taking a
22047 parameter `same_type' that was used to tell whether we could
22048 access private members we compute our containing type from the
22051 (FieldExpr): Added partial support for volatile fields. This does
22052 not work for volatile fields exposed from assemblies, as I can not
22053 figure out how to extract the modreq from it.
22055 Updated all the source files to use this.
22057 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22058 because it is referenced by MemberLookup very often.
22060 2002-01-09 Ravi Pratap <ravi@ximian.com>
22062 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22063 TypeBuilder.GetCustomAttributes to retrieve what we need.
22065 Get rid of redundant default_member_attr_type as this is the same as
22066 default_member_type which already exists.
22068 * interface.cs, attribute.cs : Update accordingly.
22070 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22072 * typemanager.cs: Enable IndexerPropertyName again. It does not
22073 work for TYpeBuilders though. Ravi, can you please fix this?
22075 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22077 * expression.cs (Argument.Emit): Handle the case of ref objects
22078 being passed to ref functions;
22080 (ParameterReference.EmitLoad): Loads the content of the pointer
22081 without dereferencing.
22083 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22085 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22087 2002-01-08 Ravi Pratap <ravi@ximian.com>
22089 * class.cs (Indexer.DefineMethod): Incorporate the interface
22090 type in the name of the method if we are doing explicit interface
22093 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22095 (BetterConversion): Fix extremely trivial bug where we were referring to
22096 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22099 * ../errors/bug16.cs : Add although we have fixed it.
22101 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22103 * expression.cs (BaseIndexer): Begin implementation.
22105 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22107 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22108 production directly to remove a shift/reduce, and implement
22109 explicit interface implementation.
22111 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22112 after a floating point suffix.
22114 * expression.cs (DoNumericPromotions): Improved the conversion for
22115 uint/uint. If we have a constant, we avoid doing a typecast to a
22118 * class.cs (Indexer): Implement explicit interface implementation
22121 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22123 * class.cs: make the default instance constructor public and hidebysig.
22125 2001-01-03 Ravi Pratap <ravi@ximian.com>
22127 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22128 so we can call it from elsewhere.
22130 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22131 we emit it internally if the class has a defined indexer; otherwise the user
22132 emits it by decorating the class definition with the DefaultMemberAttribute.
22134 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22135 attribute is not used on a type which defines an indexer.
22137 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22138 character when we skip whitespace.
22140 * ../errors/cs0646.cs : Add.
22142 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22144 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22147 * makefile: Add practical target `mcs3.exe' which builds the third
22148 generation compiler.
22150 * expression.cs (New): Fix structures constructor calling.
22152 * class.cs (Property, Method, Indexer): Emit Final flag on the
22153 method if we are an interface implementation and we are not
22156 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22157 whether this property is referencing a `base' method.
22159 * expression.cs (Invocation.EmitCall): take an extra argument:
22160 is_base, this is used to determine whether the `call' or
22161 `callvirt' opcode should be used.
22164 * delegate.cs: update EmitCall.
22166 * class.cs (Method.Define): Set NewSlot for the cases where we are
22167 not implementing an interface method.
22169 (Property.Define): ditto.
22171 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22173 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22174 'r'. Allows mcs to parse itself fully.
22176 2002-01-02 Ravi Pratap <ravi@ximian.com>
22178 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22179 of the number of initializers that require the InitializeArray method.
22181 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22182 update the above field where necessary.
22184 (MakeByteBlob): Update accordingly.
22186 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22189 (EmitDynamicInitializers): Update in accordance with the new optimization.
22191 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22192 same OpCode applies.
22194 * cs-parser.jay : Fix some glaring errors I introduced.
22196 2002-01-01 Ravi Pratap <ravi@ximian.com>
22198 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22199 so that we can check for name clashes there too.
22201 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22202 for interface indexers.
22204 * interfaces.cs (Define): Emit the default member attribute.
22206 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22207 variable was being referred to while setting the value ;-)
22209 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22211 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22212 byte-by-byte information when we know the data is zero.
22214 Make the block always a multiple of 4, because
22215 DefineInitializedData has a bug.
22217 * assign.cs: Fix, we should assign from the temporary, not from
22220 * expression.cs (MakeByteBlob): Fix my incorrect code.
22222 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22224 * typemanager.cs (EnumToUnderlying): This function is used to get
22225 the underlying type from an enumeration, because it does not
22228 * constant.cs: Use the I4_S form for values between -128 and 127.
22230 * statement.cs (Block.LookupLabel): Looks up a label.
22231 (Block): Drop support for labeled blocks.
22233 (LabeledStatement): New kind of statement that represents a label
22236 (Goto): Finally implement this bad boy.
22238 * cs-parser.jay: Update to reflect new mechanism to implement
22241 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22243 * codegen.cs (EmitContext.This): a codegen property that keeps the
22244 a single instance of this instead of creating many different this
22247 * delegate.cs (Delegate.DoResolve): Update to use the property;
22249 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22251 * expression.cs (BaseAccess.DoResolve): Ditto.
22253 2001-12-29 Ravi Pratap <ravi@ximian.com>
22255 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22256 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22258 (InitCoreTypes): Update accordingly.
22260 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22261 so we can quickly store the state.
22263 (ApplyAttributes): Set the correct implementation flags
22264 for InternalCall methods.
22266 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22268 * expression.cs (EmitCall): if a method is not virtual, then do
22269 not use callvirt on it.
22271 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22272 user defined stuff) requires the use of stobj, which takes an
22273 address on the stack instead of an array and an index. So emit
22274 the Ldelema operation for it.
22276 (EmitStoreOpcode): Use stobj for valuetypes.
22278 (UnaryMutator.EmitCode): Use the right 1 value depending on
22279 whether we are dealing with int64/uint64, float or doubles.
22281 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22282 constructors that I implemented last night.
22284 (Constructor.IsDefault): Fix to work properly for static
22287 * cs-parser.jay (CheckDef): report method signature errors.
22288 Update error number 103 to be 132.
22290 * decl.cs: New AdditionResult enumeration value: MethodExists.
22291 Although we do this check for methods later on in the semantic
22292 analysis, catching repeated default constructors is so easy that
22293 we catch these here.
22295 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22298 (ParameterReference.EmitAssign, Emit): handle
22301 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22302 (ArrayAccess.EmitStoreOpcode): ditto.
22304 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22306 * expression.cs (MakeByteBlob): Complete all the missing types
22307 (uint, short, ushort, byte, sbyte)
22309 * class.cs: Only init instance field initializers on instance
22312 Rename `constructors' to instance_constructors.
22314 (TypeContainer.AddConstructor): Only add constructors to the list
22315 if it is not static.
22317 Make sure that we handle default_static_constructor independently
22318 everywhere where we handle instance_constructors
22320 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22322 * class.cs: Do not lookup or create a base initializer for a
22323 static constructor.
22325 (ConstructorInitializer.Resolve): use the proper type to lookup
22328 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22330 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22333 * decl.cs: CloseType is now an virtual method, the default
22334 implementation just closes this type.
22336 2001-12-28 Ravi Pratap <ravi@ximian.com>
22338 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22339 to PreserveSig by default. Also emit HideBySig on such methods.
22341 Basically, set the defaults to standard values.
22343 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22344 argument, if candidate is better, it can't be worse than the best !
22346 (Invocation): Re-write bits to differentiate between methods being
22347 applicable in their expanded form and their normal form - for params
22350 Get rid of use_standard everywhere as only standard conversions are allowed
22351 in overload resolution.
22353 More spec conformance.
22355 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22357 * driver.cs: Add --timestamp, to see where the compiler spends
22360 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22361 `this' in static code.
22363 (SimpleName.DoResolve): Implement in terms of a helper function
22364 that allows static-references to be passed upstream to
22367 (Expression.ResolveWithSimpleName): Resolve specially simple
22368 names when called by MemberAccess to implement the special
22371 (Expression.ImplicitReferenceConversion): Handle conversions from
22372 Null to reference types before others, as Null's type is
22375 * expression.cs (Invocation.EmitCall): Handle the special case of
22376 calling methods declared on a reference type from a ValueType
22377 (Base classes System.Object and System.Enum)
22379 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22380 the left hand side is a TypeExpr, not on every enumeration.
22382 (Binary.Resolve): If types are reference types, then do a cast to
22383 object on operators != and == of both arguments.
22385 * typemanager.cs (FindMembers): Extract instance and static
22386 members if requested.
22388 * interface.cs (PopulateProperty): Use void_type instead of null
22389 as the return type for the setter method.
22391 (PopulateIndexer): ditto.
22393 2001-12-27 Ravi Pratap <ravi@ximian.com>
22395 * support.cs (ReflectionParameters): Fix minor bug where we
22396 were examining the wrong parameter for the ParamArray attribute.
22398 Cope with requests for the type of the parameter at position
22399 greater than the params parameter's. We now return the element
22400 type of the params array as that makes more sense.
22402 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22403 accordingly as we no longer have to extract the element type
22406 (Invocation.OverloadResolve): Update.
22408 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22410 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22411 against IEnumerator, test whether the return value is a descendant
22412 of the IEnumerator interface.
22414 * class.cs (Indexer.Define): Use an auxiliary method to implement
22415 the other bits of the method definition. Begin support for
22416 explicit interface implementation.
22418 (Property.DefineMethod): Use TypeManager.void_type instead of null
22419 for an empty return value.
22421 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22423 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22424 dealing with a FieldExpr which is composed of a FieldBuilder, in
22425 the code path we did extract the constant, but we should have
22426 obtained the underlying value to be able to cast it (otherwise we
22427 end up in an infinite loop, this is what Ravi was running into).
22429 (ArrayCreation.UpdateIndices): Arrays might be empty.
22431 (MemberAccess.ResolveMemberAccess): Add support for section
22432 14.5.4.1 that deals with the special case of E.I when E is a type
22433 and something else, that I can be a reference to a static member.
22435 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22436 handle a particular array type to create byte blobs, it is just
22437 something we dont generate byteblobs for.
22439 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22442 * location.cs (Push): remove the key from the hashtable that we
22443 are about to add. This happens for empty files.
22445 * driver.cs: Dispose files after we have parsed them.
22447 (tokenize): new function that only runs the tokenizer on its
22448 input, for speed testing.
22450 2001-12-26 Ravi Pratap <ravi@ximian.com>
22452 * class.cs (Event.Define): Define the private field only if there
22453 are no accessors defined.
22455 * expression.cs (ResolveMemberAccess): If there is no associated
22456 field with the event, that means we have an event defined with its
22457 own accessors and we should flag error cs0070 since transforming
22458 ourselves into a field is not valid in that case.
22460 * ecore.cs (SimpleName.DoResolve): Same as above.
22462 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22463 and charset to sane values.
22465 2001-12-25 Ravi Pratap <ravi@ximian.com>
22467 * assign.cs (DoResolve): Perform check on events only if they
22468 are being accessed outside the declaring type.
22470 * cs-parser.jay (event_declarations): Update rules to correctly
22471 set the type of the implicit parameter etc.
22473 (add_accessor, remove_accessor): Set current local parameters.
22475 * expression.cs (Binary): For delegate addition and subtraction,
22476 cast the return value from the method into the appropriate delegate
22479 2001-12-24 Ravi Pratap <ravi@ximian.com>
22481 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22482 of these as the workaround is unnecessary.
22484 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22485 delegate data - none of that is needed at all.
22487 Re-write bits to extract the instance expression and the delegate method
22490 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22493 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22494 of attaching attributes instead of duplicating code everywhere.
22496 * everywhere : Update code to do attribute emission using the above method.
22498 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22500 * expression.cs (IsParamsMethodApplicable): if there are not
22501 parameters, return immediately.
22503 * ecore.cs: The 0 literal can be implicity converted to an enum
22506 (SimpleName.DoResolve): First lookup the type, then lookup the
22509 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22510 want to get its address. If the InstanceExpression is not
22511 addressable, store the result in a temporary variable, then get
22514 * codegen.cs: Only display 219 errors on warning level or above.
22516 * expression.cs (ArrayAccess): Make it implement the
22517 IMemoryLocation interface.
22519 (Binary.DoResolve): handle the operator == (object a, object b)
22520 and operator != (object a, object b) without incurring into a
22521 BoxedCast (because 5 != o should never be performed).
22523 Handle binary enumerator operators.
22525 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22526 value type, otherwise use Ldelem_ref.
22528 Use precomputed names;
22530 (AddressOf): Implement address of
22532 * cs-parser.jay (labeled_statement): Fix recursive block
22533 addition by reworking the production.
22535 * expression.cs (New.DoEmit): New has a special case:
22537 If we are dealing with a ValueType, we have a few
22538 situations to deal with:
22540 * The target of New is a ValueType variable, that is
22541 easy, we just pass this as the variable reference
22543 * The target of New is being passed as an argument,
22544 to a boxing operation or a function that takes a
22547 In this case, we need to create a temporary variable
22548 that is the argument of New.
22551 2001-12-23 Ravi Pratap <ravi@ximian.com>
22553 * rootcontext.cs (LookupType): Check that current_type is not null before
22554 going about looking at nested types.
22556 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22557 not implement the IAssignMethod interface any more.
22559 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22560 where we tranform them into FieldExprs if they are being resolved from within
22561 the declaring type.
22563 * ecore.cs (SimpleName.DoResolve): Do the same here.
22565 * assign.cs (DoResolve, Emit): Clean up code considerably.
22567 * ../errors/bug10.cs : Add.
22569 * ../errors/cs0070.cs : Add.
22571 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22573 * assign.cs : Get rid of EventIsLocal everywhere.
22575 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22577 * ecore.cs (ConvertIntLiteral): finished the implementation.
22579 * statement.cs (SwitchLabel): Convert the value we are using as a
22580 key before looking up the table.
22582 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22584 * codegen.cs (EmitTopBlock): Require a Location argument now.
22586 * cs-parser.jay (constructor_declarator): We need to setup
22587 current_local_parameters before we parse the
22588 opt_constructor_initializer, to allow the variables to be bound
22589 to the constructor arguments.
22591 * rootcontext.cs (LookupType): First lookup nested classes in our
22592 class and our parents before we go looking outside our class.
22594 * expression.cs (ConstantFold): Extract/debox the values at the
22597 * rootcontext.cs (EmitCode): Resolve the constants first before we
22598 resolve the types. This is not really needed, but it helps debugging.
22600 * statement.cs: report location.
22602 * cs-parser.jay: pass location to throw statement.
22604 * driver.cs: Small bug fix.
22606 * report.cs: Updated format to be 4-zero filled digits.
22608 2001-12-22 Ravi Pratap <ravi@ximian.com>
22610 * expression.cs (CheckIndices): Fix minor bug where the wrong
22611 variable was being referred to ;-)
22613 (DoEmit): Do not call EmitStaticInitializers when the
22614 underlying type is System.Object.
22616 2001-12-21 Ravi Pratap <ravi@ximian.com>
22618 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22619 and do the usual workaround for SRE.
22621 * class.cs (MyEventBuilder.EventType): New member to get at the type
22622 of the event, quickly.
22624 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22626 * assign.cs (Assign.DoResolve): Handle the case when the target
22627 is an EventExpr and perform the necessary checks.
22629 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22632 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22634 (EventExpr): Set the type in the constructor itself since we
22635 are meant to be born fully resolved.
22637 (EventExpr.Define): Revert code I wrote earlier.
22639 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22640 instance expression is null. The instance expression is a This in that case
22641 or a null, depending on whether it is a static method or not.
22643 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22644 refers to more than one method.
22646 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22647 and accordingly flag errors.
22649 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22651 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22653 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22655 * location.cs (ToString): Provide useful rutine.
22657 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22659 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22660 objects, return the actual integral boxed.
22662 * statement.cs (SwitchLabel): define an ILLabel for each
22665 (Switch.CheckSwitch): If the value is a Literal, extract
22666 the underlying literal.
22668 Also in the unused hashtable we had, add the SwitchLabel so we can
22669 quickly look this value up.
22671 * constant.cs: Implement a bunch of new constants. Rewrite
22672 Literal based on this. Made changes everywhere to adapt to this.
22674 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22675 dereferencing array only once, and also copes with enumrations.
22677 bytes are two bytes wide, not one.
22679 (Cast): Perform constant conversions.
22681 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22682 wrappers to the literals here.
22684 * expression.cs (DoNumericPromotions): long literals can converted
22685 to ulong implicity (this is taken care of elsewhere, but I was
22686 missing this spot).
22688 * ecore.cs (Expression.Literalize): Make the return type Literal,
22689 to improve type checking.
22691 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22693 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22695 * literal.cs: Revert code from ravi that checked the bounds. The
22696 bounds are sane by the definition of the type itself.
22698 * typemanager.cs: Fix implementation of ImplementsInterface. We
22699 need to actually look up in our parent hierarchy for interfaces
22702 * const.cs: Use the underlying type for enumerations
22704 * delegate.cs: Compute the basename for the delegate creation,
22705 that should fix the delegate test case, and restore the correct
22706 Type Lookup semantics in rootcontext
22708 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22709 referencing a nested type with the Reflection API is using the "+"
22712 * cs-parser.jay: Do not require EOF token at the end.
22714 2001-12-20 Ravi Pratap <ravi@ximian.com>
22716 * rootcontext.cs (LookupType): Concatenate type names with
22717 a '.' instead of a '+' The test suite passes again.
22719 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22720 field of the enumeration.
22722 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22723 the case when the member is an EventExpr.
22725 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22726 static has an associated instance expression.
22728 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22730 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22732 * class.cs (Event.Define): Register event and perform appropriate checks
22735 We define the Add and Remove methods even if the use provides none because
22736 in that case, we provide default implementations ourselves.
22738 Define a private field of the type of the event. This is done by the CSC compiler
22739 and we should be doing it too ;-)
22741 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22742 More methods we use in code we generate.
22744 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22747 (InitCoreTypes): Update accordingly for the above.
22749 * class.cs (Event.Emit): Generate code for default accessors that we provide
22751 (EmitDefaultMethod): Do the job in the above.
22753 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22756 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22758 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22759 builders even if we were missing one.
22761 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22762 pass the Basename as our class name instead of the Name. The
22763 basename will be correctly composed for us.
22765 * parameter.cs (Paramters): Now takes a Location argument.
22767 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22768 make all the code call directly LookupType in RootContext and take
22769 this chance to pass the Location information everywhere.
22771 * Everywhere: pass Location information.
22773 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22775 * class.cs (Constructor.Define): Updated way of detecting the
22776 length of the parameters.
22778 (TypeContainer.DefineType): Use basename as the type name for
22781 (TypeContainer.Define): Do not recursively define types here, as
22782 definition is taken care in order by the RootContext.
22784 * tree.cs: Keep track of namespaces in a per-file basis.
22786 * parameter.cs (Parameter.ComputeSignature): Update to use
22789 (Parameters.GetSignature): ditto.
22791 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22792 instead of a TypeContainer.
22794 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22795 resolve names. Because we need to be resolve in our context, not
22798 * driver.cs: Implement response files.
22800 * class.cs (TypeContainer.DefineType): If we are defined, do not
22801 redefine ourselves.
22803 (Event.Emit): Emit the code for add/remove handlers.
22804 (Event.Define): Save the MethodBuilders for add/remove.
22806 * typemanager.cs: Use pair here too.
22808 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22809 DictionaryEntry requires the first argument to be non-null.
22811 (enum_declaration): Compute full name for registering the
22814 (delegate_declaration): Instead of using
22815 formal_parameter_list, use opt_formal_parameter_list as the list
22818 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22819 (EventParsing): New property that controls whether `add' and
22820 `remove' are returned as tokens or identifiers (for events);
22822 2001-12-19 Ravi Pratap <ravi@ximian.com>
22824 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22825 use MyEventBuilder only and let it wrap the real builder for us.
22827 (MyEventBuilder): Revamp constructor etc.
22829 Implement all operations that we perform on EventBuilder in precisely the same
22832 (FindMembers): Update to use the EventBuilder member.
22834 (Event.Emit): Update accordingly.
22836 2001-12-18 Ravi Pratap <ravi@ximian.com>
22838 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22839 by calling the appropriate methods.
22841 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22844 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22846 2001-12-17 Ravi Pratap <ravi@ximian.com>
22848 * delegate.cs (Delegate.Populate): Check that the return type
22849 and various parameters types are indeed accessible.
22851 * class.cs (Constructor.Define): Same here.
22853 (Field.Define): Ditto.
22855 (Event.Define): Ditto.
22857 (Operator.Define): Check that the underlying Method defined itself
22858 correctly - so it's MethodBuilder should not be null.
22860 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22861 expression happens to be null.
22863 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22864 members but as of now we don't seem to be able to do anything really useful with it.
22866 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22867 not the EventBuilder.
22869 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22871 * cs-tokenizer.cs: Add support for defines.
22872 Add support for #if, #elif, #else, #endif
22874 (eval_var): evaluates a variable.
22875 (eval): stubbed for evaluating functions.
22877 * cs-parser.jay: Pass the defines information
22879 * driver.cs: Add --define command line option.
22881 * decl.cs: Move MemberCore here.
22883 Make it the base class for DeclSpace. This allows us to catch and
22884 report 108 and 109 for everything now.
22886 * class.cs (TypeContainer.Define): Extract all the members
22887 before populating and emit the warning 108 (new keyword required
22888 to override) instead of having each member implement this.
22890 (MemberCore.Define): New abstract method, we will be using this in
22891 the warning reporting engine in Populate.
22893 (Operator.Define): Adjust to new MemberCore protocol.
22895 * const.cs (Const): This does not derive from Expression, it is a
22896 temporary object we use to create fields, it is a MemberCore.
22898 * class.cs (Method.Define): Allow the entry point to be in a
22901 * driver.cs: Rewrite the argument handler to clean it up a bit.
22903 * rootcontext.cs: Made it just an auxiliary namespace feature by
22904 making everything static.
22906 * driver.cs: Adapt code to use RootContext type name instead of
22909 * delegate.cs: Remove RootContext argument.
22911 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22914 * class.cs (Event.Define): The lookup can fail.
22916 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22918 * expression.cs: Resolve the this instance before invoking the code.
22920 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22922 * cs-parser.jay: Add a production in element_access that allows
22923 the thing to become a "type" reference. This way we can parse
22924 things like "(string [])" as a type.
22926 Note that this still does not handle the more complex rules of
22930 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22932 * ecore.cs: (CopyNewMethods): new utility function used to
22933 assemble the list of methods from running FindMembers.
22935 (MemberLookup): Rework FindMembers so that
22937 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22939 * class.cs (TypeContainer): Remove Delegates who fail to be
22942 * delegate.cs (Populate): Verify that we dont get null return
22943 values. TODO: Check for AsAccessible.
22945 * cs-parser.jay: Use basename to emit error 574 (destructor should
22946 have the same name as container class), not the full name.
22948 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22949 possible representation.
22951 Also implements integer type suffixes U and L.
22953 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22955 * expression.cs (ArrayCreation.DoResolve): We need to do the
22956 argument resolution *always*.
22958 * decl.cs: Make this hold the namespace. Hold the root context as
22960 (LookupType): Move here.
22962 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22964 * location.cs (Row, Name): Fixed the code, it was always returning
22965 references to the first file.
22967 * interface.cs: Register properties defined through interfaces.
22969 * driver.cs: Add support for globbing on the command line
22971 * class.cs (Field): Make it derive from MemberCore as well.
22974 2001-12-15 Ravi Pratap <ravi@ximian.com>
22976 * class.cs (Event::Define): Check that the type of the event is a delegate
22977 type else flag error #66.
22979 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22982 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22983 values of EntryPoint, CharSet etc etc.
22985 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22987 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22988 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22989 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22990 which needs this to do its work.
22992 * ../errors/cs0066.cs : Add.
22994 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22996 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22999 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23000 clears out the parameters field.
23001 (MemberSignatureCompare): Cleanup
23003 (MemberCore): New base class used to share code between MethodCore
23006 (RegisterRequiredImplementations) BindingFlags.Public requires
23007 either BindingFlags.Instace or Static. Use instance here.
23009 (Property): Refactored code to cope better with the full spec.
23011 * parameter.cs (GetParameterInfo): Return an empty array instead
23014 * class.cs (Property): Abstract or extern properties have no bodies.
23016 * parameter.cs (GetParameterInfo): return a zero-sized array.
23018 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23019 method modifier validation to the typecontainer so we can reuse
23020 this on properties.
23022 (MethodCore.ParameterTypes): return an empty sized array of types.
23024 (Property.Define): Test property modifier validity.
23026 Add tests for sealed/override too.
23028 (Method.Emit): abstract or extern methods have no bodies.
23030 2001-12-14 Ravi Pratap <ravi@ximian.com>
23032 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23035 (Method::Define, ::Emit): Modify accordingly.
23037 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23039 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23041 * makefile: Pass in /unsafe.
23043 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23045 * class.cs (MakeKey): Kill routine.
23047 * class.cs (TypeContainer.Define): Correctly define explicit
23048 method implementations (they require the full interface name plus
23051 * typemanager.cs: Deply the PtrHashtable here and stop using the
23052 lame keys. Things work so much better.
23054 This of course broke everyone who depended on `RegisterMethod' to
23055 do the `test for existance' test. This has to be done elsewhere.
23057 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23058 the object stupid Equals method (because, that like fails all over
23059 the place). We still do not use it.
23061 * class.cs (TypeContainer.SetRequiredInterface,
23062 TypeContainer.RequireMethods): Killed these two routines and moved
23063 all the functionality to RegisterRequiredImplementations.
23065 (TypeContainer.RegisterRequiredImplementations): This routine now
23066 registers all the implementations required in an array for the
23067 interfaces and abstract methods. We use an array of structures
23068 which can be computed ahead of time to reduce memory usage and we
23069 also assume that lookups are cheap as most classes will not
23070 implement too many interfaces.
23072 We also avoid creating too many MethodSignatures.
23074 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23075 clear the "pending" bit if we find that there are problems with
23078 (TypeContainer.VerifyPendingMethods): Update to report errors of
23079 methods that look like implementations but are not.
23081 (TypeContainer.Define): Add support for explicit interface method
23084 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23086 * typemanager.cs: Keep track of the parameters here instead of
23087 being a feature of the TypeContainer.
23089 * class.cs: Drop the registration of parameters here, as
23090 InterfaceMethods are also interface declarations.
23092 * delegate.cs: Register methods with the TypeManager not only with
23093 the TypeContainer. This code was buggy.
23095 * interface.cs: Full registation here.
23097 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23099 * expression.cs: Remove reducer for binary expressions, it can not
23102 * const.cs: Put here the code that used to go into constant.cs
23104 * constant.cs: Put here the code for constants, this is a new base
23105 class for Literals.
23107 * literal.cs: Make Literal derive from Constant.
23109 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23111 * statement.cs (Return.Emit): Report error 157 if the user
23112 attempts to return from a finally block.
23114 (Return.Emit): Instead of emitting a return, jump to the end of
23117 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23118 LocalBuilder to store the result of the function. ReturnLabel is
23119 the target where we jump.
23122 2001-12-09 Radek Doulik <rodo@ximian.com>
23124 * cs-parser.jay: remember alias in current namespace
23126 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23129 * class.cs (LookupAlias): lookup alias in my_namespace
23131 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23133 (LookupAlias): lookup alias in this and if needed in parent
23136 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23140 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23141 making things static. I need this to avoid passing the
23142 TypeContainer when calling ParameterType.
23144 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23145 that did string manipulation to compute the type and then call
23146 GetType. Use Parameter.ParameterType instead.
23148 * cs-tokenizer.cs: Consume the suffix for floating values.
23150 * expression.cs (ParameterReference): figure out whether this is a
23151 reference parameter or not. Kill an extra variable by computing
23152 the arg_idx during emission.
23154 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23155 function that returns whether a parameter is an out/ref value or not.
23157 (Parameter.ParameterType): The type of the parameter (base,
23158 without ref/out applied).
23160 (Parameter.Resolve): Perform resolution here.
23161 (Parameter.ExternalType): The full type (with ref/out applied).
23163 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23164 support for expressions on the using statement.
23166 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23168 * statement.cs (Using.EmitLocalVariableDecls): Split the
23169 localvariable handling of the using statement.
23171 (Block.EmitMeta): Keep track of variable count across blocks. We
23172 were reusing slots on separate branches of blocks.
23174 (Try.Emit): Emit the general code block, we were not emitting it.
23176 Check the type of the declaration to be an IDisposable or
23177 something that can be implicity converted to it.
23179 Emit conversions if required.
23181 * ecore.cs (EmptyExpression): New utility class.
23182 (Expression.ImplicitConversionExists): New utility function.
23184 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23186 * statement.cs (Using): Implement.
23188 * expression.cs (LocalVariableReference): Support read only variables.
23190 * statement.cs: Remove the explicit emit for the Leave opcode.
23191 (VariableInfo): Add a readonly field.
23193 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23195 * ecore.cs (ConvCast): new class used to encapsulate the various
23196 explicit integer conversions that works in both checked and
23197 unchecked contexts.
23199 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23200 properly generate the overflow opcodes.
23202 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23204 * statement.cs: The correct type for the EmptyExpression is the
23205 element_type, not the variable type. Ravi pointed this out.
23207 2001-12-04 Ravi Pratap <ravi@ximian.com>
23209 * class.cs (Method::Define): Handle PInvoke methods specially
23210 by using DefinePInvokeMethod instead of the usual one.
23212 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23213 above to do the task of extracting information and defining the method.
23215 2001-12-04 Ravi Pratap <ravi@ximian.com>
23217 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23218 of the condition for string type.
23220 (Emit): Move that here.
23222 (ArrayCreation::CheckIndices): Keep string literals in their expression
23225 (EmitDynamicInitializers): Handle strings appropriately.
23227 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23229 * codegen.cs (EmitContext): Replace multiple variables with a
23230 single pointer to the current Switch statement.
23232 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23235 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23239 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23242 (Foreach.Emit): Foreach on arrays was not setting
23243 up the loop variables (for break/continue).
23245 (GotoCase): Semi-implented.
23247 2001-12-03 Ravi Pratap <ravi@ximian.com>
23249 * attribute.cs (CheckAttribute): Handle system attributes by using
23250 Attribute.GetAttributes to examine information we need.
23252 (GetValidPlaces): Same here.
23254 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23256 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23258 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23260 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23262 (Method::Emit): Handle the case when we are a PInvoke method.
23264 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23266 * expression.cs: Use ResolveWithSimpleName on compound names.
23268 2001-12-02 Ravi Pratap <ravi@ximian.com>
23270 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23271 before trying to reduce it.
23273 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23275 * constant.cs (LookupConstantValue): Implement.
23277 (EmitConstant): Use the above in emitting the constant.
23279 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23280 that are user-defined by doing a LookupConstantValue on them.
23282 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23285 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23287 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23289 (BaseAccess.DoResolve): Implement.
23291 (MemberAccess.DoResolve): Split this routine into a
23292 ResolveMemberAccess routine that can be used independently
23294 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23296 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23297 As that share bits of the implementation. Is returns a boolean,
23298 while As returns the Type that is being probed.
23300 2001-12-01 Ravi Pratap <ravi@ximian.com>
23302 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23303 instead of a Literal - much easier.
23305 (EnumInTransit): Remove - utterly useless :-)
23307 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23309 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23311 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23312 chain when we have no associated expression.
23314 2001-11-30 Ravi Pratap <ravi@ximian.com>
23316 * constant.cs (Define): Use Location while reporting the errror.
23318 Also emit a warning when 'new' is used and there is no inherited
23321 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23324 (LookupEnumValue): Implement to lookup an enum member's value and define it
23327 (Populate): Re-write accordingly to use the above routine.
23329 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23331 * expression.cs (This): Fix prototype for DoResolveLValue to
23332 override the base class DoResolveLValue.
23334 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23337 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23338 (we need to load the address of the field here). This fixes
23341 (FieldExpr.DoResolveLValue): Call the DoResolve
23342 function to initialize the Instance expression.
23344 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23345 correctly the GetEnumerator operation on a value type.
23347 * cs-parser.jay: Add more simple parsing error catches.
23349 * statement.cs (Switch): Add support for string switches.
23350 Handle null specially.
23352 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23354 2001-11-28 Ravi Pratap <ravi@ximian.com>
23356 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23358 (declare_local_constant): New helper function.
23360 * statement.cs (AddConstant): Keep a separate record of constants
23362 (IsConstant): Implement to determine if a variable is a constant.
23364 (GetConstantExpression): Implement.
23366 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23368 * statement.cs (IsVariableDefined): Re-write.
23370 2001-11-27 Ravi Pratap <ravi@ximian.com>
23372 * class.cs (TypeContainer::FindMembers): Look for constants
23373 in the case when we are looking for MemberTypes.Field
23375 * expression.cs (MemberAccess::DoResolve): Check that in the
23376 case we are a FieldExpr and a Literal, we are not being accessed
23377 by an instance reference.
23379 * cs-parser.jay (local_constant_declaration): Implement.
23381 (declaration_statement): Implement for constant declarations.
23383 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23385 * statement.cs (Switch): Catch double defaults.
23387 (Switch): More work on the switch() statement
23388 implementation. It works for integral values now, need to finish
23392 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23394 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23395 integer literals into other integer literals. To be used by
23398 2001-11-24 Ravi Pratap <ravi@ximian.com>
23400 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23403 (EmitDynamicInitializers): Cope with the above since we extract data
23404 directly from ArrayData now.
23406 (ExpectInitializers): Keep track of whether initializers are mandatory
23409 (Bounds): Make it a hashtable to prevent the same dimension being
23410 recorded for every element in that dimension.
23412 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23415 Also fix bug which was causing the indices to be emitted in the reverse
23418 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23420 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23421 unfinished. They do not work, because the underlying code is
23424 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23426 * cs-parser.jay: Remove bogus fixme.
23428 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23429 on Switch statement.
23431 2001-11-23 Ravi Pratap <ravi@ximian.com>
23433 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23436 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23437 parameter. Apparently, any expression is allowed.
23439 (ValidateInitializers): Update accordingly.
23441 (CheckIndices): Fix some tricky bugs thanks to recursion.
23443 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23444 I was being completely brain-dead.
23446 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23447 and re-write acordingly.
23449 (DelegateInvocation): Re-write accordingly.
23451 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23453 (MakeByteBlob): Handle types more correctly.
23455 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23456 initialization from expressions but it is incomplete because I am a complete
23459 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23461 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23462 on If. Basically, we have to return `true' (ie, we do return to
23463 our caller) only if both branches of the if return.
23465 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23466 short-circuit operators, handle them as short circuit operators.
23468 (Cast.DoResolve): Resolve type.
23469 (Cast.Cast): Take an expression as the target type.
23471 * cs-parser.jay (cast_expression): Remove old hack that only
23472 allowed a limited set of types to be handled. Now we take a
23473 unary_expression and we resolve to a type during semantic
23476 Use the grammar productions from Rhys to handle casts (this is
23477 not complete like Rhys syntax yet, we fail to handle that corner
23478 case that C# has regarding (-x), but we will get there.
23480 2001-11-22 Ravi Pratap <ravi@ximian.com>
23482 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23483 field which is an array type.
23485 * cs-parser.jay (declare_local_variables): Support array initialization too.
23487 * typemanager.cs (MakeKey): Implement.
23489 (everywhere): Use the above appropriately.
23491 * cs-parser.jay (for_statement): Update for array initialization while
23492 declaring variables.
23494 * ecore.cs : The error message was correct, it's the variable's names that
23495 were misleading ;-) Make the code more readable.
23497 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23498 the correct type etc.
23500 (ConvertExplicit): Handle Enum types by examining the underlying type.
23502 2001-11-21 Ravi Pratap <ravi@ximian.com>
23504 * parameter.cs (GetCallingConvention): Always return
23505 CallingConventions.Standard for now.
23507 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23509 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23510 and `r' after calling DoNumericPromotions.
23512 * ecore.cs: Fix error message (the types were in the wrong order).
23514 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23515 BindingFlags.Instance as well
23517 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23518 implicit int literal conversion in an empty cast so that we
23519 propagate the right type upstream.
23521 (UnboxCast): new class used to unbox value types.
23522 (Expression.ConvertExplicit): Add explicit type conversions done
23525 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23526 the target type before applying the implicit LongLiterals to ULong
23529 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23531 * cs-parser.jay (for_statement): Reworked the way For works: now
23532 we declare manually any variables that are introduced in
23533 for_initializer to solve the problem of having out-of-band code
23534 emition (that is what got for broken).
23536 (declaration_statement): Perform the actual variable declaration
23537 that used to be done in local_variable_declaration here.
23539 (local_variable_declaration): Do not declare anything, just pass
23540 the information on a DictionaryEntry
23542 2001-11-20 Ravi Pratap <ravi@ximian.com>
23544 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23545 re-write of the logic to now make it recursive.
23547 (UpdateIndices): Re-write accordingly.
23549 Store element data in a separate ArrayData list in the above methods.
23551 (MakeByteBlob): Implement to dump the array data into a byte array.
23553 2001-11-19 Ravi Pratap <ravi@ximian.com>
23555 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23558 * constant.cs (Define): Implement.
23560 (EmitConstant): Re-write fully.
23562 Pass in location info.
23564 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23567 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23568 DictionaryEntry since we need location info too.
23570 (constant_declaration): Update accordingly.
23572 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23573 code into another method : UpdateIndices.
23575 2001-11-18 Ravi Pratap <ravi@ximian.com>
23577 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23578 some type checking etc.
23580 2001-11-17 Ravi Pratap <ravi@ximian.com>
23582 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23583 bits to provide dimension info if the user skips doing that.
23585 Update second constructor to store the rank correctly.
23587 2001-11-16 Ravi Pratap <ravi@ximian.com>
23589 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23590 and try to implement.
23592 * ../errors/cs0150.cs : Add.
23594 * ../errors/cs0178.cs : Add.
23596 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23598 * statement.cs: Implement foreach on multi-dimensional arrays.
23600 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23601 name of the params argument.
23603 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23604 initializing the array.
23606 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23607 we can use this elsewhere.
23609 * statement.cs: Finish implementation of foreach for single
23612 * cs-parser.jay: Use an out-of-band stack to pass information
23613 around, I wonder why I need this.
23615 foreach_block: Make the new foreach_block the current_block.
23617 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23618 function used to return a static Parameters structure. Used for
23619 empty parameters, as those are created very frequently.
23621 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23623 2001-11-15 Ravi Pratap <ravi@ximian.com>
23625 * interface.cs : Default modifier is private, not public. The
23626 make verify test passes again.
23628 2001-11-15 Ravi Pratap <ravi@ximian.com>
23630 * support.cs (ReflectionParameters): Fix logic to determine
23631 whether the last parameter is a params one. Test 9 passes again.
23633 * delegate.cs (Populate): Register the builders we define with
23634 RegisterParameterForBuilder. Test 19 passes again.
23636 * cs-parser.jay (property_declaration): Reference $6 instead
23637 of $$ to get at the location.
23639 (indexer_declaration): Similar stuff.
23641 (attribute): Ditto.
23643 * class.cs (Property): Register parameters for the Get and Set methods
23644 if they exist. Test 23 passes again.
23646 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23647 call to EmitArguments as we are sure there aren't any params arguments.
23648 Test 32 passes again.
23650 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23651 IndexOutOfRangeException.
23653 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23654 Test 33 now passes again.
23656 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23658 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23659 broke a bunch of things. Will have to come up with a better way
23660 of tracking locations.
23662 * statement.cs: Implemented foreach for single dimension arrays.
23664 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23666 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23667 an error. This removes the lookup from the critical path.
23669 * cs-parser.jay: Removed use of temporary_loc, which is completely
23672 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23674 * support.cs (ReflectionParameters.ParameterModifier): Report
23675 whether the argument is a PARAMS argument or not.
23677 * class.cs: Set the attribute `ParamArrayAttribute' on the
23678 parameter argument.
23680 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23681 and cons_param_array_attribute (ConstructorInfo for
23682 ParamArrayAttribute).,
23684 * codegen.cs: Emit the return using the `Return' statement, that
23685 way we can report the error correctly for missing return values.
23687 * class.cs (Method.Emit): Clean up.
23689 * expression.cs (Argument.Resolve): Take another argument: the
23690 location where this argument is used. Notice that this is not
23691 part of the "Argument" class as to reduce the size of the
23692 structure (we know the approximate location anyways).
23694 Test if the argument is a variable-reference, if not, then
23695 complain with a 206.
23697 (Argument.Emit): Emit addresses of variables.
23699 (Argument.FullDesc): Simplify.
23701 (Invocation.DoResolve): Update for Argument.Resolve.
23703 (ElementAccess.DoResolve): ditto.
23705 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23706 method should be virtual, as this method is always virtual.
23708 (NewDelegate.DoResolve): Update for Argument.Resolve.
23710 * class.cs (ConstructorInitializer.DoResolve): ditto.
23712 * attribute.cs (Attribute.Resolve): ditto.
23714 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23716 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23718 * expression.cs (ParameterReference): Drop IStackStorage and implement
23719 IAssignMethod instead.
23721 (LocalVariableReference): ditto.
23723 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23724 IAssignMethod instead.
23726 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23728 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23729 enumerations that are used in heavily used structures derive from
23730 byte in a laughable and pathetic attempt to reduce memory usage.
23731 This is the kind of pre-optimzations that you should not do at
23732 home without adult supervision.
23734 * expression.cs (UnaryMutator): New class, used to handle ++ and
23735 -- separatedly from the other unary operators. Cleans up the
23736 code, and kills the ExpressionStatement dependency in Unary.
23738 (Unary): Removed `method' and `Arguments' from this class, making
23739 it smaller, and moving it all to SimpleCall, so I can reuse this
23740 code in other locations and avoid creating a lot of transient data
23741 strucutres when not required.
23743 * cs-parser.jay: Adjust for new changes.
23745 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23747 * enum.cs (Enum.Populate): If there is a failure during
23750 * cs-parser.jay (opt_enum_base): we used to catch type errors
23751 here, but this is really incorrect. The type error should be
23752 catched during semantic analysis.
23754 2001-12-11 Ravi Pratap <ravi@ximian.com>
23756 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23757 current_local_parameters as expected since I, in my stupidity, had forgotten
23760 * attribute.cs (GetValidPlaces): Fix stupid bug.
23762 * class.cs (Method::Emit): Perform check on applicability of attributes.
23764 (Constructor::Emit): Ditto.
23766 (Field::Emit): Ditto.
23768 (Field.Location): Store location information.
23770 (Property, Event, Indexer, Operator): Ditto.
23772 * cs-parser.jay (field_declaration): Pass in location for each field.
23774 * ../errors/cs0592.cs : Add.
23776 2001-11-12 Ravi Pratap <ravi@ximian.com>
23778 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23780 (InitCoreTypes): Update accordingly.
23782 (RegisterAttrType, LookupAttr): Implement.
23784 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23785 info about the same.
23787 (Resolve): Update to populate the above as necessary.
23789 (Error592): Helper.
23791 (GetValidPlaces): Helper to the above.
23793 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23795 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23797 2001-11-12 Ravi Pratap <ravi@ximian.com>
23799 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23801 * ../errors/cs0617.cs : Add.
23803 2001-11-11 Ravi Pratap <ravi@ximian.com>
23805 * enum.cs (Emit): Rename to Populate to be more consistent with what
23806 we expect it to do and when exactly it is called.
23808 * class.cs, rootcontext.cs : Update accordingly.
23810 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23811 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23813 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23815 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23816 of a fieldinfo using the above, when dealing with a FieldBuilder.
23818 2001-11-10 Ravi Pratap <ravi@ximian.com>
23820 * ../errors/cs0031.cs : Add.
23822 * ../errors/cs1008.cs : Add.
23824 * ../errrors/cs0543.cs : Add.
23826 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23829 (FindMembers): Implement.
23831 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23832 enums and delegates too.
23834 (enum_types): Rename to builder_to_enum.
23836 (delegate_types): Rename to builder_to_delegate.
23838 * delegate.cs (FindMembers): Implement.
23840 2001-11-09 Ravi Pratap <ravi@ximian.com>
23842 * typemanager.cs (IsEnumType): Implement.
23844 * enum.cs (Emit): Re-write parts to account for the underlying type
23845 better and perform checking etc.
23847 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23848 of the underlying type.
23850 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23853 * enum.cs (error31): Helper to report error #31.
23855 * cs-parser.jay (enum_declaration): Store location of each member too.
23857 * enum.cs (member_to_location): New hashtable.
23859 (AddEnumMember): Update location hashtable.
23861 (Emit): Use the location of each member while reporting errors.
23863 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23865 * cs-parser.jay: A for_initializer if is a
23866 local_variable_declaration really ammount to have an implicit
23867 block with the variable declaration and no initializer for for.
23869 * statement.cs (For.Emit): Cope with null initializers.
23871 This fixes the infinite loop on for initializers.
23873 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23875 * enum.cs: More cleanup.
23877 * ecore.cs: Remove dead code.
23879 * class.cs (Property.Emit): More simplification.
23880 (Event.Emit): ditto.
23882 Reworked to have less levels of indentation.
23884 2001-11-08 Ravi Pratap <ravi@ximian.com>
23886 * class.cs (Property): Emit attributes.
23896 * enum.cs (Emit): Ditto.
23898 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23901 * class.cs (Field, Event, etc.): Move attribute generation into the
23902 Emit method everywhere.
23904 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23905 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23906 as we had no way of defining nested enums !
23908 * rootcontext.cs : Adjust code accordingly.
23910 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23912 2001-11-07 Ravi Pratap <ravi@ximian.com>
23914 * expression.cs (EvalConstantExpression): Move into ecore.cs
23916 * enum.cs (Enum): Rename some members and make them public and readonly
23917 according to our convention.
23919 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23922 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23924 (Enum::Emit): Write a simple version for now which doesn't try to compute
23925 expressions. I shall modify this to be more robust in just a while.
23927 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23929 (TypeContainer::CloseType): Create the Enum types too.
23931 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23933 * expression.cs (EvalConstantExpression): Get rid of completely.
23935 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23936 user-defined values and other cases.
23938 (IsValidEnumLiteral): Helper function.
23940 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23941 out there in the case we had a literal FieldExpr.
23943 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23945 (Literalize): Revamp a bit to take two arguments.
23947 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23949 2001-11-06 Ravi Pratap <ravi@ximian.com>
23951 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23953 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23955 (Resolve): Use the above to ensure we have proper initializers.
23957 2001-11-05 Ravi Pratap <ravi@ximian.com>
23959 * expression.cs (Expression::EvalConstantExpression): New method to
23960 evaluate constant expressions.
23962 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23964 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23966 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23969 (Binary.ResolveOperator): Handle operator != (object a, object b)
23970 and operator == (object a, object b);
23972 (Binary.DoNumericPromotions): Indicate whether the numeric
23973 promotion was possible.
23975 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23978 Made the ArrayAccess implement interface IAssignMethod instead of
23979 IStackStore as the order in which arguments are passed reflects
23982 * assign.cs: Instead of using expr.ExprClass to select the way of
23983 assinging, probe for the IStackStore/IAssignMethod interfaces.
23985 * typemanager.cs: Load InitializeArray definition.
23987 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23988 static data that can be used to initialize arrays.
23990 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23992 * expression.cs: Handle operator== and operator!= for booleans.
23994 (Conditioal.Reduce): Implement reducer for the ?: operator.
23996 (Conditional.Resolve): Implement dead code elimination.
23998 (Binary.Resolve): Catch string literals and return a new
23999 concatenated string.
24001 (Unary.Reduce): Implement reduction of unary expressions.
24003 * ecore.cs: Split out the expression core handling here.
24005 (Expression.Reduce): New method used to perform constant folding
24006 and CSE. This is needed to support constant-expressions.
24008 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24009 targets, and optimize for !x.
24011 2001-11-04 Ravi Pratap <ravi@ximian.com>
24013 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24014 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24015 set custom atttributes.
24017 * literal.cs (Literal::GetValue): New abstract method to return the actual
24018 value of the literal, cast as an object.
24020 (*Literal): Implement GetValue method.
24022 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24023 expressions to the arraylist but objects of type Argument.
24025 * class.cs (TypeContainer::Emit): Emit our attributes too.
24027 (Method::Emit, Constructor::Emit): Ditto.
24029 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24030 to be ignoring earlier.
24032 2001-11-03 Ravi Pratap <ravi@ximian.com>
24034 * attribute.cs (AttributeSection::Define): Implement to do the business
24035 of constructing a CustomAttributeBuilder.
24037 (Attribute): New trivial class. Increases readability of code.
24039 * cs-parser.jay : Update accordingly.
24041 (positional_argument_list, named_argument_list, named_argument): New rules
24043 (attribute_arguments): Use the above so that we are more correct.
24045 2001-11-02 Ravi Pratap <ravi@ximian.com>
24047 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24048 to perform all checks for a method with a params parameter.
24050 (Invocation::OverloadResolve): Update to use the above method and therefore
24051 cope correctly with params method invocations.
24053 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24056 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24057 constructors in our parent too because we can't afford to miss out on
24060 * attribute.cs (AttributeSection): New name for the class Attribute
24062 Other trivial changes to improve readability.
24064 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24065 use the new class names.
24067 2001-11-01 Ravi Pratap <ravi@ximian.com>
24069 * class.cs (Method::Define): Complete definition for params types too
24071 (Indexer::Define): Ditto.
24073 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24074 Cope everywhere with a request for info about the array parameter.
24076 2001-11-01 Ravi Pratap <ravi@ximian.com>
24078 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24080 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24081 local_variable_type to extract the string corresponding to the type.
24083 (local_variable_type): Fixup the action to use the new helper method.
24085 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24088 * expression.cs : Clean out code which uses the above.
24090 2001-10-31 Ravi Pratap <ravi@ximian.com>
24092 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24093 and bale out if necessary by returning a false.
24095 (RegisterProperty): Ditto.
24097 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24098 and print out appropriate error messages.
24100 * interface.cs (everywhere): Ditto.
24102 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24103 location to constructor.
24105 * class.cs (Property, Event, Indexer): Update accordingly.
24107 * ../errors/cs111.cs : Added.
24109 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24110 of a method, as laid down by the spec.
24112 (Invocation::OverloadResolve): Use the above method.
24114 2001-10-31 Ravi Pratap <ravi@ximian.com>
24116 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24117 now take a TypeContainer and a Parameters object.
24119 (ParameterData): Modify return type of ParameterModifier method to be
24120 Parameter.Modifier and not a string.
24122 (ReflectionParameters, InternalParameters): Update accordingly.
24124 * expression.cs (Argument::GetParameterModifier): Same here.
24126 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24127 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24128 symbol in it at all so maybe this is only for now.
24130 2001-10-30 Ravi Pratap <ravi@ximian.com>
24132 * support.cs (InternalParameters): Constructor now takes an extra argument
24133 which is the actual Parameters class.
24135 (ParameterDesc): Update to provide info on ref/out modifiers.
24137 * class.cs (everywhere): Update call to InternalParameters to pass in
24138 the second argument too.
24140 * support.cs (ParameterData): Add ParameterModifier, which is a method
24141 to return the modifier info [ref/out etc]
24143 (InternalParameters, ReflectionParameters): Implement the above.
24145 * expression.cs (Argument::ParameterModifier): Similar function to return
24146 info about the argument's modifiers.
24148 (Invocation::OverloadResolve): Update to take into account matching modifiers
24151 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24152 a new SetFormalParameters object which we pass to InternalParameters.
24154 2001-10-30 Ravi Pratap <ravi@ximian.com>
24156 * expression.cs (NewArray): Merge into the ArrayCreation class.
24158 2001-10-29 Ravi Pratap <ravi@ximian.com>
24160 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24161 NewUserdefinedArray into one as there wasn't much of a use in having
24164 * expression.cs (Argument): Change field's name to ArgType from Type.
24166 (Type): New readonly property which returns the proper type, taking into
24167 account ref/out modifiers.
24169 (everywhere): Adjust code accordingly for the above.
24171 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24172 whether we are emitting for a ref or out parameter.
24174 * expression.cs (Argument::Emit): Use the above field to set the state.
24176 (LocalVariableReference::Emit): Update to honour the flag and emit the
24179 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24181 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24183 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24185 (ReflectionParameters, InternalParameters): Implement the above method.
24187 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24190 (Invocation::FullMethodDesc): Ditto.
24192 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24194 * cs-parser.jay: Add extra production for the second form of array
24197 * expression.cs (ArrayCreation): Update to reflect the above
24200 * Small changes to prepare for Array initialization.
24202 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24204 * typemanager.cs (ImplementsInterface): interface might be null;
24205 Deal with this problem;
24207 Also, we do store negative hits on the cache (null values), so use
24208 this instead of calling t.GetInterfaces on the type everytime.
24210 2001-10-28 Ravi Pratap <ravi@ximian.com>
24212 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24214 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24215 split functionality out into different classes.
24217 (New::FormArrayType): Move into NewBuiltinArray.
24219 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24222 (NewBuiltinArray): New class to handle creation of built-in arrays.
24224 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24225 account creation of one-dimensional arrays.
24227 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24229 (NewUserdefinedArray::DoResolve): Implement.
24231 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24233 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24234 we maintain inside the TypeManager. This is necessary to perform lookups on the
24237 (LookupType): Update to perform GetType on the module builders too.
24239 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24241 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24243 2001-10-23 Ravi Pratap <ravi@ximian.com>
24245 * expression.cs (New::DoResolve): Implement guts of array creation.
24247 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24249 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24251 * expression.cs: Fix bug I introduced lsat night that broke
24254 (Expression.Resolve): Report a 246 error (can not resolve name)
24255 if we find a SimpleName in the stream.
24257 (Expression.ResolveLValue): Ditto.
24259 (Expression.ResolveWithSimpleName): This function is a variant of
24260 ResolveName, this one allows SimpleNames to be returned without a
24261 warning. The only consumer of SimpleNames is MemberAccess
24263 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24265 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24266 might arrive here. I have my doubts that this is correct.
24268 * statement.cs (Lock): Implement lock statement.
24270 * cs-parser.jay: Small fixes to support `lock' and `using'
24272 * cs-tokenizer.cs: Remove extra space
24274 * driver.cs: New flag --checked, allows to turn on integer math
24277 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24278 Threading.Monitor.Exit
24280 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24282 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24283 Expression Class to be IndexerAccess.
24285 Notice that Indexer::DoResolve sets the eclass to Value.
24287 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24289 * class.cs (TypeContainer::Emit): Emit code for indexers.
24291 * assign.cs (IAssignMethod): New interface implemented by Indexers
24292 and Properties for handling assignment.
24294 (Assign::Emit): Simplify and reuse code.
24296 * expression.cs (IndexerAccess, PropertyExpr): Implement
24297 IAssignMethod, clean up old code.
24299 2001-10-22 Ravi Pratap <ravi@ximian.com>
24301 * typemanager.cs (ImplementsInterface): New method to determine if a type
24302 implements a given interface. Provides a nice cache too.
24304 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24307 (ConvertReferenceExplicit): Ditto.
24309 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24310 various methods, with correct names etc.
24312 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24313 Operator.UnaryNegation.
24315 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24316 we have a unary plus or minus operator.
24318 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24321 * everywhere : update accordingly.
24323 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24326 * class.cs (Method::Define): For the case where we are implementing a method
24327 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24328 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24330 2001-10-21 Ravi Pratap <ravi@ximian.com>
24332 * interface.cs (FindMembers): Implement to work around S.R.E
24335 * typemanager.cs (IsInterfaceType): Implement.
24337 (FindMembers): Update to handle interface types too.
24339 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24340 use IsAssignableFrom as that is not correct - it doesn't work.
24342 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24343 and accordingly override EmitStatement.
24345 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24346 using the correct logic :-)
24348 2001-10-19 Ravi Pratap <ravi@ximian.com>
24350 * ../errors/cs-11.cs : Add to demonstrate error -11
24352 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24354 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24355 then pass this as a hint to ResolveLValue.
24357 * expression.cs (FieldExpr): Add Location information
24359 (FieldExpr::LValueResolve): Report assignment to readonly
24362 (Expression::ExprClassFromMemberInfo): Pass location information.
24364 (Expression::ResolveLValue): Add new method that resolves an
24367 (Expression::DoResolveLValue): Default invocation calls
24370 (Indexers): New class used to keep track of indexers in a given
24373 (IStackStore): Renamed from LValue, as it did not really describe
24374 what this did. Also ResolveLValue is gone from this interface and
24375 now is part of Expression.
24377 (ElementAccess): Depending on the element access type
24379 * typemanager.cs: Add `indexer_name_type' as a Core type
24380 (System.Runtime.CompilerServices.IndexerNameAttribute)
24382 * statement.cs (Goto): Take a location.
24384 2001-10-18 Ravi Pratap <ravi@ximian.com>
24386 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24387 if two delegates are compatible.
24389 (NewDelegate::DoResolve): Update to take care of the case when
24390 we instantiate a delegate from another delegate.
24392 * typemanager.cs (FindMembers): Don't even try to look up members
24393 of Delegate types for now.
24395 2001-10-18 Ravi Pratap <ravi@ximian.com>
24397 * delegate.cs (NewDelegate): New class to take care of delegate
24400 * expression.cs (New): Split the delegate related code out into
24401 the NewDelegate class.
24403 * delegate.cs (DelegateInvocation): New class to handle delegate
24406 * expression.cs (Invocation): Split out delegate related code into
24407 the DelegateInvocation class.
24409 2001-10-17 Ravi Pratap <ravi@ximian.com>
24411 * expression.cs (New::DoResolve): Implement delegate creation fully
24412 and according to the spec.
24414 (New::DoEmit): Update to handle delegates differently.
24416 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24417 because of which we were printing out arguments in reverse order !
24419 * delegate.cs (VerifyMethod): Implement to check if the given method
24420 matches the delegate.
24422 (FullDelegateDesc): Implement.
24424 (VerifyApplicability): Implement.
24426 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24427 delegate invocations too.
24429 (Invocation::Emit): Ditto.
24431 * ../errors/cs1593.cs : Added.
24433 * ../errors/cs1594.cs : Added.
24435 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24437 2001-10-16 Ravi Pratap <ravi@ximian.com>
24439 * typemanager.cs (intptr_type): Core type for System.IntPtr
24441 (InitCoreTypes): Update for the same.
24443 (iasyncresult_type, asynccallback_type): Ditto.
24445 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24448 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24451 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24452 the builders for the 4 members of a delegate type :-)
24454 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24457 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24459 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24461 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24463 * statement.cs (Break::Emit): Implement.
24464 (Continue::Emit): Implement.
24466 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24467 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24468 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24469 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24472 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24473 properties that track the label for the current loop (begin of the
24474 loop and end of the loop).
24476 2001-10-15 Ravi Pratap <ravi@ximian.com>
24478 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24479 use of emitting anything at all.
24481 * class.cs, rootcontext.cs : Get rid of calls to the same.
24483 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24485 (Populate): Define the constructor correctly and set the implementation
24488 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24491 (AddDelegateType): Implement.
24493 (IsDelegateType): Implement helper method.
24495 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24497 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24498 and accordingly handle it.
24500 * delegate.cs (Populate): Take TypeContainer argument.
24501 Implement bits to define the Invoke method. However, I still haven't figured out
24502 how to take care of the native int bit :-(
24504 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24505 Qualify the name of the delegate, not its return type !
24507 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24510 (StandardConversionExists): Checking for array types turns out to be recursive.
24512 (ConvertReferenceExplicit): Implement array conversion.
24514 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24516 2001-10-12 Ravi Pratap <ravi@ximian.com>
24518 * cs-parser.jay (delegate_declaration): Store the fully qualified
24519 name as it is a type declaration.
24521 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24524 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24525 as TypeContainer::DefineType.
24527 (Populate): Method in which all the definition of the various methods (Invoke)
24530 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24533 (CloseDelegate): Finally creates the delegate.
24535 * class.cs (TypeContainer::DefineType): Update to define delegates.
24536 (Populate, Emit and CloseType): Do the same thing here too.
24538 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24539 delegates in all these operations.
24541 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24543 * expression.cs: LocalTemporary: a new expression used to
24544 reference a temporary that has been created.
24546 * assign.cs: Handle PropertyAccess back here, so that we can
24547 provide the proper semantic access to properties.
24549 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24550 a few more explicit conversions.
24552 * modifiers.cs: `NEW' modifier maps to HideBySig.
24554 * expression.cs (PropertyExpr): Make this into an
24555 ExpressionStatement, and support the EmitStatement code path.
24557 Perform get/set error checking, clean up the interface.
24559 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24560 them into toplevel access objects.
24562 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24564 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24567 * typemanager.cs: Keep track here of our PropertyBuilders again to
24568 work around lameness in SRE.
24570 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24572 * expression.cs (LValue::LValueResolve): New method in the
24573 interface, used to perform a second resolution pass for LValues.
24575 (This::DoResolve): Catch the use of this in static methods.
24577 (This::LValueResolve): Implement.
24579 (This::Store): Remove warning, assigning to `this' in structures
24582 (Invocation::Emit): Deal with invocation of
24583 methods on value types. We need to pass the address to structure
24584 methods rather than the object itself. (The equivalent code to
24585 emit "this" for structures leaves the entire structure on the
24586 stack instead of a pointer to it).
24588 (ParameterReference::DoResolve): Compute the real index for the
24589 argument based on whether the method takes or not a `this' pointer
24590 (ie, the method is static).
24592 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24593 value types returned from functions when we need to invoke a
24594 method on the sturcture.
24597 2001-10-11 Ravi Pratap <ravi@ximian.com>
24599 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24600 defining the type in the Modulebuilder or Typebuilder. This is to take
24601 care of nested types which need to be defined on the TypeBuilder using
24602 DefineNestedMethod.
24604 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24605 methods in RootContext, only ported to be part of TypeContainer.
24607 (TypeContainer::GetInterfaceOrClass): Ditto.
24609 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24611 * interface.cs (Interface::DefineInterface): New method. Does exactly
24612 what RootContext.CreateInterface did earlier, only it takes care of nested types
24615 (Interface::GetInterfaces): Move from RootContext here and port.
24617 (Interface::GetInterfaceByName): Same here.
24619 * rootcontext.cs (ResolveTree): Re-write.
24621 (PopulateTypes): Re-write.
24623 * class.cs (TypeContainer::Populate): Populate nested types too.
24624 (TypeContainer::Emit): Emit nested members too.
24626 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24627 instead just use the name argument passed in as it is already fully
24630 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24631 to TypeContainer mapping to see if a type is user-defined.
24633 * class.cs (TypeContainer::CloseType): Implement.
24635 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24636 the default constructor.
24638 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24641 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24643 * interface.cs (CloseType): Create the type here.
24645 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24648 Remove all the methods which are now in TypeContainer.
24650 2001-10-10 Ravi Pratap <ravi@ximian.com>
24652 * delegate.cs (Define): Re-write bits to define the delegate
24655 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24657 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24659 * expression.cs (ImplicitReferenceConversion): handle null as well
24660 as a source to convert to any reference type.
24662 * statement.cs (Return): Perform any implicit conversions to
24663 expected return type.
24665 Validate use of return statement.
24667 * codegen.cs (EmitContext): Pass the expected return type here.
24669 * class.cs (Method, Constructor, Property): Pass expected return
24670 type to EmitContext.
24672 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24674 * expression.cs: Make DoResolve take an EmitContext instead of a
24677 Replaced `l' and `location' for `loc', for consistency.
24679 (Error, Warning): Remove unneeded Tc argument.
24681 * assign.cs, literal.cs, constant.cs: Update to new calling
24684 * codegen.cs: EmitContext now contains a flag indicating whether
24685 code is being generated in a static method or not.
24687 * cs-parser.jay: DecomposeQI, new function that replaces the old
24688 QualifiedIdentifier. Now we always decompose the assembled
24689 strings from qualified_identifier productions into a group of
24692 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24694 * rootcontext.cs: Deal with field-less struct types correctly now
24695 by passing the size option to Define Type.
24697 * class.cs: Removed hack that created one static field.
24699 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24701 * statement.cs: Moved most of the code generation here.
24703 2001-10-09 Ravi Pratap <ravi@ximian.com>
24705 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24708 (ElementAccess): Remove useless bits for now - keep checks as the spec
24711 2001-10-08 Ravi Pratap <ravi@ximian.com>
24713 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24714 and start performing checks according to the spec.
24716 2001-10-07 Ravi Pratap <ravi@ximian.com>
24718 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24719 rank_specifiers instead.
24721 (rank_specifiers): Change the order in which the rank specifiers are stored
24723 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24725 * expression.cs (ElementAccess): Implement the LValue interface too.
24727 2001-10-06 Ravi Pratap <ravi@ximian.com>
24729 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24730 except that user defined conversions are not included.
24732 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24733 perform the conversion of the return type, if necessary.
24735 (New::DoResolve): Check whether we are creating an array or an object
24736 and accordingly do the needful.
24738 (New::Emit): Same here.
24740 (New::DoResolve): Implement guts of array creation.
24742 (New::FormLookupType): Helper function.
24744 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24746 * codegen.cs: Removed most of the code generation here, and move the
24747 corresponding code generation bits to the statement classes.
24749 Added support for try/catch/finalize and throw.
24751 * cs-parser.jay: Added support for try/catch/finalize.
24753 * class.cs: Catch static methods having the flags override,
24754 virtual or abstract.
24756 * expression.cs (UserCast): This user cast was not really doing
24757 what it was supposed to do. Which is to be born in fully resolved
24758 state. Parts of the resolution were being performed at Emit time!
24762 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24764 * expression.cs: Implicity convert the result from UserCast.
24766 2001-10-05 Ravi Pratap <ravi@ximian.com>
24768 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24769 prevented it from working correctly.
24771 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24772 merely ConvertImplicit.
24774 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24776 * typemanager.cs: Make the LookupTypeContainer function static,
24777 and not per-instance.
24779 * class.cs: Make static FindMembers (the one that takes a Type
24782 * codegen.cs: Add EmitForeach here.
24784 * cs-parser.jay: Make foreach a toplevel object instead of the
24785 inline expansion, as we need to perform semantic analysis on it.
24787 2001-10-05 Ravi Pratap <ravi@ximian.com>
24789 * expression.cs (Expression::ImplicitUserConversion): Rename to
24790 UserDefinedConversion.
24792 (Expression::UserDefinedConversion): Take an extra argument specifying
24793 whether we look for explicit user conversions too.
24795 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24797 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24799 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24800 with the appropriate arguments.
24802 * cs-parser.jay (cast_expression): Record location too.
24804 * expression.cs (Cast): Record location info.
24806 (Expression::ConvertExplicit): Take location argument.
24808 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24809 to determine if we are doing explicit conversions.
24811 (UserCast::Emit): Update accordingly.
24813 (Expression::ConvertExplicit): Report an error if everything fails.
24815 * ../errors/cs0030.cs : Add.
24817 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24819 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24820 virtual and newslot bits.
24822 * class.cs (TypeContainer::RegisterRequiredImplementations):
24823 Record methods we need.
24825 (TypeContainer::MakeKey): Helper function to make keys for
24826 MethodBases, since the Methodbase key is useless.
24828 (TypeContainer::Populate): Call RegisterRequiredImplementations
24829 before defining the methods.
24831 Create a mapping for method_builders_to_methods ahead of time
24832 instead of inside a tight loop.
24834 (::RequireMethods): Accept an object as the data to set into the
24835 hashtable so we can report interface vs abstract method mismatch.
24837 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24839 * report.cs: Make all of it static.
24841 * rootcontext.cs: Drop object_type and value_type computations, as
24842 we have those in the TypeManager anyways.
24844 Drop report instance variable too, now it is a global.
24846 * driver.cs: Use try/catch on command line handling.
24848 Add --probe option to debug the error reporting system with a test
24851 * report.cs: Add support for exiting program when a probe
24852 condition is reached.
24854 2001-10-03 Ravi Pratap <ravi@ximian.com>
24856 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24857 we do a forcible conversion regardless of type, to check if
24858 ForceConversion returns a null.
24860 (Binary::error19): Use location to report error.
24862 (Unary::error23): Use location here too.
24864 * ../errors/cs0019.cs : Check in.
24866 * ../errors/cs0023.cs : Check in.
24868 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24869 case of a non-null MethodInfo object with a length of 0 !
24871 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24872 an applicable member - according to the spec :-)
24873 Also fix logic to find members in base types.
24875 (Unary::ResolveOperator): Same here.
24877 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24878 as I was getting thoroughly confused between this and error19 :-)
24880 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24881 (::FindMostEncompassedType): Implement.
24882 (::FindMostEncompassingType): Implement.
24883 (::StandardConversionExists): Implement.
24885 (UserImplicitCast): Re-vamp. We now need info about most specific
24886 source and target types so that we can do the necessary conversions.
24888 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24889 mathematical union with no duplicates.
24891 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24893 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24894 in order from base classes to child classes, so that we can in
24895 child classes look up in our parent for method names and
24896 attributes (required for handling abstract, virtual, new, override
24897 constructs: we need to instrospect our base class, and if we dont
24898 populate the classes in order, the introspection might be
24899 incorrect. For example, a method could query its parent before
24900 the parent has any methods and would determine that the parent has
24901 no abstract methods (while it could have had them)).
24903 (RootContext::CreateType): Record the order in which we define the
24906 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24908 * class.cs (TypeContainer::Populate): Also method definitions can
24909 fail now, keep track of this.
24911 (TypeContainer::FindMembers): Implement support for
24912 DeclaredOnly/noDeclaredOnly flag.
24914 (Constructor::Emit) Return the ConstructorBuilder.
24916 (Method::Emit) Return the MethodBuilder.
24917 Check for abstract or virtual methods to be public.
24919 * rootcontext.cs (RootContext::CreateType): Register all the
24920 abstract methods required for the class to be complete and the
24921 interface methods that must be implemented.
24923 * cs-parser.jay: Report error 501 (method requires body if it is
24924 not marked abstract or extern).
24926 * expression.cs (TypeOf::Emit): Implement.
24928 * typemanager.cs: runtime_handle_type, new global type.
24930 * class.cs (Property::Emit): Generate code for properties.
24932 2001-10-02 Ravi Pratap <ravi@ximian.com>
24934 * expression.cs (Unary::ResolveOperator): Find operators on base type
24935 too - we now conform exactly to the spec.
24937 (Binary::ResolveOperator): Same here.
24939 * class.cs (Operator::Define): Fix minor quirk in the tests.
24941 * ../errors/cs0215.cs : Added.
24943 * ../errors/cs0556.cs : Added.
24945 * ../errors/cs0555.cs : Added.
24947 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24949 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24950 single integer which is really efficient
24952 2001-10-01 Ravi Pratap <ravi@ximian.com>
24954 * expression.cs (Expression::ImplicitUserConversion): Use location
24955 even in the case when we are examining True operators.
24957 * class.cs (Operator::Define): Perform extensive checks to conform
24958 with the rules for operator overloading in the spec.
24960 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24961 some of the other conversions mentioned in the spec.
24963 * typemanager.cs (array_type): New static member for the System.Array built-in
24966 (cloneable_interface): For System.ICloneable interface.
24968 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24969 we start resolving the tree and populating types.
24971 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24973 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24975 * expression.cs (Expression::ExprClassFromMemberInfo,
24976 Expression::Literalize): Create literal expressions from
24977 FieldInfos which are literals.
24979 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24980 type casts, because they were wrong. The test suite in tests
24983 (ImplicitNumericConversion): ushort to ulong requires a widening
24986 Int32 constant to long requires widening cast as well.
24988 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24989 for integers because the type on the stack is not i4.
24991 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24993 * expression.cs (report118): require location argument.
24995 * parameter.cs: Do not dereference potential null value.
24997 * class.cs: Catch methods that lack the `new' keyword when
24998 overriding a name. Report warnings when `new' is used without
24999 anything being there to override.
25001 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25003 * class.cs: Only add constructor to hashtable if it is non-null
25004 (as now constructors can fail on define).
25006 (TypeManager, Class, Struct): Take location arguments.
25008 Catch field instance initialization in structs as errors.
25010 accepting_filter: a new filter for FindMembers that is static so
25011 that we dont create an instance per invocation.
25013 (Constructor::Define): Catch errors where a struct constructor is
25016 * cs-parser.jay: Pass location information for various new
25019 * delegate.cs (Delegate): take a location argument.
25021 * driver.cs: Do not call EmitCode if there were problesm in the
25022 Definition of the types, as many Builders wont be there.
25024 * decl.cs (Decl::Decl): Require a location argument.
25026 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25027 into integers, and find the most appropiate integer for it.
25029 * literal.cs: Implement ULongLiteral.
25031 * rootcontext.cs: Provide better information about the location of
25032 failure when CreateType fails.
25034 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25036 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25039 * expression.cs (Binary::CheckShiftArguments): Add missing type
25041 (Binary::ResolveOperator): Add type to the logical and and logical
25042 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25045 (Binary::DoNumericPromotions): In the case where either argument
25046 is ulong (and most signed types combined with ulong cause an
25047 error) perform implicit integer constant conversions as well.
25049 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25051 * expression.cs (UserImplicitCast): Method should always be
25053 (Invocation::BetterConversion): Simplified test for IntLiteral.
25055 (Expression::ImplicitNumericConversion): Split this routine out.
25056 Put the code that performs implicit constant integer conversions
25059 (Expression::Resolve): Become a wrapper around DoResolve so we can
25060 check eclass and type being set after resolve.
25062 (Invocation::Badness): Remove this dead function
25064 (Binary::ResolveOperator): Do not compute the expensive argumnets
25065 unless we have a union for it.
25067 (Probe::Emit): Is needs to do an isinst and then
25068 compare against null.
25070 (::CanConvert): Added Location argument. If the Location argument
25071 is null (Location.Null), then we do not report errors. This is
25072 used by the `probe' mechanism of the Explicit conversion. We do
25073 not want to generate an error for something that the user
25074 explicitly requested to be casted. But the pipeline for an
25075 explicit cast first tests for potential implicit casts.
25077 So for now, if the Location is null, it means `Probe only' to
25078 avoid adding another argument. Might have to revise this
25081 (ClassCast): New class used to type cast objects into arbitrary
25082 classes (used in Explicit Reference Conversions).
25084 Implement `as' as well.
25086 Reverted all the patches from Ravi below: they were broken:
25088 * The use of `level' as a mechanism to stop recursive
25089 invocations is wrong. That was there just to catch the
25090 bug with a strack trace but not as a way of addressing
25093 To fix the problem we have to *understand* what is going
25094 on and the interactions and come up with a plan, not
25095 just get things going.
25097 * The use of the type conversion cache that I proposed
25098 last night had an open topic: How does this work across
25099 protection domains. A user defined conversion might not
25100 be public in the location where we are applying the
25101 conversion, a different conversion might be selected
25102 (ie, private A->B (better) but public B->A (worse),
25103 inside A, A->B applies, but outside it, B->A will
25106 * On top of that (ie, even if the above is solved),
25107 conversions in a cache need to be abstract. Ie, `To
25108 convert from an Int to a Short use an OpcodeCast', not
25109 `To convert from an Int to a Short use the OpcodeCast on
25110 the variable 5' (which is what this patch was doing).
25112 2001-09-28 Ravi Pratap <ravi@ximian.com>
25114 * expression.cs (Invocation::ConversionExists): Re-write to use
25115 the conversion cache
25117 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25118 cache all conversions done, not just user-defined ones.
25120 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25121 to determine if a conversion exists instead of acutually trying to
25122 perform the conversion. It's faster too.
25124 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25125 and only then attempt the implicit conversion.
25127 2001-09-28 Ravi Pratap <ravi@ximian.com>
25129 * expression.cs (ConvertImplicit): Use a cache for conversions
25130 already found. Check level of recursion and bail out if necessary.
25132 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25134 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25135 Export standard methods that we expect for string operations.
25137 * statement.cs (Block::UsageWarning): Track usage of variables and
25138 report the errors for not used variables.
25140 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25143 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25145 * codegen.cs: remove unnneded code
25147 * expression.cs: Removed BuiltinTypeAccess class
25149 Fix the order in which implicit conversions are
25152 The previous fixed dropped support for boxed conversions (adding a
25153 test to the test suite now)
25155 (UserImplicitCast::CanConvert): Remove test for source being null,
25156 that code is broken. We should not feed a null to begin with, if
25157 we do, then we should track the bug where the problem originates
25158 and not try to cover it up here.
25160 Return a resolved expression of type UserImplicitCast on success
25161 rather than true/false. Ravi: this is what I was talking about,
25162 the pattern is to use a static method as a "constructor" for
25165 Also, do not create arguments until the very last minute,
25166 otherwise we always create the arguments even for lookups that
25167 will never be performed.
25169 (UserImplicitCast::Resolve): Eliminate, objects of type
25170 UserImplicitCast are born in a fully resolved state.
25172 * typemanager.cs (InitCoreTypes): Init also value_type
25173 (System.ValueType).
25175 * expression.cs (Cast::Resolve): First resolve the child expression.
25177 (LValue): Add new method AddressOf to be used by
25180 Change the argument of Store to take an EmitContext instead of an
25181 ILGenerator, because things like FieldExpr need to be able to call
25182 their children expression to generate the instance code.
25184 (Expression::Error, Expression::Warning): Sugar functions for
25187 (Expression::MemberLookup): Accept a TypeContainer instead of a
25188 Report as the first argument.
25190 (Expression::ResolvePrimary): Killed. I still want to improve
25191 this as currently the code is just not right.
25193 (Expression::ResolveMemberAccess): Simplify, but it is still
25196 (Unary::Resolve): Catch errors in AddressOf operators.
25198 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25199 index to a byte for the short-version, or the compiler will choose
25200 the wrong Emit call, which generates the wrong data.
25202 (ParameterReference::Emit, ::Store): same.
25204 (FieldExpr::AddressOf): Implement.
25206 * typemanager.cs: TypeManager: made public variable instead of
25209 * driver.cs: document --fatal.
25211 * report.cs (ErrorMessage, WarningMessage): new names for the old
25212 Error and Warning classes.
25214 * cs-parser.jay (member_access): Turn built-in access to types
25215 into a normal simplename
25217 2001-09-27 Ravi Pratap <ravi@ximian.com>
25219 * expression.cs (Invocation::BetterConversion): Fix to cope
25220 with q being null, since this was introducing a bug.
25222 * expression.cs (ConvertImplicit): Do built-in conversions first.
25224 2001-09-27 Ravi Pratap <ravi@ximian.com>
25226 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25228 2001-09-27 Ravi Pratap <ravi@ximian.com>
25230 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25231 I had introduced long ago (what's new ?).
25233 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25234 the work of all the checking.
25235 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25236 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25238 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25239 that is the right way.
25241 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25242 overloading resolution. Use everywhere instead of cutting and pasting code.
25244 (Binary::ResolveOperator): Use MakeUnionSet.
25246 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25247 we have to convert to bool types. Not complete yet.
25249 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25251 * typemanager.cs (TypeManager::CSharpName): support ushort.
25253 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25254 to provide an expression that performsn an implicit constant int
25255 conversion (section 6.1.6).
25256 (Expression::ConvertImplicitRequired): Reworked to include
25257 implicit constant expression conversions.
25259 (Expression::ConvertNumericExplicit): Finished.
25261 (Invocation::Emit): If InstanceExpression is null, then it means
25262 that we perform a call on this.
25264 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25266 * expression.cs (Unary::Emit): Remove some dead code.
25267 (Probe): Implement Resolve and Emit for `is'.
25268 (Expression::ConvertImplicitRequired): Attempt to do constant
25269 expression conversions here. Maybe should be moved to
25270 ConvertImplicit, but I am not sure.
25271 (Expression::ImplicitLongConstantConversionPossible,
25272 Expression::ImplicitIntConstantConversionPossible): New functions
25273 that tell whether is it possible to apply an implicit constant
25274 expression conversion.
25276 (ConvertNumericExplicit): Started work on explicit numeric
25279 * cs-parser.jay: Update operator constants.
25281 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25282 (Parameters::GetSignature): Hook up VerifyArgs here.
25283 (Parameters::VerifyArgs): Verifies that no two arguments have the
25286 * class.cs (Operator): Update the operator names to reflect the
25287 ones that the spec expects (as we are just stringizing the
25290 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25291 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25292 previous usage did only work for our methods.
25293 (Expression::ConvertImplicit): Handle decimal implicit numeric
25294 conversions as well.
25295 (Expression::InternalTypeConstructor): Used to invoke constructors
25296 on internal types for default promotions.
25298 (Unary::Emit): Implement special handling for the pre/post
25299 increment/decrement for overloaded operators, as they need to have
25300 the same semantics as the other operators.
25302 (Binary::ResolveOperator): ditto.
25303 (Invocation::ConversionExists): ditto.
25304 (UserImplicitCast::Resolve): ditto.
25306 2001-09-26 Ravi Pratap <ravi@ximian.com>
25308 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25309 operator, return after emitting body. Regression tests pass again !
25311 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25312 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25313 (Invocation::OverloadResolve): Ditto.
25314 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25316 * everywhere : update calls to the above methods accordingly.
25318 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25320 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25322 * expression.cs (ExpressionStatement): New base class used for
25323 expressions that can appear in statements, so that we can provide
25324 an alternate path to generate expression that do not leave a value
25327 (Expression::Emit, and all the derivatives): We no longer return
25328 whether a value is left on the stack or not. Every expression
25329 after being emitted leaves a single value on the stack.
25331 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25332 facilties of ExpressionStatement if possible.
25334 * cs-parser.jay: Update statement_expression.
25336 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25338 * driver.cs: Change the wording of message
25340 2001-09-25 Ravi Pratap <ravi@ximian.com>
25342 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25343 the type of the expression to the return type of the method if
25344 we have an overloaded operator match ! The regression tests pass again !
25345 (Unary::ResolveOperator): Ditto.
25347 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25348 to find "op_Implicit", not "implicit" ;-)
25349 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25350 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25352 * everywhere : Correct calls to the above accordingly.
25354 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25355 (ConvertImplicit): Do user-defined conversion if it exists.
25357 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25359 * assign.cs: track location.
25360 (Resolve): Use implicit conversions on assignment.
25362 * literal.cs: Oops. Not good, Emit of short access values should
25363 pass (Bytes) or the wrong argument will be selected.
25365 * expression.cs (Unary::Emit): Emit code for -expr.
25367 (Unary::ResolveOperator): Handle `Substract' for non-constants
25368 (substract from zero from the non-constants).
25369 Deal with Doubles as well.
25371 (Expression::ConvertImplicitRequired): New routine that reports an
25372 error if no implicit conversion exists.
25374 (Invocation::OverloadResolve): Store the converted implicit
25375 expressions if we make them
25377 2001-09-24 Ravi Pratap <ravi@ximian.com>
25379 * class.cs (ConstructorInitializer): Take a Location argument.
25380 (ConstructorBaseInitializer): Same here.
25381 (ConstructorThisInitializer): Same here.
25383 * cs-parser.jay : Update all calls accordingly.
25385 * expression.cs (Unary, Binary, New): Take location argument.
25386 Update accordingly everywhere.
25388 * cs-parser.jay : Update all calls to the above to take a location
25391 * class.cs : Ditto.
25393 2001-09-24 Ravi Pratap <ravi@ximian.com>
25395 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25396 (Invocation::BetterConversion): Same here
25397 (Invocation::ConversionExists): Ditto.
25399 (Invocation::ConversionExists): Implement.
25401 2001-09-22 Ravi Pratap <ravi@ximian.com>
25403 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25404 Also take an additional TypeContainer argument.
25406 * All over : Pass in TypeContainer as argument to OverloadResolve.
25408 * typemanager.cs (CSharpName): Update to check for the string type and return
25411 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25414 2001-09-21 Ravi Pratap <ravi@ximian.com>
25416 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25417 (Invocation::BetterFunction): Implement.
25418 (Invocation::BetterConversion): Implement.
25419 (Invocation::ConversionExists): Skeleton, no implementation yet.
25421 Okay, things work fine !
25423 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25425 * typemanager.cs: declare and load enum_type, delegate_type and
25428 * expression.cs (Expression::Emit): Now emit returns a value that
25429 tells whether a value is left on the stack or not. This strategy
25430 might be reveted tomorrow with a mechanism that would address
25431 multiple assignments.
25432 (Expression::report118): Utility routine to report mismatches on
25435 (Unary::Report23): Report impossible type/operator combination
25438 (Unary::IsIncrementableNumber): Whether the type can be
25439 incremented or decremented with add.
25440 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25442 (Unary::ResolveOperator): Implement ++, !, ~,
25444 (Invocation::Emit): Deal with new Emit convetion.
25446 * All Expression derivatives: Updated their Emit method to return
25447 whether they leave values on the stack or not.
25449 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25450 stack for expressions that are statements.
25452 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25454 * expression.cs (LValue): New interface. Must be implemented by
25456 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25459 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25460 interface for generating code, simplifies the code.
25462 2001-09-20 Ravi Pratap <ravi@ximian.com>
25464 * expression.cs (everywhere): Comment out return statements in ::Resolve
25465 methods to avoid the warnings.
25467 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25469 * driver.cs (parse): Report error 2001 if we can not open the
25472 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25475 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25478 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25479 otherwise nested blocks end up with the same index.
25481 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25483 * expression.cs: Instead of having FIXMEs in the Resolve
25484 functions, throw exceptions so it is obvious that we are facing a
25487 * cs-parser.jay (invocation_expression): Pass Location information.
25489 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25490 Use a basename for those routines because .NET does not like paths
25493 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25496 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25498 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25499 are loading the correct data types (throws an exception if not).
25500 (TypeManager::InitCoreTypes): Use CoreLookupType
25502 * expression.cs (Unary::ResolveOperator): return the child
25503 expression for expressions which are just +expr.
25504 (Unary::ResolveOperator): Return negative literals for -LITERAL
25505 expressions (otherwise they are Unary {Literal}).
25506 (Invocation::Badness): Take into account `Implicit constant
25507 expression conversions'.
25509 * literal.cs (LongLiteral): Implement long literal class.
25510 (IntLiteral): export the `Value' of the intliteral.
25512 2001-09-19 Ravi Pratap <ravi@ximian.com>
25514 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25516 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25517 instead of 'Operator'
25519 * expression.cs (Binary::ResolveOperator): Update accordingly.
25520 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25523 * cs-parser.jay (unary_expression): Update to use the new names.
25525 * gen-treedump.cs (GetUnary): Same here.
25527 * expression.cs (Unary::Resolve): Implement.
25528 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25529 operators are found instead of making noise ;-)
25530 (Unary::ResolveOperator): New method to do precisely the same thing which
25531 Binary::ResolveOperator does for Binary expressions.
25532 (Unary.method, .Arguments): Add.
25533 (Unary::OperName): Implement.
25534 (Unary::ForceConversion): Copy and Paste !
25536 * class.cs (Operator::Define): Fix a small bug for the case when we have
25539 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25540 for the inbuilt operators. Only overloading works for now ;-)
25542 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25544 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25545 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25547 * expression.cs (This::Emit): Implement.
25548 (This::Resolve): Implement.
25549 (TypeOf:Resolve): Implement.
25550 (Expression::ResolveSimpleName): Add an implicit this to instance
25552 (MemberAccess::Resolve): Deal with Parameters and Fields.
25553 Bind instance variable to Field expressions.
25554 (FieldExpr::Instance): New field used to track the expression that
25555 represents the object instance.
25556 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25558 (FieldExpr::Emit): Implement.
25560 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25561 the last instruction contains a return opcode to avoid generating
25562 the last `ret' instruction (this generates correct code, and it is
25563 nice to pass the peverify output).
25565 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25566 initializer for static and instance variables.
25567 (Constructor::Emit): Allow initializer to be null in the case of
25568 static constructors. Only emit initializer for instance
25571 (TypeContainer::FindMembers): Return a null array if there are no
25574 Also fix the code for the MemberTypes.Method branch, as it was not
25575 scanning that for operators (or tried to access null variables before).
25577 * assign.cs (Assign::Emit): Handle instance and static fields.
25581 * driver.cs: Stop compilation if there are parse errors.
25583 * cs-parser.jay (constructor_declaration): Provide default base
25584 initializer for non-static constructors.
25585 (constructor_declarator): Do not provide a default base
25586 initializers if none was specified.
25587 Catch the fact that constructors should not have parameters.
25589 * class.cs: Do not emit parent class initializers for static
25590 constructors, that should be flagged as an error.
25592 2001-09-18 Ravi Pratap <ravi@ximian.com>
25594 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25595 Move back code into TypeContainer::Populate.
25597 2001-09-18 Ravi Pratap <ravi@ximian.com>
25599 * class.cs (TypeContainer::AddConstructor): Fix the check to
25600 compare against Name, not Basename.
25601 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25603 * cs-parser.jay : Update accordingly.
25605 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25606 for methods, don't forget to look into the operators too.
25607 (RegisterMethodBuilder): Helper method to take care of this for
25608 methods, constructors and operators.
25609 (Operator::Define): Completely revamp.
25610 (Operator.OperatorMethod, MethodName): New fields.
25611 (TypeContainer::Populate): Move the registering of builders into
25612 RegisterMethodBuilder.
25613 (Operator::Emit): Re-write.
25615 * expression.cs (Binary::Emit): Comment out code path to emit method
25616 invocation stuff for the case when we have a user defined operator. I am
25617 just not able to get it right !
25619 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25621 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25624 (Expression::MemberLookup): Provide a version that allows to
25625 specify the MemberTypes and BindingFlags.
25627 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25628 so it was not fetching variable information from outer blocks.
25630 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25631 Beforefieldinit as it was buggy.
25633 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25634 that Ravi put here.
25636 * class.cs (Constructor::Emit): Only emit if block is not null.
25637 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25638 deal with this by semantically definining it as if the user had
25641 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25642 constructors as we now "emit" them at a higher level.
25644 (TypeContainer::DefineDefaultConstructor): Used to define the
25645 default constructors if none was provided.
25647 (ConstructorInitializer): Add methods Resolve and Emit.
25649 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25651 2001-09-17 Ravi Pratap <ravi@ximian.com>
25653 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25654 the default constructor builder with our hashtable for methodbuilders
25657 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25658 and argument_count is 0 in which case we have a match.
25659 (Binary::ResolveOperator): More null checking and miscellaneous coding
25662 2001-09-17 Ravi Pratap <ravi@ximian.com>
25664 * rootcontext.cs (IsNameSpace): Compare against null.
25666 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25668 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25669 and Unary::Operator.
25671 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25674 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25675 we have overloaded operators.
25676 (Binary::ResolveOperator): Implement the part which does the operator overload
25679 * class.cs (Operator::Emit): Implement.
25680 (TypeContainer::Emit): Emit the operators we have too.
25682 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25683 the case when we have a user-defined operator.
25685 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25687 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25689 2001-09-16 Ravi Pratap <ravi@ximian.com>
25691 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25692 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25693 (Constructor::Emit): Implement.
25694 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25695 if we have no work to do.
25696 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25699 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25700 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25702 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25705 2001-09-15 Ravi Pratap <ravi@ximian.com>
25707 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25709 (Tree::RecordNamespace): Method to do what the name says ;-)
25710 (Tree::Namespaces): Property to get at the namespaces hashtable.
25712 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25715 * rootcontext.cs (IsNamespace): Fixed it :-)
25717 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25719 * class.cs (TypeContainer::FindMembers): Add support for
25721 (MethodCore): New class that encapsulates both the shared aspects
25722 of a Constructor and a Method.
25723 (Method, Constructor): Factored pieces into MethodCore.
25725 * driver.cs: Added --fatal which makes errors throw exceptions.
25726 Load System assembly as well as part of the standard library.
25728 * report.cs: Allow throwing exceptions on errors for debugging.
25730 * modifiers.cs: Do not use `parent', instead use the real type
25731 container to evaluate permission settings.
25733 * class.cs: Put Ravi's patch back in. He is right, and we will
25734 have to cope with the
25736 2001-09-14 Ravi Pratap <ravi@ximian.com>
25738 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25739 FamORAssem, not FamANDAssem.
25741 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25743 * driver.cs: Added --parse option that only parses its input files
25746 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25747 incorrect. IsTopLevel is not used to tell whether an object is
25748 root_types or not (that can be achieved by testing this ==
25749 root_types). But to see if this is a top-level *class* (not
25750 necessarly our "toplevel" container).
25752 2001-09-14 Ravi Pratap <ravi@ximian.com>
25754 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25755 parent instead of a direct call to GetType.
25757 2001-09-14 Ravi Pratap <ravi@ximian.com>
25759 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25760 Modifiers.TypeAttr. This should just be a call to that method.
25762 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25763 object so that we can determine if we are top-level or not.
25765 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25768 * enum.cs (Enum::Define): Ditto.
25770 * modifiers.cs (FieldAttr): Re-write.
25772 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25773 (TypeContainer::HaveStaticConstructor): New property to provide access
25774 to precisely that info.
25776 * modifiers.cs (MethodAttr): Re-write.
25777 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25779 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25780 of top-level types as claimed.
25782 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25784 * expression.cs (MemberLookup): Fruitless attempt to lookup
25785 constructors. Maybe I need to emit default constructors? That
25786 might be it (currently .NET emits this for me automatically).
25787 (Invocation::OverloadResolve): Cope with Arguments == null.
25788 (Invocation::EmitArguments): new function, shared by the new
25789 constructor and us.
25790 (Invocation::Emit): Handle static and instance methods. Emit
25791 proper call instruction for virtual or non-virtual invocations.
25792 (New::Emit): Implement.
25793 (New::Resolve): Implement.
25794 (MemberAccess:Resolve): Implement.
25795 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25796 to track instances.
25797 (FieldExpr::Resolve): Set type.
25799 * support.cs: Handle empty arguments.
25801 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25802 SimpleLookup): Auxiliary routines to help parse a qualifier
25805 Update qualifier_identifier rule.
25807 * codegen.cs: Removed debugging messages.
25809 * class.cs: Make this a global thing, this acts just as a "key" to
25810 objects that we might have around.
25812 (Populate): Only initialize method_builders_to_methods once.
25814 * expression.cs (PropertyExpr): Initialize type from the
25817 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25818 Resolve pattern. Attempt to implicitly convert value to boolean.
25821 * expression.cs: Set the type for the int32/int32 argument case.
25822 (Binary::ResolveOperator): Set the return type to boolean for
25823 comparission operators
25825 * typemanager.cs: Remove debugging print code.
25827 (Invocation::Resolve): resolve type.
25829 * class.cs: Allocate a MemberInfo of the correct size, as the code
25830 elsewhere depends on the test to reflect the correct contents.
25832 (Method::) Keep track of parameters, due to System.Reflection holes
25834 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25837 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25838 of the exact size and return that.
25840 (Class::LookupMethodByBuilder): New function that maps
25841 MethodBuilders to its methods. Required to locate the information
25842 on methods because System.Reflection bit us again.
25844 * support.cs: New file, contains an interface ParameterData and
25845 two implementations: ReflectionParameters and InternalParameters
25846 used to access Parameter information. We will need to grow this
25849 * expression.cs (Invocation::GetParameterData): implement a cache
25850 and a wrapper around the ParameterData creation for methods.
25851 (Invocation::OverloadResolve): Use new code.
25853 2001-09-13 Ravi Pratap <ravi@ximian.com>
25855 * class.cs (TypeContainer::EmitField): Remove and move into
25856 (Field::Define): here and modify accordingly.
25857 (Field.FieldBuilder): New member.
25858 (TypeContainer::Populate): Update accordingly.
25859 (TypeContainer::FindMembers): Implement.
25861 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25863 * statement.cs: (VariableInfo::VariableType): New field to be
25864 initialized with the full type once it is resolved.
25866 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25868 * parameter.cs (GetParameterInfo): Use a type cache to compute
25869 things only once, and to reuse this information
25871 * expression.cs (LocalVariableReference::Emit): Implement.
25872 (OpcodeCast::Emit): fix.
25874 (ParameterReference::Resolve): Implement.
25875 (ParameterReference::Emit): Implement.
25877 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25878 that are expressions need to stay as Expressions.
25880 * typemanager.cs (CSharpName): Returns the C# name of a type if
25883 * expression.cs (Expression::ConvertImplicit): New function that
25884 implements implicit type conversions.
25886 (Expression::ImplicitReferenceConversion): Implements implicit
25887 reference conversions.
25889 (EmptyCast): New type for transparent casts.
25891 (OpcodeCast): New type for casts of types that are performed with
25892 a sequence of bytecodes.
25894 (BoxedCast): New type used for casting value types into reference
25895 types. Emits a box opcode.
25897 (Binary::DoNumericPromotions): Implements numeric promotions of
25898 and computation of the Binary::Type.
25900 (Binary::EmitBranchable): Optimization.
25902 (Binary::Emit): Implement code emission for expressions.
25904 * typemanager.cs (TypeManager): Added two new core types: sbyte
25907 2001-09-12 Ravi Pratap <ravi@ximian.com>
25909 * class.cs (TypeContainer::FindMembers): Method which does exactly
25910 what Type.FindMembers does, only we don't have to use reflection. No
25911 implementation yet.
25913 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25914 typecontainer objects as we need to get at them.
25915 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25917 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25918 typecontainer object.
25920 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25921 of just a Report object.
25923 2001-09-11 Ravi Pratap <ravi@ximian.com>
25925 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25927 (TypeContainer::Populate): Now define the delegates of the type too.
25928 (TypeContainer.Delegates): Property to access the list of delegates defined
25931 * delegates.cs (Delegate::Define): Implement partially.
25933 * modifiers.cs (TypeAttr): Handle more flags.
25935 2001-09-11 Ravi Pratap <ravi@ximian.com>
25937 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25939 (Operator::Define): Re-write logic to get types by using the LookupType method
25940 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25941 (Indexer::Define): Ditto.
25942 (Event::Define): Ditto.
25943 (Property::Define): Ditto.
25945 2001-09-10 Ravi Pratap <ravi@ximian.com>
25947 * class.cs (TypeContainer::Populate): Now define operators too.
25948 (TypeContainer.Operators): New property to access the list of operators
25950 (Operator.OperatorMethodBuilder): New member to hold the method builder
25951 for the operator we are defining.
25952 (Operator::Define): Implement.
25954 2001-09-10 Ravi Pratap <ravi@ximian.com>
25956 * class.cs (Event::Define): Make the prefixes of the accessor methods
25957 addOn_ and removeOn_
25959 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25960 of the location being passed in too. Ideally, this should go later since all
25961 error reporting should be done through the Report object.
25963 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25964 (Populate): Iterate thru the indexers we have and define them too.
25965 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25966 for the get and set accessors.
25967 (Indexer::Define): Implement.
25969 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25971 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25972 my previous implementation, did not work.
25974 * typemanager.cs: Add a couple of missing types (the longs).
25976 * literal.cs: Use TypeManager.bool_type instead of getting it.
25978 * expression.cs (EventExpr): New kind of expressions.
25979 (Expressio::ExprClassFromMemberInfo): finish
25981 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25983 * assign.cs: Emit stores to static fields differently.
25985 2001-09-08 Ravi Pratap <ravi@ximian.com>
25987 * Merge in changes and adjust code to tackle conflicts. Backed out my
25988 code in Assign::Resolve ;-)
25990 2001-09-08 Ravi Pratap <ravi@ximian.com>
25992 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25993 instead Report.Error and also pass in the location.
25994 (CSharpParser::Lexer): New readonly property to return the reference
25995 to the Tokenizer object.
25996 (declare_local_variables): Use Report.Error with location instead of plain
26000 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26001 (Operator.CheckBinaryOperator): Ditto.
26003 * cs-parser.jay (operator_declarator): Update accordingly.
26005 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26006 (CheckBinaryOperator): Same here.
26008 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26009 on the name without any prefixes of namespace names etc. This is because we
26010 already might have something already fully qualified like
26011 'System.Console.WriteLine'
26013 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26015 2001-09-07 Ravi Pratap <ravi@ximian.com>
26017 * cs-tokenizer.cs (location): Return a string which also contains
26020 * expression.cs (ElementAccess): New class for expressions of the
26021 type 'element access.'
26022 (BaseAccess): New class for expressions of the type 'base access.'
26023 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26026 * cs-parser.jay (element_access): Implement action.
26027 (base_access): Implement actions.
26028 (checked_expression, unchecked_expression): Implement.
26030 * cs-parser.jay (local_variable_type): Correct and implement.
26031 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26033 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26035 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26036 name and the specifiers.
26038 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26040 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26041 making them all public ;-)
26043 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26046 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26048 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26050 (FieldExpr, PropertyExprs): New resolved expressions.
26051 (SimpleName::MemberStaticCheck): Perform static checks for access
26052 to non-static fields on static methods. Maybe this should be
26053 generalized for MemberAccesses.
26054 (SimpleName::ResolveSimpleName): More work on simple name
26057 * cs-parser.jay (primary_expression/qualified_identifier): track
26058 the parameter index.
26060 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26061 (EmitContext::EmitBoolExpression): Chain to expression generation
26062 instead of temporary hack.
26063 (::EmitStatementExpression): Put generic expression code generation.
26065 * assign.cs (Assign::Emit): Implement variable assignments to
26066 local variables, parameters and fields.
26068 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26070 * statement.cs (Block::GetVariableInfo): New method, returns the
26071 VariableInfo for a variable name in a block.
26072 (Block::GetVariableType): Implement in terms of GetVariableInfo
26074 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26075 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26077 2001-09-06 Ravi Pratap <ravi@ximian.com>
26079 * cs-parser.jay (operator_declaration): Continue on my quest : update
26080 to take attributes argument.
26081 (event_declaration): Ditto.
26082 (enum_declaration): Ditto.
26083 (indexer_declaration): Ditto.
26085 * class.cs (Operator::Operator): Update constructor accordingly.
26086 (Event::Event): Ditto.
26088 * delegate.cs (Delegate::Delegate): Same here.
26090 * enum.cs (Enum::Enum): Same here.
26092 2001-09-05 Ravi Pratap <ravi@ximian.com>
26094 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26096 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26098 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26099 being passed around as an arraylist.
26100 (Attributes::AddAttribute): Method to add attribute sections.
26102 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26103 (struct_declaration): Update accordingly.
26104 (constant_declaration): Update.
26105 (field_declaration): Update.
26106 (method_header): Update.
26107 (fixed_parameter): Update.
26108 (parameter_array): Ditto.
26109 (property_declaration): Ditto.
26110 (destructor_declaration): Ditto.
26112 * class.cs (Struct::Struct): Update constructors accordingly.
26113 (Class::Class): Ditto.
26114 (Field::Field): Ditto.
26115 (Method::Method): Ditto.
26116 (Property::Property): Ditto.
26117 (TypeContainer::OptAttribute): update property's return type.
26119 * interface.cs (Interface.opt_attributes): New member.
26120 (Interface::Interface): Update to take the extra Attributes argument.
26122 * parameter.cs (Parameter::Parameter): Ditto.
26124 * constant.cs (Constant::Constant): Ditto.
26126 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26127 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26128 the attributes as a parameter.
26129 (InterfaceProperty): Update constructor call.
26130 (InterfaceEvent): Ditto.
26131 (InterfaceMethod): Ditto.
26132 (InterfaceIndexer): Ditto.
26134 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26135 pass the attributes too.
26136 (interface_event_declaration): Ditto.
26137 (interface_property_declaration): Ditto.
26138 (interface_method_declaration): Ditto.
26139 (interface_declaration): Ditto.
26141 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26143 * class.cs (Method::Define): Track the "static Main" definition to
26144 create an entry point.
26146 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26147 EntryPoint if we find it.
26149 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26150 (EmitContext::ig): Make this variable public.
26152 * driver.cs: Make the default output file be the first file name
26153 with the .exe extension.
26155 Detect empty compilations
26157 Handle various kinds of output targets. Handle --target and
26158 rename -t to --dumper.
26160 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26161 methods inherited from Expression return now an Expression. This
26162 will is used during the tree rewriting as we resolve them during
26165 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26166 the spec. Missing entirely is the information about
26167 accessability of elements of it.
26169 (Expression::ExprClassFromMemberInfo): New constructor for
26170 Expressions that creates a fully initialized Expression based on
26171 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26174 (Invocation::Resolve): Begin implementing resolution of invocations.
26176 * literal.cs (StringLiteral): Implement Emit.
26178 2001-09-05 Ravi Pratap <ravi@ximian.com>
26180 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26183 2001-09-04 Ravi Pratap <ravi@ximian.com>
26185 * cs-parser.jay (attribute_arguments): Implement actions.
26186 (attribute): Fix bug in production. Implement action.
26187 (attribute_list): Implement.
26188 (attribute_target): Implement.
26189 (attribute_target_specifier, opt_target_specifier): Implement
26190 (CheckAttributeTarget): New method to check if the attribute target
26192 (attribute_section): Implement.
26193 (opt_attributes): Implement.
26195 * attribute.cs : New file to handle attributes.
26196 (Attribute): Class to hold attribute info.
26198 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26199 (attribute_section): Modify production to use 2 different rules to
26200 achieve the same thing. 1 s/r conflict down !
26201 Clean out commented, useless, non-reducing dimension_separator rules.
26203 * class.cs (TypeContainer.attributes): New member to hold list
26204 of attributes for a type.
26205 (Struct::Struct): Modify to take one more argument, the attribute list.
26206 (Class::Class): Ditto.
26207 (Field::Field): Ditto.
26208 (Method::Method): Ditto.
26209 (Property::Property): Ditto.
26211 * cs-parser.jay (struct_declaration): Update constructor call to
26212 pass in the attributes too.
26213 (class_declaration): Ditto.
26214 (constant_declaration): Ditto.
26215 (field_declaration): Ditto.
26216 (method_header): Ditto.
26217 (fixed_parameter): Ditto.
26218 (parameter_array): Ditto.
26219 (property_declaration): Ditto.
26221 * constant.cs (Constant::Constant): Update constructor similarly.
26222 Use System.Collections.
26224 * parameter.cs (Parameter::Parameter): Update as above.
26226 2001-09-02 Ravi Pratap <ravi@ximian.com>
26228 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26229 (TypeContainer.delegates): New member to hold list of delegates.
26231 * cs-parser.jay (delegate_declaration): Implement the action correctly
26232 this time as I seem to be on crack ;-)
26234 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26236 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26237 tell whether an identifier represents a namespace.
26239 * expression.cs (NamespaceExpr): A namespace expression, used only
26240 temporarly during expression resolution.
26241 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26242 utility functions to resolve names on expressions.
26244 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26246 * codegen.cs: Add hook for StatementExpressions.
26248 * class.cs: Fix inverted test for static flag in methods.
26250 2001-09-02 Ravi Pratap <ravi@ximian.com>
26252 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26253 to make it coincide with MS' number.
26254 (Operator::CheckBinaryOperator): Ditto.
26256 * ../errors/errors.txt : Remove error numbers added earlier.
26258 * ../errors/cs1019.cs : Test case for error # 1019
26260 * ../errros/cs1020.cs : Test case for error # 1020
26262 * cs-parser.jay : Clean out commented cruft.
26263 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26264 used anywhere - non-reducing rule.
26265 (namespace_declarations): Non-reducing rule - comment out.
26267 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26268 with TypeContainer::AddEnum.
26270 * delegate.cs : New file for delegate handling classes.
26271 (Delegate): Class for declaring delegates.
26273 * makefile : Update.
26275 * cs-parser.jay (delegate_declaration): Implement.
26277 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26279 * class.cs (Event::Define): Implement.
26280 (Event.EventBuilder): New member.
26282 * class.cs (TypeContainer::Populate): Update to define all enums and events
26284 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26285 readonly fields for all these cases ?
26287 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26289 * class.cs (Property): Revamp to use the convention of making fields readonly.
26290 Accordingly modify code elsewhere.
26292 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26293 the Define method of the Property class.
26295 * class.cs : Clean up applied patch and update references to variables etc. Fix
26297 (TypeContainer::Populate): Update to define all the properties we have. Also
26298 define all enumerations.
26300 * enum.cs (Define): Implement.
26302 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26304 * cs-parser.jay (overloadable_operator): The semantic value is an
26305 enum of the Operator class.
26306 (operator_declarator): Implement actions.
26307 (operator_declaration): Implement.
26309 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26310 validity of definitions.
26311 (Operator::CheckBinaryOperator): Static method to check for binary operators
26312 (TypeContainer::AddOperator): New method to add an operator to a type.
26314 * cs-parser.jay (indexer_declaration): Added line to actually call the
26315 AddIndexer method so it gets added ;-)
26317 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26318 already taken care of by the MS compiler ?
26320 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26322 * class.cs (Operator): New class for operator declarations.
26323 (Operator::OpType): Enum for the various operators.
26325 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26327 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26328 ostensibly handle this in semantic analysis.
26330 * cs-parser.jay (general_catch_clause): Comment out
26331 (specific_catch_clauses, specific_catch_clause): Ditto.
26332 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26333 (catch_args, opt_catch_args): New productions.
26334 (catch_clause): Rewrite to use the new productions above
26335 (catch_clauses): Modify accordingly.
26336 (opt_catch_clauses): New production to use in try_statement
26337 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26338 and re-write the code in the actions to extract the specific and
26339 general catch clauses by being a little smart ;-)
26341 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26342 Hooray, try and catch statements parse fine !
26344 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26346 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26347 string from the hashtable of variables.
26349 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26350 I end up making that mistake ;-)
26351 (catch_clauses): Fixed gross error which made Key and Value of the
26352 DictionaryEntry the same : $1 !!
26354 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26356 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26358 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26359 when the add and remove accessors are specified.
26361 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26363 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26364 information about indexer_declarator.
26365 (indexer_declarator): Implement actions.
26366 (parsing_indexer): New local boolean used to keep track of whether
26367 we are parsing indexers or properties. This is necessary because
26368 implicit_parameters come into picture even for the get accessor in the
26369 case of an indexer.
26370 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26372 * class.cs (Indexer): New class for indexer declarations.
26373 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26374 (TypeContainer::indexers): New member to hold list of indexers for the
26377 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26379 * cs-parser.jay (add_accessor_declaration): Implement action.
26380 (remove_accessor_declaration): Implement action.
26381 (event_accessors_declaration): Implement
26382 (variable_declarators): swap statements for first rule - trivial.
26384 * class.cs (Event): New class to hold information about event
26386 (TypeContainer::AddEvent): New method to add an event to a type
26387 (TypeContainer::events): New member to hold list of events.
26389 * cs-parser.jay (event_declaration): Implement actions.
26391 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26393 * cs-parser.jay (dim_separators): Implement. Make it a string
26394 concatenating all the commas together, just as they appear.
26395 (opt_dim_separators): Modify accordingly
26396 (rank_specifiers): Update accordingly. Basically do the same
26397 thing - instead, collect the brackets here.
26398 (opt_rank_sepcifiers): Modify accordingly.
26399 (array_type): Modify to actually return the complete type string
26400 instead of ignoring the rank_specifiers.
26401 (expression_list): Implement to collect the expressions
26402 (variable_initializer): Implement. We make it a list of expressions
26403 essentially so that we can handle the array_initializer case neatly too.
26404 (variable_initializer_list): Implement.
26405 (array_initializer): Make it a list of variable_initializers
26406 (opt_array_initializer): Modify accordingly.
26408 * expression.cs (New::NType): Add enumeration to help us
26409 keep track of whether we have an object/delegate creation
26410 or an array creation.
26411 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26412 members to hold data about array creation.
26413 (New:New): Modify to update NewType
26414 (New:New): New Overloaded contructor for the array creation
26417 * cs-parser.jay (array_creation_expression): Implement to call
26418 the overloaded New constructor.
26420 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26422 * class.cs (TypeContainer::Constructors): Return member
26423 constructors instead of returning null.
26425 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26427 * typemanager.cs (InitCoreTypes): Initialize the various core
26428 types after we have populated the type manager with the user
26429 defined types (this distinction will be important later while
26430 compiling corlib.dll)
26432 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26433 on Expression Classification. Now all expressions have a method
26434 `Resolve' and a method `Emit'.
26436 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26437 generation from working. Also add some temporary debugging
26440 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26442 * codegen.cs: Lots of code generation pieces. This is only the
26443 beginning, will continue tomorrow with more touches of polish. We
26444 handle the fundamentals of if, while, do, for, return. Others are
26445 trickier and I need to start working on invocations soon.
26447 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26450 * codegen.cs (EmitContext): New struct, used during code
26451 emission to keep a context. Most of the code generation will be
26454 * cs-parser.jay: Add embedded blocks to the list of statements of
26455 this block. So code generation proceeds in a top down fashion.
26457 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26459 * statement.cs: Add support for multiple child blocks.
26461 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26463 * codegen.cs (EmitCode): New function, will emit the code for a
26464 Block of code given a TypeContainer and its ILGenerator.
26466 * statement.cs (Block): Standard public readonly optimization.
26467 (Block::Block constructors): Link children.
26468 (Block::Child): Child Linker.
26469 (Block::EmitVariables): Emits IL variable declarations.
26471 * class.cs: Drop support for MethodGroups here, delay until
26473 (Method::): Applied the same simplification that I did before, and
26474 move from Properties to public readonly fields.
26475 (Method::ParameterTypes): Returns the parameter types for the
26476 function, and implements a cache that will be useful later when I
26477 do error checking and the semantic analysis on the methods is
26479 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26480 and made a method, optional argument tells whether this is a class
26481 or a structure to apply the `has-this' bit.
26482 (Method::GetCallingConvention): Implement, returns the calling
26484 (Method::Define): Defines the type, a second pass is performed
26485 later to populate the methods.
26487 (Constructor::ParameterTypes): implement a cache similar to the
26488 one on Method::ParameterTypes, useful later when we do semantic
26491 (TypeContainer::EmitMethod): New method. Emits methods.
26493 * expression.cs: Removed MethodGroup class from here.
26495 * parameter.cs (Parameters::GetCallingConvention): new method.
26497 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26499 * class.cs (TypeContainer::Populate): Drop RootContext from the
26502 (Constructor::CallingConvention): Returns the calling convention.
26503 (Constructor::ParameterTypes): Returns the constructor parameter
26506 (TypeContainer::AddConstructor): Keep track of default constructor
26507 and the default static constructor.
26509 (Constructor::) Another class that starts using `public readonly'
26510 instead of properties.
26512 (Constructor::IsDefault): Whether this is a default constructor.
26514 (Field::) use readonly public fields instead of properties also.
26516 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26517 track of static constructors; If none is used, turn on
26518 BeforeFieldInit in the TypeAttributes.
26520 * cs-parser.jay (opt_argument_list): now the return can be null
26521 for the cases where there are no arguments.
26523 (constructor_declarator): If there is no implicit `base' or
26524 `this', then invoke the default parent constructor.
26526 * modifiers.cs (MethodAttr): New static function maps a set of
26527 modifiers flags into a MethodAttributes enum
26528 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26529 MethodAttr, TypeAttr to represent the various mappings where the
26530 modifiers are used.
26531 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26533 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26535 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26538 * interface.cs (PopulateIndexer): Implemented the code generator
26539 for interface indexers.
26541 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26543 * interface.cs (InterfaceMemberBase): Now we track the new status
26546 (PopulateProperty): Implement property population. Woohoo! Got
26547 Methods and Properties going today.
26549 Removed all the properties for interfaces, and replaced them with
26550 `public readonly' fields.
26552 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26554 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26555 initialize their hashtables/arraylists only when they are needed
26556 instead of doing this always.
26558 * parameter.cs: Handle refs and out parameters.
26560 * cs-parser.jay: Use an ArrayList to construct the arguments
26561 instead of the ParameterCollection, and then cast that to a
26564 * parameter.cs: Drop the use of ParameterCollection and use
26565 instead arrays of Parameters.
26567 (GetParameterInfo): Use the Type, not the Name when resolving
26570 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26572 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26573 and instead use public readonly fields.
26575 * class.cs: Put back walking code for type containers.
26577 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26579 * class.cs (MakeConstant): Code to define constants.
26581 * rootcontext.cs (LookupType): New function. Used to locate types
26584 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26586 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26587 this System.Reflection code is. Kudos to Microsoft
26589 * typemanager.cs: Implement a type cache and avoid loading all
26590 types at boot time. Wrap in LookupType the internals. This made
26591 the compiler so much faster. Wow. I rule!
26593 * driver.cs: Make sure we always load mscorlib first (for
26594 debugging purposes, nothing really important).
26596 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26597 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26599 * rootcontext.cs: Lookup types on their namespace; Lookup types
26600 on namespaces that have been imported using the `using' keyword.
26602 * class.cs (TypeContainer::TypeAttr): Virtualize.
26603 (Class::TypeAttr): Return attributes suitable for this bad boy.
26604 (Struct::TypeAttr): ditto.
26605 Handle nested classes.
26606 (TypeContainer::) Remove all the type visiting code, it is now
26607 replaced with the rootcontext.cs code
26609 * rootcontext.cs (GetClassBases): Added support for structs.
26611 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26613 * interface.cs, statement.cs, class.cs, parameter.cs,
26614 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26615 Drop use of TypeRefs, and use strings instead.
26617 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26621 * class.cs (Struct::Struct): set the SEALED flags after
26622 checking the modifiers.
26623 (TypeContainer::TypeAttr): new property, returns the
26624 TypeAttributes for a class.
26626 * cs-parser.jay (type_list): Oops, list production was creating a
26627 new list of base types.
26629 * rootcontext.cs (StdLib): New property.
26630 (GetInterfaceTypeByName): returns an interface by type name, and
26631 encapsulates error handling here.
26632 (GetInterfaces): simplified.
26633 (ResolveTree): Encapsulated all the tree resolution here.
26634 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26637 * driver.cs: Add support for --nostdlib, to avoid loading the
26638 default assemblies.
26639 (Main): Do not put tree resolution here.
26641 * rootcontext.cs: Beginning of the class resolution.
26643 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26645 * rootcontext.cs: Provide better error reporting.
26647 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26649 * rootcontext.cs (CreateInterface): Handle the case where there
26650 are no parent interfaces.
26652 (CloseTypes): Routine to flush types at the end.
26653 (CreateInterface): Track types.
26654 (GetInterfaces): Returns an array of Types from the list of
26655 defined interfaces.
26657 * typemanager.c (AddUserType): Mechanism to track user types (puts
26658 the type on the global type hash, and allows us to close it at the
26661 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26663 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26664 RecordInterface instead.
26666 * cs-parser.jay: Updated to reflect changes above.
26668 * decl.cs (Definition): Keep track of the TypeBuilder type that
26669 represents this type here. Not sure we will use it in the long
26670 run, but wont hurt for now.
26672 * driver.cs: Smaller changes to accomodate the new code.
26674 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26677 * rootcontext.cs (CreateInterface): New method, used to create
26678 the System.TypeBuilder type for interfaces.
26679 (ResolveInterfaces): new entry point to resolve the interface
26681 (CodeGen): Property, used to keep track of the code generator.
26683 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26685 * cs-parser.jay: Add a second production for delegate_declaration
26688 (enum_body): Put an opt_comma here instead of putting it on
26689 enum_body or enum_member_declarations so we can handle trailing
26690 commas on enumeration members. Gets rid of a shift/reduce.
26692 (type_list): Need a COMMA in the middle.
26694 (indexer_declaration): Tell tokenizer to recognize get/set
26696 * Remove old targets.
26698 * Re-add the parser target.
26700 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26702 * cs-parser.jay: Add precendence rules for a number of operators
26703 ot reduce the number of shift/reduce conflicts in the grammar.
26705 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26707 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26710 Get rid of old crufty code.
26712 * rootcontext.cs: Use this to keep track of the parsed
26713 representation and the defined types available to the program.
26715 * gen-treedump.cs: adjust for new convention.
26717 * type.cs: Split out the type manager, and the assembly builder
26720 * typemanager.cs: the type manager will live here now.
26722 * cil-codegen.cs: And the code generator here.
26724 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26726 * makefile: Fixed up for easy making.
26728 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26730 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26733 (unary_expression): Expand pre_increment_expression and
26734 post_decrement_expression to reduce a shift/reduce.
26736 2001-07-11 Simon Cozens
26738 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26740 Improve allow_keyword_as_indent name.
26742 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26744 * Adjustments for Beta2.
26746 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26748 * decl.cs: Added `Define' abstract method.
26749 (InTransit): new property, used to catch recursive definitions.
26751 * interface.cs: Implement `Define'.
26753 * modifiers.cs: Map Modifiers.constants to
26754 System.Reflection.TypeAttribute flags.
26756 * class.cs: Keep track of types and user-defined types.
26757 (BuilderInit): New method for creating an assembly
26758 (ResolveType): New function to launch the resolution process, only
26759 used by interfaces for now.
26761 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26762 that are inserted into the name space.
26764 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26766 * ARGH. I have screwed up my tree so many times due to the use of
26767 rsync rather than using CVS. Going to fix this at once.
26769 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26772 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26774 * Experiment successful: Use System.Type rather that our own
26777 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26779 * cs-parser.jay: Removed nsAliases from here.
26781 Use new namespaces, handle `using XXX;'
26783 * namespace.cs: Reimplemented namespace handling, use a recursive
26784 definition of the class. Now we can keep track of using clauses
26785 and catch invalid using clauses.
26787 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26789 * gen-treedump.cs: Adapted for all the renaming.
26791 * expression.cs (Expression): this class now has a Type property
26792 which returns an expression Type.
26794 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26795 `Type', as this has a different meaning now in the base
26797 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26799 * interface.cs, class.cs: Removed from all the sources the
26800 references to signature computation, as we can not do method
26801 signature computation during the parsing time, as we are not
26802 trying to solve at that point distinguishing:
26806 void a (NS.Blah x) {}
26809 Which depending on the context might be valid or not, as we do not
26810 know if Blah is the same thing as NS.Blah at that point.
26812 * Redid everything so the code uses TypeRefs now instead of
26813 Types. TypeRefs are just temporary type placeholders, that need
26814 to be resolved. They initially have a pointer to a string and the
26815 current scope in which they are used. This is used later by the
26816 compiler to resolve the reference to an actual Type.
26818 * DeclSpace is no longer a CIR.Type, and neither are
26819 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26820 are all DeclSpaces, but no Types.
26822 * type.cs (TypeRefManager): This implements the TypeRef manager,
26823 which keeps track of all the types that need to be resolved after
26824 the parsing has finished.
26826 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26828 * ARGH. We are going to have to store `foreach' as a class rather
26829 than resolving it, as we need to verify error 1579 after name
26830 resolution. *OR* we could keep a flag that says `This request to
26831 IEnumerator comes from a foreach statement' which we can then use
26832 to generate the error.
26834 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26836 * class.cs (TypeContainer.AddMethod): we now add methods to the
26837 MethodGroup instead of the method hashtable.
26839 * expression.cs: Add MethodGroup abstraction, which gets us one
26840 step closer to the specification in the way we handle method
26843 * cs-parser.jay (primary_expression): qualified_identifier now
26844 tried to match up an identifier to a local variable reference or
26845 to a parameter reference.
26847 current_local_parameters is now a parser global variable that
26848 points to the current parameters for the block, used during name
26851 (property_declaration): Now creates an implicit `value' argument to
26854 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26856 * parameter.cs: Do not use `param' arguments as part of the
26857 signature, per the spec.
26859 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26861 * decl.cs: Base class for classes, structs and interfaces. This
26862 is the "Declaration Space"
26864 * cs-parser.jay: Use CheckDef for checking declaration errors
26865 instead of having one on each function.
26867 * class.cs: Factor out some code for handling error handling in
26868 accordance to the "Declarations" section in the "Basic Concepts"
26869 chapter in the ECMA C# spec.
26871 * interface.cs: Make all interface member classes derive from
26872 InterfaceMemberBase.
26874 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26876 * Many things: all interfaces are parsed and generated in
26877 gen-treedump. Support for member variables, constructors,
26878 destructors, properties, constants is there.
26880 Beginning of the IL backend, but very little done, just there for
26883 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26885 * cs-parser.jay: Fix labeled statement.
26887 * cs-tokenizer.cs (escape): Escape " and ' always.
26888 ref_line, ref_name: keep track of the line/filename as instructed
26889 by #line by the compiler.
26892 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26894 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26895 to match the values in System.CodeDOM.
26897 Divid renamed to Divide.
26899 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26901 (Statements.set): remove.
26903 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26906 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26907 falseStatements always have valid values.
26909 * cs-parser.jay: Use System.CodeDOM now.