1 2007-04-12 Duncan Mak <duncan@a-chinaman.com>
3 * cs-parser.jay (interface_method_declaration_body): Fixed typo.
5 2007-04-08 Marek Safar <marek.safar@gmail.com>
7 * cs-parser.jay, linq.cs: First select implementation (hacky).
9 * generic.cs (InferTypeArguments): Simplified.
11 2007-03-31 Marek Safar <marek.safar@gmail.com>
13 * generic.cs (InferTypeArguments): Restored validation check.
14 (InferTypeArguments): Move all logic to Compatible method for re-usability.
16 2007-03-25 Marek Safar <marek.safar@gmail.com>
18 * generic.cs (InferTypeArguments): Infer arguments before they are used
19 for compatibility check.
21 2007-03-15 Marek Safar <marek.safar@gmail.com>
23 * generic.cs (InflatedConstraints): Fixed the check order.
24 (TypeArguments.Resolve): Small optimization for generic parameters.
25 (InferTypeArguments): Add infering support for anonymous methods.
27 2007-03-15 Martin Baulig <martin@ximian.com>
32 (TypeParameter.HasConstructorConstraint): Removed.
33 (ConstraintChecker.HasDefaultConstructor): Removed the
34 `TypeBuilder' argument here; correctly check for the ctor
35 constraint on type parameters.
37 2007-03-15 Martin Baulig <martin@ximian.com>
42 (TypeParameter): Create a `MemberCache' here as well. Note that
43 we need to create this on-demand when it's actually used.
45 2007-03-10 Marek Safar <marek.safar@gmail.com>
47 * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
49 2007-03-09 Raja R Harinath <rharinath@novell.com>
51 * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN. 'where'
52 is a valid keyword outside a linq expression too.
54 2007-03-03 Marek Safar <marek.safar@gmail.com>
56 * cs-parser.jay: Implemented basic linq grammar.
58 * linq.cs: New file for hosting query specific classes.
60 2007-02-26 Marek Safar <marek.safar@gmail.com>
62 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
64 2007-02-20 Marek Safar <marek.safar@gmail.com>
67 * cs-parser.jay: Anonymous container starts at constructor declaration
68 and not at block beginning because it has to be usable in constructor
71 2007-02-18 Marek Safar <marek.safar@gmail.com>
73 A fix for bug #80493 by Atsushi Enomoto
74 * cs-parser.jay: Ignore invalid attribute target.
76 2007-02-15 Miguel de Icaza <miguel@novell.com>
78 * Remove the call to SetExpression for lambda expressions, we do
81 Remove expression tracking code as its not needed.
83 2007-02-11 Miguel de Icaza <miguel@novell.com>
85 * cs-parser.jay (lambda_expression_body): when the body is an
86 expression add a statement of the form:
88 contextual-return expression.
90 Where `contextual-return' is similar to `return', the difference
91 being that if the delegate that the lambda will be converted to
92 has a void return type, it will check that the result is a
93 ExpressionStatement and the result is a plain ret (no return
94 values on the stack). If the return type of the delegate is of a
95 given type, this turns into a return with a value and does the
96 regular checking to check that the computed value can be
97 implicitly converted to the delegate return.
99 2007-01-30 Miguel de Icaza <miguel@novell.com>
101 * cs-parser.jay (anonymous_method_expression): move the
102 before/after productions to the start_anonymous and end_anonymous
103 methods so the code can be reused for lambda functions.
105 (lambda_expression_body): wrap expressions implicitly into a
108 (block): factor out the setup/teardown of parsing a block so we
109 can reuse that in lambda_expression_body
111 (lambda_expression): use new anonymous method helper methods.
113 2007-01-29 Miguel de Icaza <miguel@novell.com>
115 * cs-parser.jay: oob_stack make it static (am guessing that is why
116 we no longer initialize it anymore) and reuse it across
119 2007-01-28 Miguel de Icaza <miguel@novell.com>
121 * cs-parser.jay (open_parens): Introduce new non-terminal that
122 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
123 be returned in places where types are followed by identifiers
124 (this is expected in declaration, fixed, using, foreach and catch
127 Use open_parens in those places, keep OPEN_PARENS in the
130 cs-parser.jay: New grammar bits for parsing lambda expressions.
132 2007-01-28 Raja R Harinath <rharinath@novell.com>
134 Fix #80534, gtest-309.cs
135 * generic.cs (UnifyType): Rename from InferType. Make unification
136 of generic insts simpler and don't insist on inferring all generic
137 parameters in a single generic inst unification.
139 (InferGenericInstance): Remove.
140 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
142 2007-01-20 Marek Safar <marek.safar@gmail.com>
144 * cs-parser.jay: Better parameter error handling.
146 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
147 Raja R Harinath <rharinath@novell.com>
149 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
150 Note the order in which accessors are declared in the source.
152 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
154 * generic.cs (TypeParameter.FindMembers): Use the generic
155 constraints, not the constraints to check for methods (first fix
158 2006-12-30 Marek Safar <marek.safar@gmail.com>
160 * cs-parser.jay: Better syntax errors handling.
162 2006-11-21 Marek Safar <marek.safar@gmail.com>
164 * cs-parser.jay: Tiny change to work with mcs tokenizer.
166 * cs-tokenizer.cs: Remove after unification with mcs.
168 2006-10-28 Marek Safar <marek.safar@gmail.com>
171 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
174 2006-10-26 Marek Safar <marek.safar@gmail.com>
177 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
179 2006-10-25 Brian Crowell <brian@fluggo.com>
182 * generic.cs (CheckConstraints): Allow generic parameters with
183 inheritance constraints to satisfy reference type constraints.
185 2006-10-09 Martin Baulig <martin@ximian.com>
188 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
190 2006-09-25 Martin Baulig <martin@ximian.com>
192 * class.cs: Remove after unification with mcs source.
194 2006-09-24 Raja R Harinath <harinath@gmail.com>
196 * convert.cs: Remove after unification with mcs source.
198 2006-09-24 Marek Safar <marek.safar@seznam.cz>
200 * class.cs (MemberBase.VerifyClsCompliance): When method has type
201 parameters verify them as well.
203 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
204 the type parameter constraints.
205 (Generics.VerifyClsCompliance): Ditto.
207 2006-09-24 Marek Safar <marek.safar@seznam.cz>
209 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
210 for anonymous block with out argument.
212 2006-09-24 Marek Safar <marek.safar@seznam.cz>
214 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
215 not used private events only.
217 2006-09-23 Marek Safar <marek.safar@seznam.cz>
219 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
221 * cs-parser.jay: Parse correctly cast of default (T).
223 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
224 Store original type via EmptyConstantCast.
226 2006-09-22 Martin Baulig <martin@ximian.com>
228 * delegate.cs: Removed; this file is now shared with mcs.
230 * attribute.cs: Removed; this file is now shared with mcs.
232 2006-09-22 Martin Baulig <martin@ximian.com>
234 * ecore.cs: Removed; this file is now shared with mcs.
236 2006-09-21 Marek Safar <marek.safar@seznam.cz>
238 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
240 * ecore.cs (NullCast): Derives from NullConstant.
242 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
245 2006-09-21 Martin Baulig <martin@ximian.com>
247 * decl.cs: Removed; this file is now shared with mcs.
249 2006-09-21 Raja R Harinath <rharinath@novell.com>
251 * rootcontext.cs: Remove after unification with mcs source.
253 * report.cs: Remove after unification with mcs source.
254 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
256 (InitGenerics, CleanUpGenerics): Remove.
258 * support.cs: Remove after unification with mcs source.
260 2006-09-20 Raja R Harinath <rharinath@novell.com>
262 * codegen.cs: Remove after unification with mcs source.
264 2006-09-19 Martin Baulig <martin@ximian.com>
266 * expression.cs: Removed; this file is now shared with mcs.
268 2006-09-19 Martin Baulig <martin@ximian.com>
271 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
272 (TypeManager.DropGenericTypeArguments): Likewise.
273 (TypeManager.DropGenericMethodArguments): Likewise.
274 (TypeManager.GetTypeArguments): Likewise.
275 (TypeManager.HasGenericArguments): Likewise.
277 2006-09-19 Martin Baulig <martin@ximian.com>
279 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
281 2006-09-19 Martin Baulig <martin@ximian.com>
283 * typemanager.cs: Removed; this file is now shared with mcs.
285 2006-09-16 Raja R Harinath <rharinath@novell.com>
287 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
288 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
290 2006-09-16 Marek Safar <marek.safar@seznam.cz>
293 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
294 only if parent type is class.
295 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
298 2006-09-15 Marek Safar <marek.safar@seznam.cz>
301 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
303 * typemanager.cs(CSharpName): Converts NullType to null.
305 2006-09-15 Martin Baulig <martin@ximian.com>
307 * pending.cs: Removed; this file is now shared with mcs.
309 2006-09-15 Martin Baulig <martin@ximian.com>
311 * statement.cs: Removed; this file is now shared with mcs.
313 2006-09-15 Martin Baulig <martin@ximian.com>
315 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
317 * driver.cs: Removed the `--broken-cycles' argument.
319 2006-09-15 Martin Baulig <martin@ximian.com>
321 * namespace.cs: Removed; this file is now shared with mcs.
323 2006-09-15 Martin Baulig <martin@ximian.com>
325 * decl.cs (MemberName): Minor code cleanups.
327 2006-09-15 Martin Baulig <martin@ximian.com>
329 * parameter.cs: Removed; this file is now shared with mcs.
331 2006-09-15 Martin Baulig <martin@ximian.com>
333 * enum.cs: Removed; this file is now shared with mcs.
335 2006-09-15 Martin Baulig <martin@ximian.com>
337 * Makefile: Define `GMCS_SOURCE'.
339 * flowanalysis.cs: Removed; this file is now shared with mcs.
341 2006-09-15 Martin Baulig <martin@ximian.com>
343 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
344 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
345 doc.cs - they are now shared with mcs.
347 * gmcs.exe.sources: Include these files from ../mcs/.
349 2006-09-15 Martin Baulig <martin@ximian.com>
351 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
352 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
354 2006-09-14 Marek Safar <marek.safar@seznam.cz>
356 * assign.cs, ecore.cs, expression.cs: Share error message text.
357 * class.cs (FieldMember.Define): Check for variable of static type.
358 * decl.cs (check_type_parameter): Report correct type name.
359 * driver.cs (LoadAssembly): Uses error output for errors.
360 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
361 (TypeArguments.Resolve): Static class cannot be used as an argument.
362 * statement.cs (ResolveMeta): Constants cannot be generic types.
364 2006-09-12 Martin Baulig <martin@ximian.com>
366 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
368 * convert.cs (Convert.Array_To_IList): Moved here and correctly
369 implement it; fixes #79345.
371 2006-09-08 Marek Safar <marek.safar@seznam.cz>
373 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
375 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
377 * generic.cs: Improved error messages.
378 * typemanager.cs (RemoveGenericArity): Made public.
380 2006-09-08 Martin Baulig <martin@ximian.com>
382 * typemanager.cs (TypeManager.interlocked_type): New public field.
383 (TypeManager.int_interlocked_compare-exchange): New public field.
384 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
385 enumerator types here and call InitGenericCoreTypes().
386 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
387 after calling InitEnumUnderlyingTypes().
390 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
391 `classes_second_stage'.
393 2006-09-07 Marek Safar <marek.safar@seznam.cz>
395 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
397 * statement.cs (Block.Variables): Made public.
399 2006-09-07 Martin Baulig <martin@ximian.com>
402 (MainDriver): Revert r62663 from Marek; see #70506 for details.
404 2006-09-01 Martin Baulig <martin@ximian.com>
407 (TypeManager.IsIList): Also handle base classes and interfaces.
409 2006-09-01 Raja R Harinath <rharinath@novell.com>
412 * expression.cs (Invocation.MoreSpecific): Check for reference
415 2006-08-29 Miguel de Icaza <miguel@novell.com>
417 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
419 2006-08-17 Miguel de Icaza <miguel@novell.com>
421 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
422 #52019 and #79064, the use of the \uXXXX sequence in source code
423 to represent unicode characters.
425 2006-08-15 Marek Safar <marek.safar@seznam.cz>
427 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
429 * class.cs, ecore.cs, statement.cs: Merged to one error message.
431 2006-08-14 Raja R Harinath <rharinath@novell.com>
434 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
435 parameter too. This only avoids a parse error -- the semantic
436 error is caught elsewhere.
438 2006-08-13 Miguel de Icaza <miguel@novell.com>
440 * assign.cs: Catch attempts to assign to a method groups in += and
443 2006-08-13 Marek Safar <marek.safar@seznam.cz>
446 * cs-parser.jay: Don't destroy current array type by typeof of array's.
448 2006-08-12 Marek Safar <marek.safar@seznam.cz>
450 * cs-parser.jay: Check whether a constraint clause has already been
451 specified for type parameter.
452 * generic.cs (Constraints): Exposed location.
454 2006-08-12 Marek Safar <marek.safar@seznam.cz>
456 * class.cs (Method.Define): Issue a warning when generic method looks like
458 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
460 * report.cs: New warning number.
462 2006-08-09 Marek Safar <marek.safar@seznam.cz>
464 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
466 * decl.cs (MemberCache.FindMembers): When container is interface we need to
467 search all base interfaces as a member can be ambiguous.
468 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
469 Constructor member type filter.
470 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
471 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
472 reporting for returned memberinfos.
473 * report.cs: Updated.
474 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
475 version to work on all runtimes.
476 (TypeManager.RealMemberLookup): Removed members filtering.
478 2006-08-08 Raja R Harinath <rharinath@novell.com>
480 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
481 (PropertyExpr.EmitAssign): Likewise.
482 * expression.cs (Indirection.EmitAssign): Likewise.
483 (LocalVariableReference.EmitAssign): Likewise.
484 (ParameterReference.EmitAssign): Likewise.
485 (Invocation.EmitArguments): Likewise.
486 (ArrayAccess.EmitAssign): Likewise.
487 (IndexerAccess.EmitAssign): Likewise.
488 (This.EmitAssign): Likewise.
489 (ConditionalLogicalOperator.Emit): Likewise.
492 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
493 instead of ArrayList. If the hashtable has a LocalBuilder, don't
494 leave it in after returning it.
495 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
497 2006-08-06 Marek Safar <marek.safar@seznam.cz>
499 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
502 2006-08-05 Marek Safar <marek.safar@seznam.cz>
504 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
505 with different type names.
506 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
508 2006-08-03 Raja R Harinath <rharinath@novell.com>
510 Fix cs0146-3.cs and cs0146-4.cs.
511 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
512 enclosing types don't depend on the current type.
514 2006-08-02 Raja R Harinath <rharinath@novell.com>
517 * class.cs (TypeContainer.DoDefineMembers): Use
518 FindBaseMemberWithSameName on Parent, since we're interested in
519 whether we hide inherited members or not.
520 (FindBaseMemberWithSameName): Make slightly more robust.
523 * codegen.cs (IResolveContext.GenericDeclContainer): New.
524 (EmitContext): Implement new interface requirement.
525 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
526 * decl.cs (MemberCore): Likewise.
527 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
528 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
529 ec.GenericDeclContainer to check for generic parameters.
530 (SimpleName.DoSimpleNameResolve): Likewise.
531 * generic.cs (TypeParameter.DeclContainer): Remove override.
533 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
534 declspaces for doppelgangers too.
535 (UsingEntry): Implement IResolveContext.
536 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
537 'this' as the resolve context.
538 (LocalAliasEntry): Likewise.
540 Implement parts of #77403
541 * roottypes.cs (RootDeclSpace): New. Used to represent the
542 toplevel declaration space. Each namespace declaration introduces
543 a "partial" root declaretion space.
544 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
545 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
546 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
547 from 'current_namespace.SlaveDeclSpace'.
548 (namespace_declaration): Likewise.
549 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
550 check. It can't happen now.
551 * decl.cs (DeclSpace.LookupType): Likewise.
552 * driver.cs (MainDriver): Sanity check.
554 2006-08-01 Raja R Harinath <rharinath@novell.com>
556 * decl.cs (DeclSpace.FindNestedType): Remove.
557 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
558 LookupTypeContainer to get the container of the nested type.
559 * class.cs (TypeContainer.FindNestedType): Make non-override.
561 2006-07-31 Raja R Harinath <rharinath@novell.com>
563 * decl.cs (DeclSpace.PartialContainer): Move field from ...
564 * class.cs (TypeContainer.PartialContainer): ... here.
565 (TypeContainer.AddBasesForPart): New helper.
566 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
568 * cs-parser.jay (current_class): Convert to DeclSpace.
569 (struct_declaration, interface_declaration, class_declaration):
570 Use AddBasesForPart instead of .Bases directly.
571 * const.cs, iterators.cs: Update to changes.
573 2006-07-28 Raja R Harinath <rharinath@novell.com>
575 * class.cs (TypeContainer.AddMemberType): Rename from
577 (TypeContainer.AddMember): Rename from AddToMemberContainer.
578 (AddTypeContainer): New. Combine AddClassOrStruct and
580 (AddPartial): Update. Add 'is_partial' argument.
581 * roottypes.cs: Update to changes.
582 * cs-parser.jay (push_current_class): New helper for handling
583 current_container and current_class.
584 (struct_declaration, interface_declaration, class_declaration):
587 2006-07-26 Raja R Harinath <rharinath@novell.com>
589 * roottypes.cs: Rename from tree.cs.
591 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
592 * tree.cs (Tree, ITreeDump): Remove types.
593 * rootcontext.cs (tree, Tree): Remove fields.
594 (root, ToplevelTypes): New.
595 * *.cs: Update to rename.
597 * tree.cs (Tree.RecordDecl): Remove.
598 (RootTypes.AddToTypeContainer): Record the toplevel type in its
600 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
602 2006-07-23 Raja R Harinath <harinath@gmail.com>
604 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
605 DoFlowAnalysis and OmitStructFlowAnalysis here.
606 (ec.With): Rename from WithUnsafe and generalize.
607 (ec.WithCheckState): Remove. All users can be handled by 'With'.
608 (ec.WithFlowAnalyis): New.
609 * ecore.cs, expression.cs, statement.cs: Update.
611 2006-07-22 Raja R Harinath <harinath@gmail.com>
613 * statement.cs (Block.ResolveMeta): Simplify slightly.
615 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
616 multiple boolean fields. Convert InUnsafe, constant_check_state,
617 check_state to flags.
618 (CheckState, ConstantCheckState): Update.
619 (InUnsafe): New read-only property.
620 (FlagsHandle): Rename from CheckStateHandle and convert to handle
622 (WithUnsafe): New helper similar to WithCheckState.
623 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
624 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
626 2006-07-21 Raja R Harinath <rharinath@novell.com>
628 Make comparisons use the same IL irrespective of whether they're
629 in a 'checked' or 'unchecked' context: one of the issues in #78899
630 * codegen.cs (EmitContext.CheckState): Make read-only property.
631 (EmitContext.ConstantCheckState): Likewise.
632 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
633 helper that implement a save/restore stack for CheckState
634 values. This is the only way to change check-state.
635 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
636 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
637 (CheckedExpr.EmitBranchable): New forwarding method.
638 (UnCheckedExpr): Likewise.
639 * statement.cs (Block.ResolveMeta): Use WithCheckState.
640 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
641 (Checked.Resolve, checked.DoEmit): Likewise.
643 2006-07-21 Martin Baulig <martin@ximian.com>
645 * generic.cs (TypeManager.InferType): When inferring an array
646 type, also allow IList<T> and ICollection<T>. Fixes #78900.
648 2006-07-21 Martin Baulig <martin@ximian.com>
650 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
651 and allow IList`1 and all its base interfaces.
653 * convert.cs (Convert.ImplicitReferenceConversion): Allow
654 converting from an array-type of T to IList<T>.
656 2006-07-21 Martin Baulig <martin@ximian.com>
658 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
660 2006-07-20 Miguel de Icaza <miguel@novell.com>
662 * anonymous.cs: Cache the resolved anonymous delegate, and return
663 this so that the ResolveTopBlock is only triggered once, not
666 Currently we trigger ResolvetopBlock twice due to a first pass of
667 argument check compatibility, and a second pass that does the
670 2006-07-15 Marek Safar <marek.safar@seznam.cz>
672 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
674 * rootcontext.cs (Reset): Add helper_classes.
676 2006-07-15 Marek Safar <marek.safar@seznam.cz>
679 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
682 2006-07-13 Miguel de Icaza <miguel@novell.com>
684 * statement.cs (Lock): Handle expressions of type
685 TypeManager.null_type specially. Fixes #78770
687 2006-07-08 Marek Safar <marek.safar@seznam.cz>
689 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
692 2006-07-08 Marek Safar <marek.safar@seznam.cz>
694 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
695 for accessors as well.
696 * ecore.cs (EventExpr): Add AccessorTable.
698 2006-07-03 Martin Baulig <martin@ximian.com>
700 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
701 instances of value types.
703 * convert.cs (Convert.ExplicitConversion): Correctly handle
704 object->nullable conversions.
706 2006-07-01 Marek Safar <marek.safar@seznam.cz>
709 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
710 for CS0122 where appropriate.
711 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
713 (Filter): Assembly can be null in the case of top level attributes.
715 2006-06-28 Raja R Harinath <rharinath@novell.com>
718 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
719 no arguments, return 'false': nothing can be inferred.
721 2006-06-25 Marek Safar <marek.safar@seznam.cz>
725 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
726 is done at global level.
728 2006-06-24 Marek Safar <marek.safar@seznam.cz>
730 A fix for #77002, Implemented TypeForwarder support.
732 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
733 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
735 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
736 * typemanager.cs (): Add type_forwarder_attr_type.
738 2006-06-24 Marek Safar <marek.safar@seznam.cz>
740 * report.cs: Add CS0469 warning.
742 2006-06-22 Martin Baulig <martin@ximian.com>
745 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
746 for interfaces; fixes #78686, which is a modification of #78380
747 with interfaces instead of classes.
749 2006-06-21 Martin Baulig <martin@ximian.com>
751 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
752 the `try'-block, so we also report CS0016 etc. there.
754 2006-06-21 Martin Baulig <martin@ximian.com>
756 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
757 handle SetAssigned() and SetMemberIsUsed() for generic types;
760 2006-06-21 Martin Baulig <martin@ximian.com>
763 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
765 2006-06-21 Martin Baulig <martin@ximian.com>
767 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
768 also report CS1686 for parameters.
770 2006-06-21 Martin Baulig <martin@ximian.com>
772 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
773 instead of an error if the value is not implicitly convertible to
774 the switch types; fixes #77964.
776 2006-06-21 Raja R Harinath <rharinath@novell.com>
779 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
780 FieldBuilder is null.
783 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
784 'left' and 'right' before error-checking.
786 2006-06-19 Martin Baulig <martin@ximian.com>
789 (Convert.ImplicitConversionStandard): Cleanup and correctly
790 implement nullable conversions.
791 (Convert.ImplicitStandardConversionExists): Likewise.
792 (Convert.ExplicitConversion): Likewise.
794 2006-06-19 Martin Baulig <martin@ximian.com>
797 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
798 methods; make the ctors protected.
800 2006-06-19 Martin Baulig <martin@ximian.com>
802 Fixed #78380; added gtest-273.cs.
805 (Expression.ResolveAsBaseTerminal): Move the constraint checking
806 into ResolveAsTypeTerminal().
809 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
810 TypeManager.FindMembers() to check for the default ctor.
812 2006-06-18 Marek Safar <marek.safar@seznam.cz>
814 * generic.cs: Fixed NullableInfo accessibility.
816 2006-06-16 Martin Baulig <martin@ximian.com>
819 (Constraints.InflatedConstraints.inflate): Correctly inflate
820 generic types; fixes #78400.
822 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
824 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
826 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
827 (FieldExpr.DoResolve): likewise.
828 (PropertyExpr.InstanceResolve): likewise.
829 (EventExpr.InstanceResolve): likewise.
831 2006-06-15 Martin Baulig <martin@ximian.com>
834 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
835 argument; always allow a `null' label if true.
836 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
837 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
838 we have a `null' label and mark the new `null_target' label;
839 default to the `default' label.
840 (Switch.Resolve): Add support for nullable types. Fixes #78630.
842 2006-06-15 Martin Baulig <martin@ximian.com>
844 * class.cs (Operator.Define): Allow an implicit/explicit operator
845 to convert to/from a nullable value of the enclosing type.
847 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
848 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
851 (Convert.ImplicitStandardConversionExists): Add support for lifted
852 implicit/explicit conversions.
853 (Convert.ImplicitConversionStandard): Likewise.
855 2006-06-13 Martin Baulig <martin@ximian.com>
857 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
858 type arguments and create a ConstructedType if necessary. Fixes #78400.
860 2006-06-04 Marek Safar <marek.safar@seznam.cz>
862 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
863 attribute applicable tests for attribute argument.
865 2006-06-02 Raja R Harinath <rharinath@novell.com>
868 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
869 (Binary.OverloadResolve_PredefinedIntegral): New.
870 (Binary.OverloadResolve_PredefinedFloating): New.
871 (Binary.OverloadResolve_PredefinedString): New.
872 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
873 Follow the standard more closely, and treat numeric promotions in
874 terms of overload resolution.
875 (Binary.CheckShiftArguments): Simplify.
877 2006-06-01 Raja R Harinath <rharinath@novell.com>
879 * flowanalysis.cs (MyBitVector): Simplify representation.
880 (MyBitVector.Clone): Avoid allocating BitArray.
881 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
882 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
883 (*): Update. Change all references to MyBitVector.And and
884 MyBitVector.Or to &= and |=.
886 2006-05-31 Raja R Harinath <rharinath@novell.com>
888 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
889 Use bne.un instead of ceq+brfalse.
892 * typemanager.cs (IsUnmanagedType): Disallow generic types and
895 2006-05-29 Raja R Harinath <rharinath@novell.com>
898 * cs-parser.jay (formal_parameter_list): Extend the pattern below
899 to param arguments too.
901 2006-05-26 Miguel de Icaza <miguel@novell.com>
903 * cs-parser.jay: Catch another parsing form for arglist being
904 followed by other arguments. Fixes #78313.
906 2006-05-25 Raja R Harinath <rharinath@novell.com>
909 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
910 also when one of the operands is a null literal.
911 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
912 to improve clarity, and generate slightly better code.
914 2006-05-24 Raja R Harinath <rharinath@novell.com>
916 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
917 checking of out parameters to ...
918 (FlowBranchingToplevel.Merge): ... here.
919 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
920 set, propagate the origin upward, and only complain if there was
922 (FlowBranchingException.AddContinueOrigin): Likewise.
923 (FlowBranchingException.AddReturnOrigin): Likewise.
924 (FlowBranchingException.AddGotoOrigin): Likewise.
926 2006-05-23 Raja R Harinath <rharinath@novell.com>
928 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
929 unreachable, skip it.
930 (FlowBranchingException.Merge): Always propagate jumps, even if
931 the finally block renders subsequent code unreachable.
933 2006-05-18 Raja R Harinath <rharinath@novell.com>
936 * statement.cs (Goto.Resolve): Move responsibility for resolving
937 'goto' to FlowBranching.AddGotoOrigin.
938 (Goto.SetResolvedTarget): New. Callback to set the
939 LabeledStatement that's the target of the goto.
940 (Goto.DoEmit): Use Leave instead of Br when crossing an
941 unwind-protect boundary.
942 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
943 LookupLabel and adjust to new semantics.
944 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
945 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
946 Goto.SetResolvedTarget to update target.
947 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
948 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
949 AddBreakOrigin & co. Delay propagation until ...
950 (FlowBranchingException.Merge): ... this.
952 * statement.cs (Block.Resolve): Always depend on flow-branching to
953 determine unreachability. Kill workaround that originally emitted
954 only one statement after an "unreachable" label (see infloop in
957 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
958 This is still "wrong", but anything better would probably need a
959 multi-pass algorithm.
960 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
961 usage vector. Force current usage vector to be reachable, to
962 optimistically signify backward jumps.
963 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
965 (FlowBranchingLabeled.Merge): New. If no backward jump was
966 detected, return the original salted-away usage vector instead,
967 updated with appropriate changes. Print unreachable warning if
969 * statement.cs (Block.Resolve): Don't print unreachable warning on
972 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
974 * driver.cs: Pass filename without path to AssemblyBuilder's
975 AddResourceFile. Fixes bug #78407.
977 2006-05-17 Raja R Harinath <rharinath@novell.com>
979 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
980 * flowanalysis.cs (FlowBranchingLabeled): ... here.
981 (FlowBranching.MergeChild): Overwrite
982 reachability information from Labeled branchings too.
984 2006-05-16 Raja R Harinath <rharinath@novell.com>
986 * statement.cs (Goto.Resolve): Merge jump origins here ...
987 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
989 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
990 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
991 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
992 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
994 * statement.cs (Goto.Resolve): ... not here.
995 (Goto.Emit): Remove CS1632 check.
997 2006-05-14 Marek Safar <marek.safar@seznam.cz>
999 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1002 2006-05-11 Raja R Harinath <rharinath@novell.com>
1004 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1005 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1006 (FlowBranchingException.Label): Likewise.
1008 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1010 (MyBitVector.Or): Use it to avoid losing information (Count).
1011 (FlowBranching.MergeOrigins): Likewise.
1013 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1014 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1015 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1016 (UsageVector.ToString): Simplify.
1017 (UsageVector.MergeSiblings): Move here from ...
1018 (FlowBranching.Merge): ... here.
1019 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1022 2006-05-10 Raja R Harinath <rharinath@novell.com>
1024 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1025 null bitvector is treated as all-true.
1027 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1028 (MyBitVector): Rationalize invariants. 'vector != null' implies
1029 that we have our own copy of the bitvector. Otherwise,
1030 'InheritsFrom == null' implies all inherited bits are true.
1032 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1034 * statement.cs (LocalInfo): Add IsConstant.
1035 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1036 local variable for constants.
1038 2006-05-09 Raja R Harinath <rharinath@novell.com>
1040 * flowanalysis.cs (MyBitVector.Empty): New.
1041 (MyBitVector): Don't allow InheritedFrom to be null.
1042 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1043 (UsageVector, FlowBranching): Update to changes.
1045 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1046 recursion. The 'Parent == null' condition isn't sufficient for
1048 (FlowBranching.AddBreakOrigin): Likewise.
1049 (FlowBranching.AddContinueOrigin): Likewise.
1050 (FlowBranching.AddReturnOrigin): Likewise.
1051 (FlowBranching.StealFinallyClauses): Likewise.
1052 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1053 (FlowBranching.CheckOutParameters): Likewise.
1054 (FlowBranchingToplevel): Terminate all the above recursions here.
1055 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1056 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1058 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1060 (FlowBranchingToplevel): New. Empty for now.
1061 (FlowBranching.MergeTopBlock): Update.
1062 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1063 branching for the anonymous delegate.
1064 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1066 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1067 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1068 information at the start of the merge. Reorganize.
1070 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1072 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1074 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1076 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1077 to newly introduced ctor.
1079 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1080 message to one place.
1081 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1084 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1086 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1088 * ecore.cs (Expression.ResolveAsConstant): Updated.
1090 * statement.cs (ResolveMeta): Updated.
1092 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1094 * cs-parser.jay: __arglist cannot be used in initializer.
1096 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1099 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1102 2006-05-05 Raja R Harinath <rharinath@novell.com>
1104 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1105 (LabeledStatement): Add 'name' parameter.
1106 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1107 (Block.AddLabel): Update to changes.
1108 * cs-parser.jay (labeled_statement): Likewise.
1110 * flowanalysis.cs (BranchingType.Labeled): New.
1111 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1112 (FlowBranchingLabeled): New. Does nothing for now, but will
1113 eventually handle 'goto' flows.
1114 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1115 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1116 that's terminated ...
1117 (Block.Resolve): ... here.
1119 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1120 (UsageVector.MergeFinallyOrigins): Likewise.
1121 (FlowBranching.InTryOrCatch): Likewise.
1122 (FlowBranching.AddFinallyVector): Likewise.
1123 (FlowBranchingException): Update to changes.
1126 * statement.cs (Return.Resolve): Move error checking to ...
1127 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1128 (FlowBranchingException): Handle return origins like break and
1130 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1132 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1135 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1138 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1141 * class.cs (MethodData.Define): Do public accessor check only when method
1142 implements an interface.
1144 2006-05-04 Raja R Harinath <rharinath@novell.com>
1146 Remove special handling of 'break'
1147 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1148 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1149 (UsageVector.Break): Remove.
1150 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1152 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1154 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1155 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1157 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1160 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1161 be the interface member.
1163 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1166 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1167 for emitting small (int) values.
1169 2006-05-03 Raja R Harinath <rharinath@novell.com>
1172 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1173 control-flow passes through the 'finally' after merging-in all the
1174 control-flows from 'try' and the 'catch' clauses.
1176 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1177 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1178 always true at the only non-recursive entry point.
1179 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1180 FlowBranchingBreakable.
1181 (FlowBranchingLoop): Remove.
1182 * statement.cs (Return.DoResolve): Update to changes.
1185 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1186 (FlowBranching.CreateBranching): Handle it: create a
1187 FlowBranchingContinuable.
1188 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1189 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1190 except that it handles the 'continue' command.
1191 (FlowBranching.UsageVector.MergeOrigins): Rename from
1193 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1194 except that it overrides AddContinueOrigin.
1195 (FlowBranchingException): Override AddContinueOrigin, similar to
1197 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1198 Create a new branching around the embedded statement.
1199 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1200 control flow after the embedded statement.
1201 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1203 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1204 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1205 FlowBranchingBreakable.
1206 (FlowBranchingSwitch): Remove.
1209 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1210 error reporting to ...
1211 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1212 Rename from 'AddBreakVector'. Add new location argument. Return
1213 a bool indicating whether the 'break' crosses an unwind-protect.
1214 (FlowBranchingException.AddBreakOrigin): Add.
1215 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1216 flowbranching after updating with the effects of the 'finally'
1218 (FlowBranchingBreakable): New common base class for
1219 FlowBranchingLoop and FlowBranchingSwitch.
1221 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1223 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1225 2006-05-02 Raja R Harinath <rharinath@novell.com>
1227 * statement.cs (Do.Resolve): If the loop is infinite, set the
1229 (While.Resolve, For.Resolve): Set a barrier after the embedded
1230 statement. There's no direct control flow that goes from the end
1231 of the embedded statement to the end of the loop.
1232 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1233 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1234 above ensure that the reachability is correctly computed.
1236 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1237 (UsageVector.MergeBreakOrigins): If the current path is
1238 unreachable, treat it as if all parameters/locals are initialized.
1239 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1240 infinite loops before merging-in break origins.
1242 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1243 (Reachability.Reachable): Split part into ...
1244 (Reachability.Unreachable): ... this. Simplify.
1245 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1247 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1248 (Reachability.SetThrowsSometimes): Likewise.
1249 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1250 TriState.Always, use corresponding property.
1251 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1252 (Block.Resolve): Likewise. Remove some redundant checks.
1254 2006-05-02 Raja R Harinath <harinath@gmail.com>
1256 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1257 (Reachability.Meet): Don't bother checking AlwaysThrows --
1258 barrier is always set.
1259 (FlowBranchingBlock.Merge): Likewise.
1261 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1263 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1264 defined, so it's references should also compile only for NET_2_0
1265 (as occurs in mcs version)
1267 2006-05-01 Raja R Harinath <harinath@gmail.com>
1269 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1270 checks for unreachable.
1272 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1275 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1277 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1278 whether field is really assigned.
1280 2006-04-30 Raja R Harinath <harinath@gmail.com>
1282 * flowanalysis.cs (Reachability): Make 4-argument constructor
1284 (Reachability.Meet): Rename from 'And'. Remove static variant.
1285 (Reachability.Always): Rename from the highly misleading
1286 'Reachability.Never'.
1287 (FlowBranching.Merge): Update to changes. Mark an impossible
1288 situation with a 'throw'.
1289 (*): Update to changes.
1291 2006-04-29 Raja R Harinath <harinath@gmail.com>
1293 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1295 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1296 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1297 (*): Update to changes.
1298 * statement.cs: Update to changes.
1300 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1303 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1305 2006-04-28 Raja R Harinath <harinath@gmail.com>
1307 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1310 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1311 argument to two arguments: an usage-vector and a bool. Move call
1312 to FlowBranching.Merge () ...
1313 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1315 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1316 handling of loop and switch reachability to ...
1317 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1319 2006-04-27 Raja R Harinath <harinath@gmail.com>
1321 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1322 handling to FlowBranchingLoop.InLoop.
1323 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1325 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1328 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1329 anonymous method is allowed from AnonymousContainer here.
1331 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1333 2006-04-24 Raja R Harinath <rharinath@novell.com>
1336 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1338 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1341 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1342 (DoubleConstant.Reduce): Ditto.
1344 2006-04-23 Raja R Harinath <rharinath@novell.com>
1346 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1347 Remove 'lvalue_right_side' argument. Move parts to ...
1348 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1349 (LocalVariable.DoResolveLValue): ... these.
1351 2006-04-21 Raja R Harinath <rharinath@novell.com>
1354 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1355 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1356 (LocalVariableReference.DoResolveBase): Use it to implement new
1358 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1359 (Argument.Resolve): Simplify. Move CS1510 check ...
1360 * ecore.cs (Expression.ResolveLValue): ... here.
1361 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1362 (PropertyExpr.DoResolveLValue): Likewise.
1363 (FieldExpr.Report_AssignToReadonly): Likewise.
1364 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1365 LValueMemberAccess or LValueMemberOutAccess on instance depending
1367 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1368 DoResolve as appropriate.
1370 2006-04-20 Raja R Harinath <rharinath@novell.com>
1373 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1374 implicit conversions on 'out' and 'ref' arguments.
1376 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1377 improve clarity. Remove dead code.
1380 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1381 (Catch.Resolve): Resolve VarBlock if it exists.
1383 2006-04-19 Miguel de Icaza <miguel@novell.com>
1385 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1386 twice, this was some residual code, the enumerator was emitted
1387 properly in the two branche of if later.
1391 Thanks to Martin for finding the source of the problem
1393 2006-04-19 Raja R Harinath <rharinath@novell.com>
1395 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1396 cast is never an lvalue.
1397 (Cast.DoResolve, Cast.ResolveRest): Combine.
1398 (Argument.Emit): Simplify slightly. Move 'Expr is
1399 IMemoryLocation' check ...
1400 (Argument.Resolve): ... here.
1401 (Argument.Error_LValueRequired): Remove. Inline into only user.
1403 Simplifications. Fix cs0191-2.cs
1404 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1405 CS1649 and CS1651 to ...
1406 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1407 the actual selection of the error code and message to a lookup
1408 table. Add a dummy return value to simplify callsites.
1409 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1410 readonly fields of other instances of the same type. Move CS0197
1412 * expression.cs (Argument.Resolve): ... here. Simplify code.
1413 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1414 resolution of an out or ref argument. The code simplification
1415 above uses this invariant.
1417 2006-04-18 Raja R Harinath <rharinath@novell.com>
1419 Possibly fix #77752. Fix cs1690-[4-7].cs.
1420 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1421 CheckMarshallByRefAccess. Drop parameter.
1422 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1424 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1426 * report.cs (AllWarnings): Add CS1690.
1427 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1429 (LocalVariableReference.DoResolveBase): Update.
1431 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1433 * class.cs (MethodOrOperator): Moved common parts from method class.
1434 detect obsolete attributes.
1435 (Method.Define): Simplified as it reuses code from base.
1436 (Constructor.ValidAttributeTargets): Fixed issue found during
1438 (Destructor.ValidAttributeTargets): Fixed issue found during
1440 (Operator): Finished refactoring set off by #78020. Operator class is now
1441 ordinary method class.
1443 * anonymous.cs: Updated.
1445 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1447 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1449 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1451 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1452 detect obsolete attributes.
1453 (Method.CreateEmitContext): Moved to MethodOrOperator.
1455 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1458 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1459 customized exception to make crash detection easier.
1460 (MethodOrOperator): Started to work on new base class for methods and
1462 (Method): Derives from MethodOrOperator.
1463 (Constructor.Emit): Emits its own attributes.
1464 (AbstractPropertyEventMethod.Emit): Ditto.
1465 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1467 (Operator.Emit): It's temporary more tricky than should be.
1469 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1471 * report.cs (InternalErrorException): Add ctor with inner exception.
1473 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1476 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1479 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1482 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1485 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1487 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1488 attribute is present and Guid not.
1489 (Interface.ApplyAttributeBuilder): Ditto.
1491 * attribute.cs: Add error message.
1493 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1497 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1498 sources (it's composite) so hold them in extra array as they are used in
1499 Emit phase only. It worked in the previous versions by mistake.
1500 (Attribute.Emit): Emit attribute for more owners when exist.
1502 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1503 it has now different behaviour.
1505 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1507 * constant.cs (Constant.IsDefaultInitializer): New method.
1509 * class.cs: Updated.
1511 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1512 re-initialize default values. It saves KBs almost for every assembly.
1513 Thanks Zoltan for the idea.
1514 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1515 (ArrayCreation.DoResolve): Resolve only once.
1516 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1517 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1519 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1521 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1524 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1526 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1527 in an embedded statement too.
1529 2006-04-01 Raja R Harinath <rharinath@novell.com>
1532 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1536 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1539 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1540 arguments before checking whether a type is reflected or not.
1543 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1544 definition doesn't take part in overload resolution.
1545 (Invocation.IsParamsMethodApplicable): Likewise.
1546 (Invocation.OverloadResolve): When replacing a reflected override
1547 method with its base definition, ensure that type arguments are
1550 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1554 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1557 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1559 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1561 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1564 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1565 LocalTemporary change.
1567 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1569 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1570 initializers optimization.
1571 (ClassOrStruct.TypeAttr): Moved from modifiers.
1572 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1573 (FieldBase.ResolveInitializer): Resolves initializer.
1574 (FieldBase.HasDefaultInitializer): New property.
1576 * cs-parser.jay: Removed message.
1578 * expression.cs (CompilerGeneratedThis): New specialization.
1580 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1582 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1584 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1586 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1588 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1589 be now EnumConstants only.
1591 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1593 * attribute.cs, driver.cs: Reset more caches.
1595 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1597 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1599 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1601 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1602 for easier reuse. Updated all overrides.
1603 (IntegralConstant): New base class for all integral constants.
1604 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1605 of the constant range, report custom error.
1606 (UIntConstant.Reduce): Fixed uint conversion.
1608 * ecore.cs, literal.cs: Reduce updates.
1610 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1614 * class.cs (Constructor.Define): Removed extra if for default ctors.
1615 A patch from Atsushi Enomoto.
1617 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1619 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1620 GetAttributableValue.
1622 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1625 * convert.cs (ImplicitConversionRequired): Error message moved to
1628 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1629 automatic implicit conversion of an output value.
1630 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1632 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1634 (TypeOf.GetAttributableValue): Add extra handling for object type.
1636 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1637 special error message.
1639 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1641 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1643 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1644 compatible with MS runtime.
1646 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1648 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1649 attribute arguments here.
1651 * class.cs (Indexer.Define): The check was moved to attribute class.
1653 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1655 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1657 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1659 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1661 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1664 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1666 * doc-bootstrap.cs : fix build.
1668 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1670 * expression.cs (StringConcat.Append): Issue a warning when empty string
1673 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1675 * assign.cs (CompoundAssign.ResolveSource): Removed.
1677 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1680 * class.cs (TypeContainer.FindMethods): Removed.
1681 (TypeContainer.CheckMemberUsage): Made static.
1683 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1685 * constant.cs (CheckRange): Removed unused type argument.
1686 (CheckUnsigned): Removed unused type argument.
1688 * cs-parser.jay: Updated after MemberAccess clean up.
1689 Uses Length for empty string test.
1691 * cs-tokenizer.cs: Uses Length for empty string test.
1692 (IsCastToken): Made static.
1693 (is_hex): Made static.
1694 (real_type_suffix): Made static.
1696 * decl.cs (SetupCache): Made static.
1697 (OnGenerateDocComment): Removed unused ds argument.
1699 * delegate.cs (VerifyDelegate): Removed unused argument.
1701 * doc.cs: Uses Length for empty string test.
1703 * driver.cs: Uses Length for empty string test.
1705 * enum.cs (IsValidEnumType): Made static
1707 * expression.cs (EnumLiftUp): Removed unused argument.
1708 (ResolveMethodGroup): Ditto.
1709 (BetterConversion): Ditto.
1710 (GetVarargsTypes): Ditto.
1711 (UpdateIndices): Ditto.
1712 (ValidateInitializers): Ditto.
1713 (MemberAccess.ctor): Ditto.
1714 (GetIndexersForType): Ditto.
1716 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1718 * iterators.cs: Updated after MemberAccess clean up.
1720 * location.cs: Uses Length for empty string test.
1722 * namespace.cs: Uses Length for empty string test.
1724 * report.cs (CheckWarningCode): Made static.
1726 * statement.cs (LabeledStatement): Removed unused argument.
1728 * typemanager.cs (FilterNone): Removed.
1730 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1732 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1735 * class.cs: Updated.
1737 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1739 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1741 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1745 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1747 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1748 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1749 Add more error reporting; Fixed issue with params.
1751 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1753 * cs-parser.jay: AnonymousMethod requires host container.
1755 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1757 2006-03-18 Raja R Harinath <harinath@gmail.com>
1759 * class.cs: Change 'TypeContainer ds' constructor argument to
1760 'DeclSpace parent'. Some classes were missed below due to
1761 different naming convention.
1763 * class.cs (MemberCore.Parent): Delete. This makes the
1764 ParentContainer changes below enforceable by the compiler.
1766 Treat pointers to enclosing declaration space as 'DeclSpace', not
1768 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1769 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1771 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1773 (Block.AddThisVariable): Likewise.
1774 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1775 (AbstractPropertyEventMethod.Emit): Likewise.
1776 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1777 (GetMethod.Define, SetMethod.Define): Likewise.
1778 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1779 (DelegateMethod.EmitMethod): Likewise.
1781 Fix regression test-partial-13.cs.
1782 Rationalize use of PartialContainer. Ensure that the partial
1783 class semantics can be tied to type-correctness, i.e., any
1784 violation will cause a compile error.
1785 * class.cs, const.cs: Access all fields that belong to class
1786 TypeContainer via ParentContainer. Arguments of EmitContexts and
1787 Resolve()-like functions still use 'Parent'.
1789 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1790 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1791 (PropertyMethod.CheckModifiers): Remove unused argument.
1792 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1795 2006-03-28 Raja R Harinath <rharinath@novell.com>
1797 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1799 2006-03-17 Raja R Harinath <harinath@gmail.com>
1801 Make semantics of PartialContainer simpler.
1802 * decl.cs (DeclSpace.IsPartial): Remove.
1803 * class.cs (TypeContainer.IsPartial): Likewise.
1804 (TypeContainer..ctor): Set PartialContainer to point to self.
1805 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1806 (TypeContainer.FindNestedType): Likewise.
1807 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1809 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1811 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1813 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1815 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1818 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1820 * class.cs (Operator.Define): An error for base conversion was not
1823 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1825 A fix for #77593, #77574.
1827 * class.cs (MethodCore.CheckBase): Another if for operator.
1829 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1833 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1834 reporting, it's more tricky than I thought.
1836 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1838 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1841 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1842 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1845 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1848 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1852 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1853 (Event.Define): ditto
1854 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1856 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1857 Removed redundant code and set NewSlot for Invoke method too.
1859 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1860 (Parameters.MergeGenerated): New method. Use this method when you merge
1861 compiler generated argument with user arguments.
1863 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1865 * attribute.cs (ResolveAsTypeTerminal): Removed.
1867 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1868 specialization for predefined types; 30% speed up.
1869 Finally placed obsolete check to right place.
1870 (Expression.ResolveType): Removed.
1872 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1873 Updated after ResolveType was removed.
1875 * expression.cs (Cast.ctor): Check void cast.
1876 (Binary.ResolveAsTypeTerminal): Is never type.
1877 (Conditional.ResolveAsTypeTerminal): Is never type.
1879 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1881 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1883 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1885 2006-03-23 Martin Baulig <martin@ximian.com>
1887 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1888 type check if either of the types is an open generic type.
1890 2006-03-23 Martin Baulig <martin@ximian.com>
1893 (Convert.ExplicitTypeParameterConversion): New method; implement
1894 explicit type parameter conversions.
1896 2006-03-23 Martin Baulig <martin@ximian.com>
1898 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1899 blindly allow all conversions if we do not have any constraints.
1901 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1903 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1904 these two separated members to simplify the code.
1905 (Attribute.Resolve): Refactored to use new fields and methods.
1906 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1907 implemented obsolete attribute checking.
1908 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1909 implemented obsolete checking again. It look line never ending quest ;-)
1910 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1912 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1914 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1916 *class.cs (Property.Define): Add RegisterProperty call.
1918 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1919 argument groups (only 2).
1921 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1922 encoding expression to arguments.
1923 (Expression.ExprClassToResolveFlags): Just turned to property.
1925 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1926 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1927 optimized as well as implemented support for zero-length attributes.
1929 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1930 Add caching of PropertyInfo's.
1932 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1934 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1935 error multiple times.
1937 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1939 New partial class implementation.
1940 A fix for #77027, #77029, #77403
1942 * attribute.cs (Attributable): Made attributes protected.
1944 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1945 the replacements of ClassPart and PartialContainer.
1946 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1947 (TypeContainer.AddInterface): Ditto.
1948 (TypeContainer.AddPartial): The main method for partial classes. It checks
1949 for errors and merges ModFlags and attributes. At the end class is added to
1951 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1953 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1954 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1955 from the rest of partial classes.
1956 (TypeContainer.GetClassBases): Simplified.
1957 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1959 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1960 (TypeContainer.HasExplicitLayout): Uses Flags now.
1961 (PartialContainer): Removed.
1962 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1963 (StaticClass): Was merged with Class.
1964 (Class.GetClassBases): class and static class bases are verified here.
1965 (Class.TypeAttr): Added static attributes when class is static.
1966 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1967 (MemberBase): In some cases we need to call parent container for partial
1968 class. It should be eliminated but it's not easy now.
1970 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1972 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1973 partial classed to accumulate class comments.
1974 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1976 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1978 * driver.cs (MainDriver): Tree.GetDecl was removed.
1980 * modifiers.cs (Modifiers): Add partial modifier.
1982 * tree.cs (Tree.decl): Removed.
1983 (RootTypes): Started to use this class more often for root types
1986 2006-03-23 Raja R Harinath <rharinath@novell.com>
1988 * generic.cs (TypeParameter.UpdateConstraints): Update
1989 'constraints' if null.
1991 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1995 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1996 external interface does not have an attribute.
1998 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2000 Another prerequisites for new partial classs implementation.
2002 * attribute.cs (Attribute.Equal): Implemented.
2003 (Attribute.Emit): Changed as attributes can be applied more than twice.
2004 (Attributes.Emit): Check for duplicate attributes here.
2006 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2007 as a parameter, clean-up.
2009 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2013 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2014 contains obsolete attribute check which can in some cases look for base
2015 type of current class which is not initialized yet.
2016 (TypeContainer.BaseType): Replacement of ptype.
2018 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2020 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2022 First of prerequisites for new partial classs implemention.
2024 * attribute.cs (Attributable): Extended by ResolveContext;
2025 Attributes finally have correct context for resolving in all cases.
2026 (AttachTo): Attribute owner is assigned here.
2028 * codegen.cs (IResolveContext): Introduce new interface to hold
2029 all information needed in resolving phase.
2030 (EmitContext): Implements IResolveContext; more clean-up needed here.
2032 * decl.cs (MemberCore): Implemented IResolveContext.
2034 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2035 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2036 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2037 Refactored to use new IResolveContext instead of EmitContext; cleanup
2039 2006-03-22 Raja R Harinath <rharinath@novell.com>
2041 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2042 mcs to keep code differences small.
2043 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2044 * typemanager.cs (parameter_default_value_attribute_type): New.
2045 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2048 2006-03-22 Martin Baulig <martin@ximian.com>
2051 (Nullable.NullableLiteral): Derive from `NullLiteral'.
2054 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2055 instead of the normal `NullLiteral'.
2057 2006-03-21 Martin Baulig <martin@ximian.com>
2060 * generic.cs (TypeManager.InferType): If `pt' is a generic
2061 parameter, don't check whether `pt == at'.
2063 2006-03-20 Raja R Harinath <rharinath@novell.com>
2066 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2067 (TypeParameter.Resolve): Update to change.
2068 (ConstraintChecker.CheckConstraints): Resolve type-argument
2069 constraints before use.
2071 2006-03-16 Martin Baulig <martin@ximian.com>
2074 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2075 and don't have any instance constructors, also lookup in the base class.
2076 (TypeManager.IsNullableValueType): New public method.
2078 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2079 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2080 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2082 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2083 instead of just TypeManager.IsNullableType() to determine whether
2084 a lifted operator exists.
2085 (UnaryMutator.DoResolve): Likewise.
2086 (Conditional.DoResolve): Likewise.
2087 (Binary.DoResolve): A lifted operator only exists if both operands
2088 are valuetypes and at least one of them is a nullable type.
2090 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2092 * iterator.cs : yield break is allowed in try statement which has
2093 catch clauses. Fixed bug #77767.
2095 2006-03-12 Martin Baulig <martin@ximian.com>
2097 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2098 private IsSignatureEqual() to compare types; see the comment in
2099 that method; fixes #77674.
2101 2006-03-10 Raja R Harinath <rharinath@novell.com>
2103 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2104 (Expression.ResolveAsTypeTerminal): Likewise.
2105 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2106 * expression.cs, generic.cs, iterators.cs: Likewise.
2107 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2109 2006-03-09 Martin Baulig <martin@ximian.com>
2111 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2112 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2114 2006-03-09 Martin Baulig <martin@ximian.com>
2116 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2117 `prepared' flag is set.
2119 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2120 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2121 issues; see gtest-254.cs.
2123 2006-03-07 Martin Baulig <martin@ximian.com>
2125 * generic.cs (TypeManager.InferType): Allow infering
2126 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2128 2006-03-06 Martin Baulig <martin@ximian.com>
2131 (TypeManager.InferType): Fix gtest-250.cs.
2134 (TypeManager.IsSubclassOf): Also check the base class.
2137 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2140 2006-03-01 Raja R Harinath <rharinath@novell.com>
2143 * expression.cs (ParameterReference.DoResolveBase): Change return
2145 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2149 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2152 * typemanager.cs (GetFullNameSignature): Don't nullref on
2153 protected accessors.
2155 2006-02-16 Martin Baulig <martin@ximian.com>
2158 (TypeManager.GetGenericFieldDefinition): New public method; use it
2159 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2161 2006-02-14 Martin Baulig <martin@ximian.com>
2163 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2165 2006-02-14 Martin Baulig <martin@ximian.com>
2168 (TypeManager.DropGenericMethodArguments): New public method; don't
2169 use GetGenericMethodDefinition() on something which is not a
2172 2006-02-14 Martin Baulig <martin@ximian.com>
2175 (ConstraintChecker.CheckConstraints): If a type parameter has the
2176 `struct' constraint, the type must be a non-nullable valuetype.
2178 2006-02-10 Martin Baulig <martin@ximian.com>
2181 (TypeManager.IsOverride): Make this work for instantiated methods
2182 in a generic class; fixes #77509.
2183 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2184 rather than calling it directly; fixes #77488.
2186 2006-02-08 Martin Baulig <martin@ximian.com>
2188 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2189 reporting into CheckConstraint() so we can use the correctly
2192 2006-02-08 Martin Baulig <martin@ximian.com>
2194 * expression.cs (BaseAccess): Add support for generic methods.
2196 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2197 the new MethodGroupExpr.
2199 2006-02-07 Martin Baulig <martin@ximian.com>
2201 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2202 also reference types; fixes #77483.
2204 2006-02-07 Martin Baulig <martin@ximian.com>
2207 (TypeManager.IsGenericMethod): We now return whether something is
2208 an instantiated generic method (and not a generic method def).
2209 (TypeManager.IsGenericMethodDefinition): New public method.
2212 (TypeManager.CSharpSignature): Only include type arguments for
2213 "real" generic methods, not for any instantiated method.
2214 (TypeManager.GetMethodName): Likewise, but also allow generic
2215 method definitions here.
2217 2006-02-06 Miguel de Icaza <miguel@novell.com>
2219 * codegen.cs (EmitScopeInitFromBlock): check here the
2220 capture_context, there is no need to make two calls to the
2223 * anonymous.cs: Add some debugging messages that might help me
2224 track other instances of this problem in the future (the
2225 regression of test 467).
2227 * cs-parser.jay: track the variable block, as we need to initalize
2228 any captured variables declared in this block for the "catch"
2229 portion of the "Try" statement.
2231 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2232 scope initialization for captured variables.
2234 Also, move the emit for the variables after the block location has
2237 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2239 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2241 2006-02-06 Martin Baulig <martin@ximian.com>
2243 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2244 `TypeManager.value_type' as parent type to
2245 ModuleBuilder.DefineType(). Fixes #77358.
2247 2006-02-02 Miguel de Icaza <miguel@novell.com>
2249 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2250 commit yesterday, the initialization for the roots is necessary.
2251 What is not necessary is the scope activation.
2253 2006-02-02 Raja R Harinath <rharinath@novell.com>
2255 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2256 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2258 (Argument.Resolve): Remove CS0206 checks.
2260 2006-02-01 Miguel de Icaza <miguel@novell.com>
2262 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2263 scopes for all the roots, the scopes will now be emitted when the
2264 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2266 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2267 code. This reduces a lot of existing cruft.
2269 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2270 that the ScopeInfo is generated as we enter the scope, not at the
2271 time of use, which is what we used to do before.
2273 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2274 every time a Block is about to be emitted if we have a
2277 2006-02-01 Raja R Harinath <rharinath@novell.com>
2279 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2280 attribute for mscorlib too.
2282 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2284 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2286 * typemanager.cs (cons_param_array_attribute): Make private.
2287 (Reset): Set it to null.
2288 (InitCoreHelpers): Don't initialize it.
2289 (ConsParamArrayAttribute): New. Initialize it as needed.
2290 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2292 2006-01-31 Miguel de Icaza <miguel@novell.com>
2294 * expression.cs: There might be errors reported during the
2295 selection of applicable methods. If there are errors, do not
2296 continue execution as it will lead the compiler to crash.
2298 2006-01-30 Miguel de Icaza <miguel@novell.com>
2300 * expression.cs: Member access is not allowed on anonymous
2301 methods. Fixes #77402.
2303 2006-01-30 Raja R Harinath <rharinath@novell.com>
2306 * cs-parser.jay (VariableDeclaration): Don't set
2307 current_array_type to null.
2308 (field_declaration, event_declaration, declaration_statement):
2309 Set it to null here.
2311 2006-01-29 Raja R Harinath <harinath@gmail.com>
2314 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2316 2006-01-28 Raja R Harinath <harinath@gmail.com>
2318 * typemanager.cs (GenericParameterPosition): New.
2321 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2323 * doc.cs : To process "include" elements, first we should create
2324 another list than XmlNodeList, because it could result in node
2325 removal, which could result in that the XmlNodeList gives up
2328 2006-01-25 Miguel de Icaza <miguel@novell.com>
2330 * expression.cs: Introduce an error report that we were not
2331 catching before. Gonzalo ran into it.
2333 2006-01-23 Miguel de Icaza <miguel@novell.com>
2335 A fix for bug: #76957
2337 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2338 ComputeMethodHost before creating the method, this is a new
2341 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2342 that this method references (RegisterScope). The actual scope
2343 where the method is hosted is computed with the ComputeMethodHost
2344 before we create the method.
2346 Moved the Deepest routine here.
2348 (AnonymousContainer.ComputeMethodHost): New routine used to
2349 compute the proper ScopeInfo that will host the anonymous method.
2351 (ScopeInfo): Deal with multiple roots. The problem was that we
2352 did not have a unique root where all ScopeInfos could be hanged
2353 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2356 Remove AdjustMethodScope which is now computed at the end. Remove
2357 LinkScope which did a partial link, instead link all ScopeInfos
2358 before code generation from the new "LinkScopes" routine.
2360 Simplify all the Add* routines as they no longer need to maintain
2361 the tree, they just need to record that they are using variables
2364 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2365 routines to produce the forest of ScopeInfo trees.
2367 * class.cs (TypeContainer.AppendMethod): This is just like
2368 AddMethod, but ensures that an interface implementation method
2369 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2370 methods, but at the end.
2372 We use this functionality to ensure that the generated MoveNext
2373 method in the iterator class is resolved/emitted before the
2374 enumerator methods created.
2376 This is required because the MoveNext method computes the right
2377 ScopeInfo for the method. And the other methods will eventually
2378 need to resolve and fetch information computed from the anonymous
2382 2006-01-23 Raja R Harinath <rharinath@novell.com>
2384 Improve implementation of section 14.4.2.2 (Better function member).
2385 * expression.cs (Invocation.MoreSpecific): Compare all type
2386 arguments before deciding if one type is more specific than
2387 another. Handle array types too. Return the more specific type.
2388 (Invocation.BetterFunction): Add more tie-breaking rules from
2389 section 14.4.2.2. Perform "more specific" check after
2390 other tie-breaking rules. Compare all parameter types before
2391 choosing the "more specific" method.
2393 2006-01-21 Raja R Harinath <harinath@gmail.com>
2394 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2397 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2399 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2400 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2402 2006-01-18 Martin Baulig <martin@ximian.com>
2404 * class.cs (TypeContainer.AddToMemberContainer): Use
2405 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2408 2006-01-18 Martin Baulig <martin@ximian.com>
2410 Fix #76417: a generic class may now have methods which may unify
2411 for some type parameter substitutions.
2413 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2414 for methods which may unify anymore.
2416 * expression.cs (Invocation.MoreSpecific): New private static
2417 method; checks whether one method is more specific than another
2418 according to 14.4.2.2 of the spec.
2419 (Invocation.BetterFunction): Implement the tie-breaking rules from
2420 14.4.2.2 of the spec: if two methods unify for some type parameter
2421 substitution, we need to pick the more specific one.
2423 2006-01-18 Raja R Harinath <rharinath@novell.com>
2425 Fix #76656, cs0231-2.cs.
2426 * cs-parser.jay (formal_parameter_list): Make error case catch
2428 (parenthesized_expression_0): Add CS1026 check.
2429 (invocation_expression): Remove unused { $$ = lexer.Location }.
2431 2006-01-17 Raja R Harinath <rharinath@novell.com>
2434 * cs-parser.jay (statement_expression): Don't list out the
2435 individual statement-expressions. Convert syntax error into
2438 2006-01-16 Raja R Harinath <rharinath@novell.com>
2441 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2442 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2443 CheckIntermediateModification.
2444 (FieldExpr.DoResolve): Add new two-argument version that
2445 allows us to resolve the InstanceExpression as an lvalue.
2446 The one-argument variant is now just a wrapper.
2447 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2448 Resolve the lhs as an lvalue if the it has a value type.
2449 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2450 from Assign.DoResolve.
2451 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2452 resolved as an lvalue.
2453 (PropertyExpr.DoResolve): Update.
2454 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2455 has a value type. Move CS1612 check here from
2456 CheckIntermediateModification.
2457 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2458 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2459 'right_side' of a ResolveLValue on an 'out' argument.
2460 (EmptyExpression.LValueMemberAccess): New. Used as the
2461 'right_side' of a propagated ResolveLValue on a value type.
2462 (LocalVariableReference.DoResolveBase): Recognize
2463 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2465 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2466 EmptyExpression.Null.
2468 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2470 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2471 Type.IsGenericParameter(). Fixed bug #77183.
2472 * doc.cs : it is now identical to doc.cs in mcs.
2474 2006-01-16 Martin Baulig <martin@ximian.com>
2476 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2478 2006-01-16 Martin Baulig <martin@ximian.com>
2480 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2481 ctors; fixes #77250.
2483 2006-01-12 Miguel de Icaza <miguel@novell.com>
2485 This fixes the problem where we used ldfld instead of ldflda to
2486 load the "THIS" pointer on captured parameters, when THIS is a
2487 value type. See bug #77205.
2489 * iterators.cs (CapturedThisReference.Emit): Pass false to
2490 EmitThis (we do not need the address).
2492 * codegen.cs (EmitThis): it needs to know whether we need the
2493 address of `this' or not. This is used by value types.
2495 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2496 every other call passes false.
2498 2006-01-12 Raja R Harinath <rharinath@novell.com>
2501 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2503 * expression.cs (Invocation.OverloadResolve): Update.
2504 (Invocation.DoResolve): Avoid double resolution of invocation.
2506 2006-01-11 Raja R Harinath <rharinath@novell.com>
2509 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2510 unary negation of floating point types as 0-expr; negation cannot
2511 overflow in floating point types.
2514 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2515 on operands of 'void' type.
2518 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2519 and ExclusiveOr for boolean constants too.
2521 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2523 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2525 2006-01-12 Miguel de Icaza <miguel@novell.com>
2527 * cs-tokenizer.cs (Position): New class used to save and restore
2528 the position state in the tokenizer. Before this patch the save
2529 and restore was not complete enough so the line and columns would
2530 start to drift and the debugger and stack traces will get the
2533 2006-01-10 Martin Baulig <martin@ximian.com>
2536 (TypeParameter.InflateConstraints): New public method.
2538 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2539 constraints; fixes #77042.
2541 2006-01-10 Martin Baulig <martin@ximian.com>
2543 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2544 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2547 2006-01-09 Raja R Harinath <rharinath@novell.com>
2550 * expression.cs (Invocation.OverloadResolve): Replace reflected
2551 override methods with their base virtual methods, rather than
2553 * typemanager.cs (TypeManager.GetOverride): New.
2555 2005-12-21 Miguel de Icaza <miguel@novell.com>
2557 * driver.cs: Report the case of no source files and no -out:
2560 2005-12-20 Raja R Harinath <rharinath@novell.com>
2563 * expression.cs (ComposedCast.GetSignatureForError): Define.
2565 2006-01-05 Jb Evain <jbevain@gmail.com>
2567 * class.cs (Property.Define, Indexer.Define): do not tag the
2568 properties as SpecialName | RTSpecialName.
2570 2006-01-04 Miguel de Icaza <miguel@novell.com>
2572 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2573 doing a low-level comparission of parameter types. It was lacking
2574 a check for __argslist.
2576 2005-12-30 Miguel de Icaza <miguel@novell.com>
2578 * expression.cs (ParameterReference.DoResolveBase): Allow
2579 reference parameters if they are local to this block.
2581 This allows the ref and out parameters of a delegate to be used in
2582 an anonymous method, for example:
2584 delegate void set (out int x);
2586 set s = delegate (out int x){
2590 This is used by functionality introduced late in the C# language.
2592 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2593 method that take ref and out parameters.
2595 Fixes #77119 which was a late change in the spec.
2597 2005-12-23 Miguel de Icaza <miguel@novell.com>
2599 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2600 parent if its the same scope. Fixes #77060.
2602 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2604 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2606 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2608 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2609 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2610 that doesn't contain the full public key. This is a update of the
2611 friend assemblies in .Net 2.0 release.
2613 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2617 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2618 ListDictionary, to contain the ExternAliasEntry entries (in
2619 addition to the NamespaceEntry.aliases hashtable). This field is
2620 shared between the original entry and its doppelganger (bodyless
2622 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2623 extern_aliases field.
2624 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2625 lookup in extern_aliases.
2627 2005-12-16 Raja R Harinath <rharinath@novell.com>
2630 * class.cs (TypeContainer.Mark_HasEquals): New.
2631 (TypeContainer.Mark_HasGetHashCode): New.
2632 (ClassPart): Override them.
2633 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2635 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2636 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2640 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2641 'parent' argument to the base constructor.
2643 Remove all mention of TypeContainer from decl.cs.
2644 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2645 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2646 (DeclSpace.DeclSpace): Likewise.
2647 (DeclSpace.DefineMembers): Remove unused argument.
2648 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2649 debugging check -- we don't care if the debug code throws an
2650 InvalidCastException instead of an InternalErrorException.
2651 * class.cs (TypeContainer.DefineMembers): Update to changes.
2652 (TypeContainer.DoDefineMembers): Likewise.
2653 (TypeContainer.GetMethods): Likewise.
2654 (PropertyMember.Define): Likewise.
2655 (MemberBase.Parent): New property that forwards to
2656 MemberCore.Parent, but ensures that we get a TypeContainer.
2657 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2658 (RootContext.PopulateTypes): Likewise. Remove special case code
2659 for !RootContext.StdLib: DefineMembers is idempotent.
2661 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2663 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2665 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2667 * doc.cs : The search for referenced namespace was insufficient to
2668 get global one as it used to do. Fixed bug #76965.
2670 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2672 * doc.cs : check name in cref in the last phase that whether it is
2675 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2677 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2680 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2682 * doc.cs : so it turned out that we cannot skip override check for
2683 interface members. Fixed bug #76954.
2685 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2687 * cs-tokenizer.cs : fixed bug #75984:
2688 - #warning and #error should not be handled when the source line
2690 - #line is not checked strictly when the source line is disabled.
2691 - #define and #undef is on the other hand checked strictly at any
2694 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2696 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2699 2005-12-15 Raja R Harinath <rharinath@novell.com>
2701 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2703 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2706 2005-12-14 Martin Baulig <martin@ximian.com>
2708 * typemanager.cs (TypeManager.GetFullName): Make this public;
2709 `Type.Fullname' now never returns null.
2711 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2712 explicit interface implementations; we're now using the same
2713 naming convention than csc does.
2715 2005-12-14 Miguel de Icaza <miguel@novell.com>
2717 * convert.cs (ExplicitConversionCore): Check the return value from
2718 ExplicitConversionCore which can return null on failure. Fixes #76914
2720 2005-12-09 Raja R Harinath <rharinath@novell.com>
2722 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2723 instead of IsGenericInstance.
2724 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2725 code that's now covered by the more general test.
2726 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2728 * generic.cs (DropGenericTypeArguments): New. Captures the common
2729 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2730 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2731 * generic.cs, report.cs, typemanager.cs: Likewise.
2733 2005-12-08 Martin Baulig <martin@ximian.com>
2735 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2737 * typemanager.cs (TypeManager.CSharpSignature): Include type
2738 arguments in the signature of a generic method.
2740 2005-12-07 Martin Baulig <martin@ximian.com>
2742 Add support for custom attributes on type parameters.
2744 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2746 * generic.cs (TypeParameterName): New public class; we use this
2747 instead of a `string' to store the name of a type parameter, so we
2748 can also have `Attributes'.
2749 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2750 array instead of a `string[]' array.
2751 (TypeParameter.ctor): We now also take an `Attributes' argument.
2752 (TypeParameter.EmitAttributes): New public method; emit our
2753 `OptAttributes' here.
2754 (GenericMethod.EmitAttributes): New public method; emit the custom
2755 attributes on all our type parameters.
2757 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2758 our type parameters.
2759 (MethodData.Define): If we're a generic method, call
2760 EmitAttributes() on it.
2762 2005-12-07 Martin Baulig <martin@ximian.com>
2765 (ConstraintChecker): New public abstract class; move the
2766 constraint checking here from `ConstructedType' and also do
2767 constraint checking for generic methods here.
2769 * expression.cs (Invocation.OverloadResolve): Use
2770 ConstraintChecker.CheckConstraints() if we resolved to a generic
2773 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2775 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2777 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2779 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2780 (FieldBase.Initializer): Initializer is now optional.
2781 (EventField.Define): Only event field can have initializer.
2783 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2785 * const.cs (Const): Reuse initializer.
2787 * cs-parser.jay: Updated after FieldBase changes.
2788 Added current_array_type to simplify array initializers.
2790 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2792 * expression.cs, iterators.cs: Updated.
2794 * namespace.cs (NamespaceEntry): Made UsingFound private.
2796 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2798 * parameterCollection.cs: Obsolete, removed.
2799 * parser.cs: Obsolete, removed.
2801 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2804 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2806 * enum.cs (Enum.Define): Set obsolete context here.
2808 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2811 - FindDocumentedMember() now expects 1) paramList as null
2812 when "we don't have to check the number of parameters" and
2813 2) Type.EmptyTypes when "there is no arguments".
2814 - Introduced FoundMember struct to hold the exact type which was
2815 used to find the documented member (the above change broke
2816 test-xml-044; it might be better just to use DeclaringType than
2817 what MS does, like this change does, but it depends on usage.)
2819 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2821 * doc.cs : documented member might be from DeclaringType for nested
2822 types. Fixed bug #76782.
2824 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2826 * anonymous.cs: Have the param code handle leaving copies on the
2827 stack etc. Allows anonymous params to take part in the assignment
2828 code (++, +=, etc). Fixes bug #76550
2830 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2831 it down to the anon code.
2833 * iterators.cs: Use dummy var here
2835 * codegen.cs: Handle new vars
2837 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2840 * class.cs (MethodData.Define): Set proper Obsolete context.
2842 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2844 (FieldExpr.DoResolve): Ditto.
2846 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2849 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2850 parent is not obsolete.
2852 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2854 * doc.cs : (FindDocumentedMember) find parameterless members first
2855 and get CS0419 in the early stage. Fixed first case of bug #76727.
2857 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2860 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2861 no error was reported.
2863 *expression.cs (Binary.DoResolve): left can be null.
2865 2005-12-06 Raja R Harinath <rharinath@novell.com>
2867 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2868 abstract method and all overrides.
2869 * support.cs (ParameterData.GenericConstraints): Delete.
2870 (ReflectionParameters.type_params): Delete.
2871 (ReflectionParameters.ReflectionParameters): Make private.
2872 (ReflectionParameters.GetConstaints): New factory method.
2873 * generic.cs (TypeParameterDefineType): Use it.
2874 (TypeManager.GetTypeParameterConstraints): Likewise.
2876 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2879 * class.cs (MethodData.Emit): Parameters should be labeled first.
2881 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2884 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2886 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2888 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2890 * class.cs (MethodCore): Parameter clean up.
2891 (IMethodData): Added ParameterInfo.
2892 (MethodData): Parameter clean up.
2893 (Indexer.Define): Parameter clean up.
2905 * typemanager.cs: Parameter clean up.
2907 * delegate.cs (Define): Get rid of duplicated code.
2909 * expression.cs (ParameterReference): Removed useless parameters
2911 (Invocation): Ditto.
2913 * parameter.cs (ParamsParameter): New class, params specialization.
2914 (ArglistParameter): Attemp to separate arglist.
2915 (Parameter): Refactored to be reusable and faster.
2916 (Parameter.Modifier): Made understandable.
2917 (Parameters): Changed to be used as a class for `this' assembly
2918 parameters. Refactored to use new specialized classes.
2920 * support.cs (ParameterData): Added Types property.
2921 (InternalParameters): Deleted.
2923 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2925 * doc.cs : the previous patch does not actually fix the bug.
2926 PropertyInfo override check is now implemented and really fixed it.
2927 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2929 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2931 * doc.cs : apply "override filter" also to properties.
2934 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2936 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2937 no need to check overrides. For classes, omit those results from
2938 interfaces since they must exist in the class. Fixed bug #76726.
2940 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2942 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2943 with different parameters. Fixed the second problem in #76685.
2945 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2947 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2948 get expected 'protected' access in CheckValidFamilyAccess()).
2951 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2953 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2954 Fixed bug #76705. CS1569 was incorrectly commented out.
2956 2005-11-23 Martin Baulig <martin@ximian.com>
2958 * generic.cs (Constraints.Define): Removed.
2959 (TypeParameter.DefineConstraints): Removed.
2960 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2961 on the GenericTypeParameterBuilder here.
2963 2005-11-23 Martin Baulig <martin@ximian.com>
2965 * typemanager.cs (TypeManager.GetProperty): Make this public.
2967 * generic.cs (Nullable.NullableInfo.ctor): Use
2968 TypeManager.GetProperty() rather than using reflection directly.
2970 2005-11-17 Martin Baulig <martin@ximian.com>
2972 * expression.cs (Indexers.GetIndexersForType): Added support for
2973 generic parameters; fixes #76587.
2975 2005-11-17 Martin Baulig <martin@ximian.com>
2978 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2979 inherit the scope from our parent. Fixes #76653.
2981 2005-11-15 Martin Baulig <martin@ximian.com>
2983 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2984 instead of `ScopeTypeBuilder' to refer to the "current" type.
2985 (AnonymousMethod.CreateScopeType): Correctly create the helper
2986 class if we're inside a generic type definition.
2988 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2990 * doc.cs : use Invocation.IsOverride() to do real override check.
2991 * expression.cs : made Invocation.IsOverride() internal.
2993 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2995 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2996 TypeBuilder.FindMembers() and filter overriden base members out.
2999 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3001 * doc.cs : ref/out parameters are represented as '@' (instead of
3002 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3004 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3006 * doc.cs : when there was no '.' in cref to methods in doc comment,
3007 then parameters were missing in the output. Fixed bug #76691.
3009 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3011 * driver.cs : don't output docs when there is an error.
3014 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3017 Now it should detect indexers. Fixed primary concern in bug #76685.
3018 Fixed CS0419 message to not show the identical member signature in
3021 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3023 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3024 instead of Type.FindMembers() since it does not handle events.
3027 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3029 * codegen.cs: Fixed typo (speficied -> specified).
3031 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3034 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3036 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3038 * attribute.cs: Changed error message.
3040 * cs-tokenizer.cs: One more check.
3042 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3044 * statement.cs (Block.Resolve): Ignore empty statement.
3046 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3048 * report.cs: Made error/warning methods more strict to avoid
3051 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3052 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3053 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3054 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3056 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3058 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
3059 Use the more explicit AssemblyName.FullName instead of
3060 AssemblyName.Name to report errors.
3062 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3064 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3067 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3077 * report.cs: Fixed error reporting and typos.
3079 * generic.cs (TypeParameter.GetSignatureForError): New method.
3080 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3082 * typemanager.cs (GetFullName): Refactored.
3084 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3086 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3087 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3089 * class.cs (TypeContainer.IsComImport): New property.
3090 (Constructor.Define): Create proper ctor for ComImport types.
3092 * expression.cs (New.CheckComImport): Fixed.
3094 2005-11-07 Miguel de Icaza <miguel@novell.com>
3096 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3097 that a parameter has been captured does not mean that we do not
3098 have to do the rest of the processing. This fixes the second part
3099 of #76592. If there was another anonymous method capturing
3100 values in the past, the Scope would never be set for the second
3101 method that captured the same parameter.
3103 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3104 properly manipulate the stack. Second part of fix for #76592.
3106 * expression.cs (New): Add support for invoking "new" on
3107 interfaces that have been flagged with the ComImport attribute and
3108 the CoClass. Fixes #76637
3110 * statement.cs (Try.DoEmit): When a variable is captured, do not
3111 try to emit the vi.LocalBuilder variable as it has been captured.
3112 Create a temporary variable and store the results on the
3113 FieldBuilder. Fixes #76642
3115 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3117 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3119 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3121 * expression.cs (Binary.DoResolve): Added && optimalization.
3123 * typemanager.cs (AddUserType): Removed useless argument.
3125 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3127 * statement.cs (Block.variables): Uses ListDictionary.
3129 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3132 * class.cs (PartialContainer.EmitType): Customized to emit
3133 security attributes.
3134 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3135 for partial classes.
3137 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3140 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3141 access has to be fixed.
3143 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3145 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3148 * ecore.cs (NullCast.Reduce): Implemented.
3150 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3153 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3155 (Foreach.Resolve): Catch null properly.
3157 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3159 * cs-tokenizer.cs: Warning text fix.
3161 * driver.cs: AllWarningNumbers exposed on public interface.
3163 * report.cs (): Reviewed warning numbers.
3164 (IsValidWarning): Use binary search.
3166 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3168 * driver.cs: Implemeted resource visibility.
3169 (Resources): New class for code sharing between /res: and
3172 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3174 decl.cs (CurrentTypeParameters): Fixed to be public.
3176 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3178 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3180 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3182 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3184 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3186 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3188 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3190 Add friend assembly access support.
3191 * typemanager.cs: assembly_internals_vis_attrs
3192 cache for friend assembly access.
3193 (TypeManager.IsFriendAssembly): New method for
3194 checking friend assembly access.
3195 (TypeManager.Error_FriendAccessNameNotMatching): New
3197 (TypeManager.CompareKeyTokens): Likewise.
3198 (TypeManager.Filter): Handle friend accessible
3201 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3202 friend accessible types.
3204 * ecore.cs (Expression.IsAccessorAccessible): Handle
3205 friend accessible properties.
3207 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3210 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3213 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3216 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3219 * ecore.cs (NullCast): Child is contant only.
3221 * literal.cs (NullLiteral.Reduce): null can be converted to any
3224 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3226 * driver.cs: Use Encoding.Default as default code page instead
3229 2005-10-27 Raja R Harinath <rharinath@novell.com>
3232 * expression.cs (Invocation.Error_InvalidArguments): Handle
3233 __arglist parameters.
3234 (Invocation.VerifyArgumentsCompat): Likewise.
3235 * support.cs (ReflectionParameters.GetSignatureForError): Print
3236 __arglist parameters.
3237 (InternalParamters.GetSignatureForError): Likewise.
3238 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3240 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3242 * attribute.cs (GetPropertyValue): Made public.
3244 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3246 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3248 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3251 * driver.cs: Reflect method name change.
3253 * statement.cs (Try.Resolve): Warn when try has both general
3256 * typemanager.cs: runtime_compatibility_attr_type new predefined
3259 2005-10-26 Raja R Harinath <harinath@gmail.com>
3262 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3263 treat it as an empty parameter list.
3265 2005-10-26 Raja R Harinath <rharinath@novell.com>
3268 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3269 ResolveAsTypeStep silent.
3270 * statement.cs (Block.AddConstant): Mark block as used.
3271 (Block.ResolveMeta): Avoid piling on error messages
3272 if a constant initializer resolution fails.
3274 2005-10-25 Raja R Harinath <rharinath@novell.com>
3276 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3278 (NamespaceEntry.VerifyAllUsing): New.
3279 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3280 behaviour. Delegates actual resolution of alias to ...
3281 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3282 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3284 * driver.cs (Driver.MainDriver): Update.
3286 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3287 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3289 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3291 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3292 RootNamespace.DefineNamespacesForAll.
3294 2005-10-24 Raja R Harinath <harinath@gmail.com>
3296 * typemanager.cs (assemblies, external_aliases, modules)
3297 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3298 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3299 overhead. Move resposibility ...
3300 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3301 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3303 2005-10-23 Raja R Harinath <harinath@gmail.com>
3305 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3306 cached_namespaces. Improve usage.
3307 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3308 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3309 Move from GlobalRootNamespace and simplify.
3310 (RootNamespace.Global): Make instance variable.
3311 (RootNamespace.RootNamespace): Add "alias name" parameter.
3312 (GlobalRootNamespace): Simplify drastically.
3313 (Namespace.Lookup): Don't use GetNamespace.
3314 * typemanager.cs (GetRootNamespace): Rename from
3315 ComputeNamespaceForAlias.
3316 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3318 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3320 * anonymous.cs (AnonymousContainer): Don't crash when container
3323 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3325 * expression.cs (Binary.DoResolve): Warn when comparing same
3328 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3331 * expression.cs (Binary.DoResolve): It looks like there are no
3332 convetsion rules in enum context.
3334 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3336 Add support for extern alias qualifiers.
3337 * typemanager.cs: Move some LookupTypeReflection code
3338 to namespace.cs, to have cleaner code. Added some methods
3339 to help us keep track of the extern aliased references.
3340 * driver.cs: Add suport for extern alias assemblies on command
3341 line and check for their warnings/errors. Also keep track of the
3342 extern aliased assemblies.
3343 * namespace.cs: Move the global functionality of Namespace
3344 to GlobalRootNamespace/RootNamespace. Now the global namespace
3345 is GlobalRootNamespace.Globa. Also the code moved from
3346 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3347 Finally added LocalAliasEntry (AliasEntry before) and
3348 ExternAliasEntry, to handle alias statements.
3349 * cs-parser.jay: Add support in the grammar for extern alias
3351 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3352 Update callings to Namespace (now in GlobalRootNamespace).
3354 2005-10-25 Martin Baulig <martin@ximian.com>
3356 * convert.cs (ImplicitTypeParameterConversion): Make base
3357 interfaces actually work; fixes #76557.
3359 2005-10-25 Martin Baulig <martin@ximian.com>
3362 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3363 all the type parameters; fixes #76551.
3365 2005-10-25 Martin Baulig <martin@ximian.com>
3370 (GenericMethod.ctor): Added `Expression return_type' and
3371 `Parameters parameters' arguments.
3372 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3373 parameter and return types to check their constraints if they're
3376 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3379 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3380 constraints of a generic type if `ec.ResolvingGenericMethod'.
3382 * class.cs (MethodCore.DoDefineParameters): Set
3383 `ec.ResolvingGenericMethod' if we're a generic method.
3384 (MemberBase.MemberType): Likewise.
3386 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3388 * typemanager.cs (TypeManager): Added
3389 TypeManager.internals_visible_attr_type to cache
3390 S.R.CompilerServices.InternalsVisibleToAttribute.
3392 * codegen.cs (AssemblyClass): Added checks for
3393 InternalsVisibleToAttribute in new method
3394 CheckInternalsVisibleAttribute () and also cache the
3395 AssemblyName in AssemblyClass.Name.
3397 2005-10-24 Martin Baulig <martin@ximian.com>
3400 (TypeManager.ExpandInterfaces): Added overloaded version which
3401 just takes a `Type[]' array.
3404 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3405 just use the interfaces which were explicitly specified and not
3406 the interfaces they inherit. Fixes #76482.
3407 (TypeParameter.FindMembers): Expand the interfaces here.
3409 2005-10-21 Martin Baulig <martin@ximian.com>
3412 (Constraints.Resolve): Also resolve the actual types here.
3413 (Constraints.ResolveTypes): Just check the constraints here.
3414 Fixes #76363; see gtest-218.cs.
3416 2005-10-21 Martin Baulig <martin@ximian.com>
3419 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3420 instead of a `BoxedCast'; fixes gtest-217.cs.
3422 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3424 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3425 1) "new()" is specified as generic parameter constraint and 2) the
3426 type is TypeBuilder and 3) the type is abstract even if it has a
3427 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3429 2005-10-20 Martin Baulig <martin@ximian.com>
3432 (GenericConstraints.TypeParameter): New public property.
3433 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3434 (TypeParameter.DeclSpace): New public property.
3435 (TypeParameter.DefineType): Inflate the constraints if our
3436 `DeclSpace' is an `Iterator'.
3438 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3440 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3441 GenericMethod argument to compare methods' generic type arguments.
3444 2005-10-19 Martin Baulig <martin@ximian.com>
3446 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3447 not ResolveType() when resolving the base type, so we're not
3448 checking the constraints here.
3449 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3452 2005-10-19 Martin Baulig <martin@ximian.com>
3454 * generic.cs (ConstructedType.CheckConstraints): Committing
3455 untested fix for #76441.
3457 2005-10-18 Raja R Harinath <rharinath@novell.com>
3460 * class.cs (TypeContainer.DefineType): Move updating of
3461 topological sort earlier in the code.
3462 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3464 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3467 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3469 * constant.cs (Constant.TryReduce): Moved from Cast class.
3470 (Reduce): Made little bit more OO and fixed missing conversions.
3472 * ecore.cs (Reduce): Implemented.
3473 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3475 * literal.cs (Reduce): Implemented.
3477 * class.cs: Reverted Miguel's wrong commit.
3479 2005-10-14 Miguel de Icaza <miguel@novell.com>
3481 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3483 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3485 * cs-parser.jay, expression.cs : CS0214 was missing error location
3486 for constants. Fixed bug #76404.
3488 2005-10-10 Raja R Harinath <rharinath@novell.com>
3490 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3492 (PropertyExpr.EmitCall): Likewise.
3493 * expression.cs (Invocation.EmitArguments): Handle case where
3495 (Invocation.EmitCall): Avoid allocating temporary variable if
3496 there are no arguments.
3498 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3501 * convert.cs (ExplicitConversionCore): Fixed object->enum
3504 2005-10-07 Raja R Harinath <rharinath@novell.com>
3507 * convert.cs (ImplicitConversionStandard): Move conversion of
3508 void* to arbitrary pointer types ...
3509 (ExplicitConversionStandard): .. here.
3510 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3511 error to always print typenames.
3513 2005-10-07 Raja R Harinath <rharinath@novell.com>
3515 * convert.cs (GetConversionOperator): Rename from
3516 GetConversionOperators. Move operator selection code from ...
3517 (UserDefinedConversion): ... here.
3519 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3521 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3524 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3526 * assign.cs (Assign.DoResolve): Error method changed.
3528 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3530 * const.cs (ResolveValue): Reset in_transit immediately.
3532 * constant.cs: Error method changed.
3534 * convert.cs: Removed useless location parameter.
3535 (ExplicitNumericConversion): Don't do double enum check.
3536 (ExplicitConversionCore): Renamed from ExplicitConversion.
3537 (ExplicitUnsafe): Extracted from ExplicitConversion.
3538 (ExplicitConversion): Uses for error reporting.
3540 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3542 (ResolveBoolean): Uses common error method.
3543 (CastToDecimal): Get rid of ec.
3544 (CastFromDecimal): Optimized.
3545 (ConvCast): Get rid of ec.
3547 * enum.cs (ResolveValue): Reset in_transit immediately.
3548 (Emit): Return after first error.
3550 * expression.cs: Convert changes.
3552 * literal.cs: Error method changed.
3554 * statement.cs: Error method changed.
3556 2005-10-06 Raja R Harinath <rharinath@novell.com>
3558 Fix gtest-131.cs and gtest-211.cs.
3559 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3560 Only emit code for a label if it is used. Unreachable code can
3561 violate ECMA evaluation stack invariants.
3563 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3565 * anonymous.cs: Implemented ExprClassName.
3567 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3570 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3573 * class.cs (StaticClass.DefineContainerMembers): Report protected
3576 * codegen.cs: if(ed) PRODUCTION.
3578 * convert.cs (Error_CannotImplicitConversion): Better error
3581 * cs-parser.jay: More error checks.
3583 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3585 * driver.cs (CSCParseOption): Enabled wrong option check.
3587 * ecore.cs (Expression.ExprClassName): Turned to property.
3588 (MemberExpr.CheckIntermediateModification): For checking boxed
3589 value types modification.
3591 * statement.cs (Fixed.Resolve): Expression type must be
3592 convertible to fixed type.
3593 (CollectionForeach.GetEnumeratorFilter,TryType):
3594 Small refactoring for easier error checking.
3596 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3598 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3601 * class.cs (GeneratedBaseInitializer): New class for customization
3602 compiler generated initializers.
3603 (MemberBase.DoDefine): Check Obsolete attribute here.
3604 (FieldMember.DoDefine): Ditto.
3606 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3609 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3610 (MemberCore.GetObsoleteAttribute): Removed argument.
3611 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3612 (MemberCore.CheckObsoleteType): New helper.
3616 * statement.cs: Updates after MemberCore changes.
3618 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3619 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3621 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3622 obsolete attribute for compiler construct.
3623 (As.DoResolve): Cache result.
3625 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3627 2005-10-01 Miguel de Icaza <miguel@novell.com>
3629 * expression.cs (Probe): instead of having a "Type probe_type"
3630 keep the extra information as a TypeExpr probe_type_expr since the
3631 "As" operator needs to perform some type checks.
3633 * (As.DoResolve): If the type is a type parameter, ensure that it
3634 is constrained by a class.
3636 2005-09-22 Miguel de Icaza <miguel@novell.com>
3638 * statement.cs (Lock): Use the TemporaryVariable class instead of
3639 manually using local variables as those do not work when variables
3642 * ecore.cs: Moved the TemporaryVariable class from being a nested
3643 class inside Foreach to be a public class that can be employed in
3646 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3648 * cs-parser.jay: interface_accessors replaced by
3649 accessor_declarations.
3651 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3654 * statement.cs (GotoCase.Resolve): Convert null constant to
3656 (SwitchLabel.ResolveAndReduce): Ditto.
3657 (SwitchLabel.NullStringCase): Custom null stamp.
3658 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3660 typemanager.cs (CSharpSignature): Don't skip first argument
3663 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3665 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3666 expression.cs, iterators.cs, literal.cs: Store constants and
3669 * class.cs (MemberBase.ShortName): Pass location.
3671 * cs-parser.jay: Some location fixes.
3673 * ecore.cs (Expression.Location): Made virtual.
3675 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3678 * const.cs (Const.ResolveValue): Check for assigning non-null
3679 value to reference type.
3681 2005-09-26 Raja R Harinath <rharinath@novell.com>
3684 * expression.cs (This.VerifyFixed): In a value type T, the type of
3685 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3686 value type R, 'this' is treated as a value parameter.
3688 2005-09-05 Miguel de Icaza <miguel@novell.com>
3690 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3691 if the underlying types are the same, otherwise we need to produce
3692 code that will do the proper cast.
3694 This was exposed by Marek's constant rewrite which produced
3695 invalid code for the call site:
3698 void Method (X v) {}
3702 This fixes test-49.cs
3704 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3706 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3707 Type/Object should be allowed as well. Fixed bug #75968.
3709 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3711 * expression.cs : (Binary.DoResolve): when one is enum constant and
3712 another is constant 0, then return enum one *as enum type*.
3715 2005-10-04 Martin Baulig <martin@ximian.com>
3717 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3718 `SetMemberIsUsed()' work for generics, too.
3720 2005-10-04 Martin Baulig <martin@ximian.com>
3722 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3723 for corlib. Fixes #75691.
3725 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3728 * driver.cs: Fix compilation files with full root path.
3730 2005-09-25 Miguel de Icaza <miguel@novell.com>
3732 * report.cs (SymbolRelatedToPreviousError): Format the output so
3733 it does not use an open parenthesis that is never closed.
3735 * driver.cs: Follow coding guidelines
3737 2005-09-18 Miguel de Icaza <miguel@novell.com>
3739 * driver.cs: Set InEmacs based on the environment variable EMACS.
3741 * location.cs (InEmacs): in this mode, do not report column
3742 location as it confuses Emacs.
3744 2005-10-03 Raja R Harinath <rharinath@novell.com>
3746 * support.cs (SeekableStreamReader.Position): Don't error out when
3747 the requested position is just beyond the end of the current
3750 2005-09-28 Raja R Harinath <rharinath@novell.com>
3752 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3753 try to keep in sync with the byte count of the underlying Stream.
3754 However, this limits us to a window size of 2048 characters: i.e.,
3755 the maximum lookahead of our lexer/parser can be 2048 characters.
3757 2005-09-22 Martin Baulig <martin@ximian.com>
3759 * driver.cs: Removed a debugging FIXME.
3761 2005-09-21 Raja R Harinath <rharinath@novell.com>
3763 * cs-parser.jay (type_arguments): Add CS1644 check.
3764 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3766 2005-09-15 Raja R Harinath <rharinath@novell.com>
3768 * Makefile (PROGRAM): Make profile specific.
3769 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3770 the current directory.
3773 * expression.cs (Invocation.EmitCall): Remove optimization on
3774 this_call since it doesn't handle 'this' being a value type.
3776 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3778 * driver.cs: Ensure file handles are closed after parsing
3780 2005-09-05 Miguel de Icaza <miguel@novell.com>
3782 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3783 if the underlying types are the same, otherwise we need to produce
3784 code that will do the proper cast.
3786 This was exposed by Marek's constant rewrite which produced
3787 invalid code for the call site:
3790 void Method (X v) {}
3794 This fixes test-49.cs
3796 2005-09-05 Martin Baulig <martin@ximian.com>
3798 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3799 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3801 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3803 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3805 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3806 to be a pointer type due to the spec 25.2, so check if declaring
3807 type is generic type definition. Fixed bug #75772.
3809 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3812 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3813 both types are not defined by methods.
3814 * expression.cs : (Invocation.IsApplicable): it should work when
3815 the argument type is equal to the parameter type, not only when
3816 ImplicitConversionExists() returns true.
3818 2005-09-02 Raja R Harinath <rharinath@novell.com>
3820 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3824 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3825 flow-branching for LocalVariableReferences in case we were invoked
3826 from a MemberAccess.
3827 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3829 (LocalVariableReference.DoResolveBase): ... this.
3830 (MemberAccess.Resolve): Do the check that was disabled during
3833 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3836 (PartialContainer.Create): check abstract/sealed/static strictly
3837 but abstract/sealed can exist only at one side. Fixed bug #75883.
3839 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3842 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3843 specified, don't default to UnmanagedType.I4.
3845 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3847 * expression.cs : conditional operator should check possibly
3848 incorrect assign expression. Fixed bug #75946.
3850 2005-08-30 Raja R Harinath <rharinath@novell.com>
3853 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3854 (ScopeInfo.EmitScopeType): Use it to construct field names from
3855 names of captured locals.
3858 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3859 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3860 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3861 (ExplicitConversion): Remove enum cases already handled by
3862 implicit conversion. Move implicit conversion check to the beginning.
3863 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3864 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3865 Don't treat System.Enum as a struct.
3867 2005-08-30 Jb Evain <jbevain@gmail.com>
3869 * attribute.cs: handles as expression in parameters.
3871 2005-08-30 Raja R Harinath <rharinath@novell.com>
3874 * class.cs (TypeContainer.VerifyClsName): Don't use a
3875 PartialContainer when verifying CLS compliance.
3876 (AbstractPropertyEventMethod): Set Parent here, ...
3877 (PropertyMethod): ... not here.
3879 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3881 * attribute.cs : escaped attribute name should not be allowed to be
3882 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3884 2005-08-29 Raja R Harinath <rharinath@novell.com>
3887 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3888 when converting a long constant to unsigned long.
3889 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3890 detect where IsApplicable and VerifyArgumentsCompat disagree.
3892 2005-08-29 Raja R Harinath <rharinath@novell.com>
3893 and Carlos Alberto Cortez <carlos@unixmexico.org>
3896 * class.cs (TypeContainer.CanElideInitializer): New helper.
3897 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3898 can safely emitting the initializer of a field.
3900 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3902 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3903 allowed inside a switch (without loop). Fixed bug #75433.
3905 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3907 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3908 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3910 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3912 * driver.cs : kinda reverting the default encoding changes (not exact
3913 revert since I noticed that "codepage:reset" might not work fine).
3915 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3917 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3918 Location. Now getter and setter store location correctly.
3919 (errors/cs0111-12.cs now reports the expected location.)
3921 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3923 * driver.cs : Use default encoding on the environment.
3924 Removed (now that) extra parameter for SeekableStreamReader.
3925 * support.cs : (SeekableStreamReader) third .ctor() argument for
3926 StreamReader is not required (always true). preamble size could
3927 be acquired in simpler and safe way.
3929 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3931 * cs-parser.jay: report CS0642 at warning level 3
3932 and report CS0642 for an if else statement also
3933 fixes bug #74745. Patch by John Luke (and a bit
3935 Removed extra CS0642 warning check for "while",
3937 * statement.cs: In Block.Resolve(), CS0642 check
3938 is reimplemented to check a sequence of an empty
3939 statement and a block.
3941 Both fix bug #66777.
3943 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3945 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3946 detection until I fix it.
3948 * cs-tokenizer.cs: Changed error message.
3950 * cs-parser.jay: Fixed 2 error locations.
3952 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3953 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3956 * enum.cs (GetSignatureForError): Fixed.
3958 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3962 * typemanager.cs (RegisterProperty): Removed.
3964 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3966 2005-08-24 Raja R Harinath <rharinath@novell.com>
3969 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3970 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3972 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3974 * expression.cs : tiny fix is required for not warning positive ulong.
3977 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3979 * expression.cs : add CS0652 check for constant and integral
3980 expression. Fixed bug #53974.
3982 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3984 * expression.cs : in DoNumericPromotions(), check if there is implicit
3985 conversion overload for string (to check CS0034). Fixed bug #52492.
3987 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3989 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3991 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3993 * ecore.cs : report location when it is *not* Null.
3995 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4001 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4002 correctly. Fixed bug #75721.
4004 2005-08-23 Raja R Harinath <rharinath@novell.com>
4006 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4007 loop that performs 'min (pos, char_count)'.
4010 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4011 converted value in Operator.OnesComplement.
4013 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4015 * anonymous.cs: If the anon method is pulled into a helper class,
4016 it needs to be `internal' not `private'. Fixes runtime behavior on
4019 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4022 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4025 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4027 The big constants rewrite
4028 Fix #75746, #75685 and more
4029 As a side effect saved 1MB for MWF ;-)
4031 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4032 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4033 enum based for corlib compilation.
4035 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4038 * class.cs (FixedField.Define): Use ResolveAsConstant.
4040 * const.cs (IConstant): Interface constants and enums.
4041 (Const.ResolveValue): New method for constant resolvning.
4042 (ExternalConstant): Constants from imported assemblies.
4044 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4045 conversion; like enums.
4046 (Constant.ToType): Converts this constant to different type.
4047 (Constant.Increment): Adds 1.
4049 * convert.cs (ImplicitConversionRequired): Simplified.
4051 * cs-parser.jay: Create EnumMember directly.
4053 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4055 * doc.cs (GenerateEnumDocComment): Removed.
4057 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4058 (ConvertIntLiteral): Removed.
4059 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4061 * enum.cs (EnumMember): Implement IConstant.
4062 (Enum.IsValidEnumConstant): Removed.
4063 (Enum.GetNextDefaultValue): Removed.
4064 (Enum.FindMembers): Updated.
4065 (Enum.GenerateDocComment): Iterate enum members.
4067 * expression.cs (Cast.TryReduce): Handle enums correctly.
4068 (New.Constantify): Made public.
4069 (MemberAccess.DoResolve): Removed contant specific if(s).
4071 * literal.cs (NullLiteral): Implement new abstract methods.
4073 * statement.cs (GotoCase.Resolve): Use new constant methods.
4074 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4076 * typemanager.cs (LookupEnum): Removed.
4077 (IsEnumType): Fixed to work with corlib.
4078 (RegisterConstant): Removed.
4079 (LookupConstant): Removed.
4080 (GetConstant): Changed to work with IConstant.
4082 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4084 * location.cs : Fixed overflown (>255) column number.
4086 2005-08-03 Raja R Harinath <rharinath@novell.com>
4088 First cut of the qualified-alias-member feature.
4089 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4091 * cs-parser.jay (DOUBLE_COLON): New token.
4092 (namespace_or_type_name): Add rule for recognizing
4093 qualified-alias-members.
4094 (primary_expression): Likewise.
4095 (element_access): Allow QualifiedAliasMember as a possible
4096 type-bearing expression.
4097 (local_variable_type, local_variable_pointer_type): Likewise.
4098 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4099 aliases in the current and enclosing namespace declarations.
4100 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4101 * decl.cs (MemberName.is_double_colon): New.
4102 (MemberName.MemberName): Add new constructor for alias-member.
4103 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4104 * expression.cs (QualifiedAliasMember): New expression type.
4106 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4108 * location.cs : it borked when no argument was specified.
4110 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4112 * location.cs : tiny ToString() format fix.
4114 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4116 * statement.cs : oops, it was missing.
4118 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4120 A set of fixes for precise line/column location.
4123 "token" field now holds a file/line "delta", a line number offset
4124 from the segment, and a column number. See also:
4125 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4126 December/009508.html
4127 Removed static IsNull. Use instance IsNull property instead.
4129 For some tokens it stores Location. For Identifier it stores
4130 LocatedToken which is a pair of string name and location.
4131 Column numbers are adjusted only at getChar().
4133 Use Location.ToString() for reporting (it now contains column).
4135 Largely modified to use LocatedToken instead of
4136 string (IDENTIFIER), and to acquire Location from some tokens.
4137 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4138 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4140 Now MemberName holds Location. DeclSpace.ctor() receives Location
4141 as a parameter. Removed extra parameters to all derived classes.
4142 Replaced Location.IsNull() with instance property.
4143 * assign.cs, expression.cs :
4144 Added .ctor() overload that omits Location.
4146 Added "nameEscaped" flag that indicates the identifier was escaped
4147 in the source file. This fixes bug #57047.
4149 2005-09-02 Martin Baulig <martin@ximian.com>
4151 * class.cs: Make CS3005 a warning, not an error.
4153 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4155 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4156 New method, looking for lo-case imported cls type.
4158 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4161 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4163 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4165 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4167 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4169 Optimized to save 3.5 MB for SWF compilation.
4171 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4173 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4174 (PartialContainer.Create): Moved logic AddToContainer.
4175 (PartialContainer.MarkForDuplicationCheck): Shares name.
4177 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4180 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4182 (Namespace.GetSignatureForError): New method.
4184 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4185 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4187 2005-08-01 Raja R Harinath <rharinath@novell.com>
4190 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4191 member lookup rather than qualifier_type, since qualifier_type can
4194 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4196 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4199 2005-07-31 Miguel de Icaza <miguel@novell.com>
4201 * statement.cs: Copy the local exception into the exception
4202 captured local. Fixes 75674
4204 2005-07-31 Raja R Harinath <harinath@gmail.com>
4207 * expression.cs (Invocation.OverloadResolve): Don't report error
4208 CS1501 if error CS1502 has been reported.
4209 (New.DoResolve): Delegate CS1501 reporting to
4210 Invocation.OverloadResolve.
4213 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4214 invariant-meaning-in-block property in an enclosing block if
4217 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4219 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4220 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4221 (Switch.CheckSwitch): Just save 50kb for SWF.
4223 2005-07-27 Martin Baulig <martin@ximian.com>
4225 * anonymous.cs (CaptureContext.AddField): Added
4226 `AnonymousContainer am' argument; compute its toplevel scope if
4227 it's not already computed. Fixes #75649.
4229 2005-07-26 Raja R Harinath <rharinath@novell.com>
4232 * class.cs (Constructor.Emit): Reset block to null if the block
4235 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4237 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4239 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4241 * class.cs (MethodData.Define): Check whether accessor implementing
4242 interface is public.
4244 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4246 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4249 * namespace.cs (LookupType): Moved same type check to...
4251 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4254 2005-07-21 Raja R Harinath <rharinath@novell.com>
4256 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4257 already found a typebuilder.
4258 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4259 MemberNames, not strings.
4261 * const.cs (Error_ExpressionMustBeConst):
4262 Rename from Error_EpressionMustBeConst.
4263 * const.cs, class.cs, statement.cd: Update.
4265 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4269 * const.cs (Const.LookupConstantValue): Report missing contant expression
4271 (Error_EpressionMustBeConstant): Only one error method.
4273 * class.cs, statement.c: Updated.
4275 2005-07-20 Raja R Harinath <rharinath@novell.com>
4277 * statement.cs (Block.Flags): Add back HasVarargs.
4278 (Block.flags): Make protected.
4279 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4281 * typemanager.cs (types, typecontainers, user_types): Remove.
4282 (UserTypes, TypeContainers): Likewise.
4283 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4284 (CleanUp, Reset): Update.
4285 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4286 (GetNestedType): Use Type.GetNestedType.
4287 (CoreLookupType): Take two arguments, the namespace and the
4288 basename of the type. Update to use the Namespace.Lookup
4290 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4291 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4292 string concatenation and substring matches.
4293 * class.cs, enum.cs, delegate.cs: Update to changes.
4295 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4297 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4298 Expression and made virtual.
4300 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4301 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4303 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4305 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4308 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4311 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4314 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4315 AssemblyCultureAttribute is not used on executable.
4318 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4320 2005-07-16 Raja R Harinath <rharinath@novell.com>
4323 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4324 New. Reports CS0252/CS0253.
4325 Mostly taken from preliminary patch by Duncak Mak.
4326 (Binary.DoResolveOperator): Store results of operator lookup.
4327 Use them to detect if we need to warn about unintended reference
4330 2005-07-15 Raja R Harinath <rharinath@novell.com>
4333 * namespace.cs (Namespace.Lookup): Add back location parameter.
4334 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4335 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4337 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4338 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4339 (Namespace.LookupType): ... this.
4340 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4342 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4343 purported to handle pointers.
4344 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4347 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4349 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4352 2005-07-15 Raja R Harinath <rharinath@novell.com>
4354 * namespace.cs (Namespace.Lookup): Drop location parameter.
4355 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4356 (NamespaceEntry.Lookup): ... this.
4357 (NamespaceEntry.Error_AmbiguousTypeReference):
4358 Move here from DeclSpace.
4359 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4361 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4362 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4363 Move to NamespaceEntry.
4364 * delegate.cs, expression.cs: Update to changes.
4366 2005-08-31 Martin Baulig <martin@ximian.com>
4368 Committing a patch from Atsushi Enomoto for #75850.
4370 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4371 Prefer a generic enumerator over a non-generic one.
4373 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4375 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4376 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4378 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4380 * driver.cs : reverting default encoding change as well as mcs.
4382 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4384 * driver.cs, support.cs : merged r48826.
4386 > could you integrate your mcs changes to gmcs otherwise
4387 > gmcs cannot compile some files.
4389 2005-08-20 Martin Baulig <martin@ximian.com>
4391 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4392 scope if we don't already have it.
4394 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4395 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4398 2005-07-31 Miguel de Icaza <miguel@novell.com>
4400 * statement.cs: Copy the local exception into the exception
4401 captured local. Fixes 75674
4403 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4405 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4408 2005-08-12 Martin Baulig <martin@ximian.com>
4410 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4411 for nested types here to avoid hitting the cache too early.
4413 2005-08-09 Miguel de Icaza <miguel@novell.com>
4415 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4418 2005-08-03 Martin Baulig <martin@ximian.com>
4420 Make iterators in generic methods work; see gtest-191.cs.
4423 (Constraints.Resolve): Protect against being called twice.
4426 (TypeContainer.GetClassBases): Make this `protected virtual'.
4428 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4429 (Iterator.GetClassBases): Override this and compute the base
4431 (Iterator.DefineNestedTypes): If we're a generic method, all our
4432 method type parameters become class type parameters on the proxy
4436 (ToplevelBlock.Parameters): Make this a property, not a field.
4437 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4439 2005-08-03 Martin Baulig <martin@ximian.com>
4441 * typemanager.cs (TypeManager.IsSubclassOf): Use
4442 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4443 (TypeManager.GetFullName_recursed): Improved.
4445 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4448 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4449 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4450 invocation_type == mi.DeclaringType, since the first one also checks
4451 other condition used by generic instances.
4453 2005-07-27 Martin Baulig <martin@ximian.com>
4455 * anonymous.cs (CaptureContext.AddField): Added
4456 `AnonymousContainer am' argument; compute its toplevel scope if
4457 it's not already computed. Fixes #75649.
4459 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4461 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4462 CheckAttributeType and refactored.
4463 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4464 ResolveAsTypeTerminal error handling.
4465 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4467 (GetSignatureForError): Print errors in same way.
4470 * codegen.cs: Reflect attribute GetSignatureForError change.
4473 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4475 * namespace.cs (UsingEntry): Refactored to make fields private.
4478 statement.cs: Error_UnexpectedKind has extra parameter.
4480 2005-07-14 Raja R Harinath <rharinath@novell.com>
4482 * ecore.cs (IAlias): Remove.
4483 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4484 that implement the interface.
4485 * namespace.cs (Namespace): Likewise.
4486 (Namespace.declspaces): Renamed from 'defined_names'.
4487 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4488 DeclSpace instead of an IAlias.
4489 * tree.cs (Tree.AddDecl): Update.
4491 2005-07-12 Raja R Harinath <rharinath@novell.com>
4493 * statement.cs (Block.Flags); Remove HasVarargs.
4494 (Block.HasVarargs): Move to ToplevelBlock.
4495 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4496 (Block.Variables): Make protected. Initialize variable hashtable
4498 (Block.AddVariable): Update.
4499 (Block.Resolve): Update to changes.
4500 (ToplevelBlock.HasVarargs): New boolean.
4501 (ToplevelBlock.ThisVariable): Move here from Block.
4502 (ToplevelBlock.AddThisVariable): Likewise.
4503 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4504 * expression.cs (This.ResolveBase): Update to changes.
4505 (ArglistAccess.DoResolve): Likewise.
4507 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4510 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4512 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4513 not used and not used & assigned.
4514 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4516 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4519 * expression.cs (Is.DoResolve): null is never provided type.
4521 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4524 * cs-parser.jay: Less strict event error rule to catch more errors.
4526 2005-07-11 Martin Baulig <martin@ximian.com>
4528 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4529 for the constructor constraint: we do not only have to check
4530 whether the class has a public constructor, but also ensure that
4531 it's parameterless. Fixes #75492.
4533 2005-07-11 Martin Baulig <martin@ximian.com>
4535 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4536 between type parameters if they either have the reference type
4537 constraint or the class constraint.
4539 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4541 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4543 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4546 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4547 (ExtractSecurityPermissionSet): Cope with self referencing security
4548 attributes properly.
4550 * driver.cs (SetOutputFile): Made public property OutputFile.
4552 2005-07-07 Raja R Harinath <rharinath@novell.com>
4555 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4556 has_nonstatic_fields. Make into a FieldBase pointer.
4557 (TypeContainer.AddField): Add CS0282 check.
4558 (TypeContainer.EmitType): Update.
4560 2005-07-06 Miguel de Icaza <miguel@novell.com>
4562 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4563 compare if they start with __.
4565 2005-07-06 Raja R Harinath <rharinath@novell.com>
4567 * statement.cs (Switch.SwitchGoverningType): Only look at
4568 UserCasts that don't need implicit standard conversions to one of
4569 the allowed switch types (Fixes test-322.cs).
4570 (LocalInfo.Resolve): Re-enable sanity-test.
4572 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4574 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4576 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4578 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4580 2005-07-06 Raja R Harinath <rharinath@novell.com>
4583 * ecore.cs (SimpleName.GetSignatureForError): Add.
4584 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4585 (MemberAccess.GetSignatureForError): Add.
4587 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4589 The big error and warning messages review.
4619 * typemanager.cs: Updated.
4621 * class.cs: (MethodCore.SetYields): Moved here to share.
4622 (PropertyMethod.Define): Moved iterator setup here.
4624 * iterators.cs: Add orig_method to have full access to parent
4627 2005-07-05 Raja R Harinath <rharinath@novell.com>
4629 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4630 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4631 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4632 variable of struct type.
4633 * expression.cs (Unary.ResolveOperator): Update to change.
4634 (Indirection.VerifyFixed): Likewise.
4635 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4636 (ParameterReference.VerifyFixed): Value parameters are fixed.
4637 (This.VerifyFixed): Treat 'this' as a value parameter.
4638 * statement.cs (LocalInfo.IsFixed): Remove.
4640 2005-07-01 Martin Baulig <martin@ximian.com>
4642 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4643 `ec.EmitThis ()' to get the correct scope.
4645 2005-07-01 Martin Baulig <martin@ximian.com>
4647 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4648 instance is a ParameterReference; fixes #75299.
4650 2005-06-30 Raja R Harinath <rharinath@novell.com>
4653 * expression.cs (Indexers.map): Remove.
4654 (Indexers.Append): Filter out inaccessible setters and getters.
4655 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4658 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4660 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4661 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4662 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4663 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4665 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4668 * class.cs (FieldBase.GetInitializerExpression): One more field
4671 2005-06-28 Miguel de Icaza <miguel@novell.com>
4673 * pending.cs: Do not define a proxy if the base method is virtual,
4674 it will be picked up by the runtime (bug 75270).
4676 2005-07-08 Martin Baulig <martin@ximian.com>
4678 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4679 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4681 2005-07-07 Martin Baulig <martin@ximian.com>
4683 * generic.cs (ConstructedType.CheckConstraint): Use
4684 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4685 called recursively; fixes #75329.
4687 2005-07-06 Martin Baulig <martin@ximian.com>
4689 * generic.cs (TypeManager.InferTypeArguments): Added support for
4690 anonymous methods; fixes #75461.
4692 2005-07-01 Martin Baulig <martin@ximian.com>
4694 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4695 `ec.EmitThis ()' to get the correct scope.
4697 2005-07-01 Martin Baulig <martin@ximian.com>
4699 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4700 instance is `This'; fixes #75299.
4702 2005-06-30 Martin Baulig <martin@ximian.com>
4704 * class.cs (Indexer): Implement IIteratorContainer; added support
4705 for iterators in indexers.
4708 (EmitContext.CurrentIterator): Make this a property, not a field.
4710 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4712 2005-06-28 Miguel de Icaza <miguel@novell.com>
4714 * pending.cs: Do not define a proxy if the base method is virtual,
4715 it will be picked up by the runtime (bug 75270).
4717 2005-06-28 Martin Baulig <martin@ximian.com>
4719 * cs-parser.jay (interface_method_declaration): Avoid a
4720 reduce/reduce conflict by moving some of the code into a separate
4721 `interface_method_declaration_body' rule; fixes #75368.
4723 2005-06-28 Martin Baulig <martin@ximian.com>
4725 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4726 array check after the check for TypeBuilder's.
4728 2005-06-21 Raja R Harinath <rharinath@novell.com>
4730 * convert.cs (FindMostEncompassedType): Add two trivial special
4731 cases (number_of_types == 0 || number_of_types == 1).
4732 (FindMostEncompasingType): Likewise.
4734 2005-06-17 Raja R Harinath <rharinath@novell.com>
4736 Some cleanups preparing for the fix of #75283.
4737 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4739 (EventExpr.InstanceResolve): Likewise.
4740 (EventExpr.DoResolve): Remove redundant checks.
4742 2005-06-08 Miguel de Icaza <miguel@novell.com>
4744 * class.cs: Small fix.
4746 2005-06-08 Raja R Harinath <rharinath@novell.com>
4749 * class.cs (GetPartialBases): Fix return value check of
4752 2005-06-07 Raja R Harinath <rharinath@novell.com>
4754 Ensure that partial classes are registered in their enclosing
4755 namespace. Initial part of fix of #75160.
4756 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4757 Register declspace with namespace here, not in
4758 DeclSpace.RecordDecl.
4759 * cs-parser.jay: Pass namespace to RecordDecl.
4760 * class.cs (PartialContainer.Create): Likewise.
4761 (ClassPart.DefineType): New sanity-check. Throws an exception if
4763 * decl.cs (Declspace.RecordDecl): Remove.
4764 * namespace.cs (NamespaceEntry.DefineName): Remove.
4766 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4768 * rootcontext.cs: Reset TargetExt as well.
4770 2005-06-03 Raja R Harinath <rharinath@novell.com>
4772 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4775 2005-06-02 Raja R Harinath <rharinath@novell.com>
4777 Fix #75080, cs0119.cs.
4778 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4780 (Expression.Resolve): ... this. Use it. Remove bogus code
4781 allowing ExprClass.Type and ExprClass.Namespace for
4782 ResolveFlags.VariableOrValue.
4783 (Expression.Resolve) [1-argument variant]: Change default resolve
4784 flags based on language version.
4785 (Expression.Error_UnexpectedKind): Use a simple string array
4786 rather than an ArrayList.
4787 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4789 (TypeOfVoid.DoResolve): Likewise.
4790 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4791 flags argument -- it always has the same value.
4793 2005-05-31 Raja R Harinath <rharinath@novell.com>
4796 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4797 Use it in the error message.
4798 * assign.cs, expression.cs, statement.cs: Update.
4800 2005-05-30 Raja R Harinath <rharinath@novell.com>
4803 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4804 the "almostMatchedMember" case too.
4805 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4806 that failed the accessibility checks to 'almost_match'.
4808 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4810 * attribute.cs: Use internal MethodBuilder methods to set
4811 ExactSpelling and SetLastError on PInvoke methods, instead
4812 of passing them via charset. Fixes #75060.
4814 2005-05-27 Raja R Harinath <rharinath@novell.com>
4816 * parameter.cs (Parameter): Remove TODO comment.
4817 (Parameter.DefineParameter): Remove Location parameter.
4818 (Parameters.LabelParameters): Likewise.
4819 * class.cs (Constructor.Emit): Update to change.
4820 (MethodData.Emit): Likewise.
4821 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4822 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4824 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4827 Removed Parameters.Location and added Parameter.Location instead.
4828 Removed Location parameter from Emit() and GetSignature().
4835 Modified all related calls.
4837 2005-06-21 Martin Baulig <martin@ximian.com>
4839 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4840 left-hand side is not a nullable type; fixes #75328.
4842 2005-06-21 Martin Baulig <martin@ximian.com>
4845 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4846 (TypeManager.GetFullNameSignature): Likewise.
4848 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4849 `source.FullName' and `target.FullName' to check whether there are
4850 two conflicting definitions.
4852 2005-06-21 Martin Baulig <martin@ximian.com>
4854 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4855 a BoxedCast - also for reference types - to be compatible with csc.
4857 2005-06-21 Martin Baulig <martin@ximian.com>
4859 * expression.cs (MemberAccess.DoResolve): Add support for nested
4860 types in a generic instance; fixes #75320.
4862 2005-06-20 Martin Baulig <martin@ximian.com>
4864 * generic.cs (TypeManager.InferType): Also walk the class
4865 hierarchy for generic instances; fixes #75261.
4867 2005-06-17 Martin Baulig <martin@ximian.com>
4869 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4870 to make things work for corlib.
4872 2005-06-15 Martin Baulig <martin@ximian.com>
4874 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4875 obsolete `SecurityAction' values.
4877 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4879 * rootcontext.cs: Reset TargetExt as well.
4881 2005-06-09 Martin Baulig <martin@ximian.com>
4883 * delegate.cs (Delegate.VerifyMethod): Added
4884 `MethodGroupExpr old_mg' argument; inherit its
4885 `HasTypeParameters'; fix #75085.
4887 2005-06-09 Martin Baulig <martin@ximian.com>
4889 * expression.cs (Invocation.OverloadResolve): Correctly handle
4890 generic methods for the SetMemberIsUsed(); fix #75064.
4892 2005-06-09 Martin Baulig <martin@ximian.com>
4894 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4897 2005-06-08 Martin Baulig <martin@ximian.com>
4899 * cs-parser.jay (nullable_type_or_conditional): If we put the
4900 nullable back and our `type' is a `ComposedCast', remove the
4901 nullable from it. Fixes #75156.
4903 * expression.cs (ComposedCast.RemoveNullable): New public method.
4905 2005-06-08 Martin Baulig <martin@ximian.com>
4907 The big Iterators rewrite :-)
4909 * iterators.cs: Rewrite this to use the anonymous methods framework.
4911 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4912 before the TypeContainers; see 2test-21.cs.
4915 (TypeContainer.DefineType): Don't create a new EmitContext if we
4916 already have one (this only happens if we're an Iterator).
4917 (TypeContainer.Define): Also call Define() on all our iterators.
4918 (Method.CreateEmitContext): Added support for iterators.
4921 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4922 (AnonymousContainer.CreateMethodHost): Moved here from
4923 AnonymousMethod and made abstract.
4924 (AnonymousContainer.CreateScopeType): New abstract method.
4925 (AnonymousContainer.IsIterator): New public property.
4926 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4927 get the ScopeTypeBuilder rather than manually defining it here.
4928 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4931 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4932 before RootContext.DefineTypes().
4934 * codegen.cs (EmitContext.RemapToProxy): Removed.
4935 (EmitContext.CurrentAnonymousMethod): Changed type from
4936 AnonymousMethod -> AnonymousContainer.
4937 (EmitContext.ResolveTopBlock): Protect from being called twice.
4938 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4939 (EmitContext.EmitThis): Removed the iterators hacks; use the
4940 anonymous methods framework for that.
4943 (ToplevelBlock.Container): Make this a property, not a field.
4944 (ToplevelBlock.ReParent): New public method; move the
4945 ToplevelBlock into a new container.
4946 (Foreach.TemporaryVariable): Simplify.
4948 2005-06-05 Martin Baulig <martin@ximian.com>
4950 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4951 (Block.AddTemporaryVariable): New public method; creates a new
4952 `LocalInfo' for a temporary variable.
4953 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4955 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4956 non-iterator variables.
4958 2005-06-05 Martin Baulig <martin@ximian.com>
4960 * statement.cs (Foreach.TemporaryVariable): Create the
4961 LocalBuilder in the Emit phase and not in Resolve since in some
4962 situations, we don't have an ILGenerator during Resolve; see
4963 2test-19.cs for an example.
4965 2005-06-04 Martin Baulig <martin@ximian.com>
4967 The big Foreach rewrite - Part II.
4969 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4970 with `PropertyInfo ienumerator_getcurrent'.
4972 * codegen.cs (VariableStorage): Removed.
4975 (Foreach): Derive from Statement, not ExceptionStatement.
4976 (Foreach.CollectionForeach): New nested class. Moved all the code
4977 dealing with collection foreach here.
4978 (Foreach.ForeachHelperMethods): Removed.
4979 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4981 2005-05-23 Martin Baulig <martin@ximian.com>
4983 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4984 don't need to. Fix #75014.
4986 2005-05-26 Raja R Harinath <rharinath@novell.com>
4988 Improve user-defined conversion handling.
4989 * convert.cs (GetConversionOperators): Rewrite. Return only the
4990 applicable operators.
4991 (AddConversionOperators): New. Helper for GetConversionOperators.
4992 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4993 there is only one most encompassed/encompassing type.
4994 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4995 "applicable operator" handling.
4996 (UserConversion): Move cache here from GetConversionOperators.
4997 Directly cache the chosen operator, rather than the whole
4999 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5000 case. Allow conversion of decimal to sbyte and byte too.
5001 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5002 New static methods. Used to avoid allocating EmptyExpressions in
5005 2005-05-24 Duncan Mak <duncan@novell.com>
5007 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5008 another class, used in Convert.ExplicitNumericConversion.
5009 (CastToDecimal): New class, similar to above, but casts to
5010 System.Decimal, used in Convert.ImplicitNumericConversion and also
5011 in explicit convesion from double/float to decimal.
5013 * convert.cs (ImplicitNumericConversion): Handle implicit
5014 conversions to System.Decimal.
5015 (ExplicitNumericConversion): handle explicit conversions to
5020 2005-05-20 Miguel de Icaza <miguel@novell.com>
5022 * typemanager.cs: Do not throw an exception in the TypeBuilder
5023 case, we take care of it on the TypeCode.
5025 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5027 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5030 * cs-parser.jay: Catch more lexical errors.
5032 * report.cs: Add one more Error method.
5035 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5037 2005-05-20 Martin Baulig <martin@ximian.com>
5039 * class.cs (TypeContainer.CircularDepException): Removed.
5040 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5041 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5042 (CS0146) and interface (CS0529) dependencies here.
5044 2005-05-20 Martin Baulig <martin@ximian.com>
5046 * expression.cs (New.DoResolve): Move the CS0712 check above the
5047 CS0144 check; otherwise it can never be reached.
5049 2005-05-20 Martin Baulig <martin@ximian.com>
5051 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5053 2005-05-20 Martin Baulig <martin@ximian.com>
5055 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5057 * typemanager.cs (TypeManager.IsAttributeType): New public method.
5059 2005-05-19 Martin Baulig <martin@ximian.com>
5062 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5063 to disable error reporting.
5065 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5066 here since we don't want to report an error; see the new test-336.cs.
5068 2005-05-19 Raja R Harinath <rharinath@novell.com>
5070 * statement.cs (ToplevelBlock.GetParameterReference)
5071 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5072 Move here from class Block.
5073 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5074 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5076 2005-05-18 Martin Baulig <martin@ximian.com>
5081 (FlowBranching.Reachability): Add non-static public And() and Or()
5083 (FlowBranchingSwitch): New class; do the `break_origins' thing
5084 like in FlowBranchingLoop.
5085 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5086 reachability, not just locals and parameters.
5087 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5088 switch; MergeBreakOrigins() now takes care of that.
5090 2005-05-18 Martin Baulig <martin@ximian.com>
5092 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5093 a loop and may leave it, reset the barrier; fixes #74974.
5095 2005-05-16 Raja R Harinath <rharinath@novell.com>
5097 Fix test-382.cs. Emit values of decimal constants.
5098 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5100 (TypeContainer.AddField): ... this.
5101 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5102 with initializers to include 'Const's.
5103 (ClassPart.RegisterFieldForInitialization): Forward to
5105 * const.cs (Const.Const): Pass initializer to base class.
5106 (Const.Define): In case of decimal constants, register them for
5107 initialization in a static constructor.
5109 2005-05-14 Martin Baulig <martin@ximian.com>
5111 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5112 do not call ResolveUnreachable() on unreachable statements in
5113 here, see the comment in the source code.
5115 2005-05-13 Raja R Harinath <rharinath@novell.com>
5118 * expression.cs (BinaryResolveOperator): If one of the operands of
5119 an equality comparison is 'null' and the other is a pointer type,
5120 convert the null to a NullPointer.
5121 * convert.cs (ImplicitReferenceConversion): If the expression is a
5122 NullLiteral and the target type is a pointer type, return a
5123 NullPointer instead.
5124 (ImplicitConversionStandard): Likewise.
5126 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5128 * cs-parser.jay: Set readonly context based on special constructs.
5130 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5131 readonly variable error handling.
5133 * rootcontext.cs (EmitCode): Don't verify members when error
5136 * statement.cs (LocalInfo): Add reaodnly context information.
5137 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5139 2005-05-17 Martin Baulig <martin@ximian.com>
5141 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5144 2005-05-13 Martin Baulig <martin@ximian.com>
5146 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5147 handle unreachable blocks.
5149 2005-05-13 Martin Baulig <martin@ximian.com>
5152 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5153 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5156 2005-05-13 Martin Baulig <martin@ximian.com>
5158 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5159 instance variable, not a local. Fix #74873.
5160 (Block.ResolveUnreachable): Set it to true here.
5162 2005-05-12 Martin Baulig <martin@ximian.com>
5164 * cs-parser.jay (property_declaration): Pass the `current_class',
5165 not the `current_container' to Property's .ctor. Fixes #74912.
5167 2005-05-11 Martin Baulig <martin@ximian.com>
5169 * typemanager.cs (Closure): Copy this from MCS and merge all the
5170 GMCS-specific changes into it.
5172 2005-05-12 Raja R Harinath <harinath@gmail.com>
5175 * typemanager.cs (unmanaged_enclosing_types): New.
5176 (IsUnmanagedType): Avoid infloops by using
5177 'unmanaged_enclosing_types' to talk with recursive invocations.
5179 2005-05-11 Duncan Mak <duncan@novell.com>
5181 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5182 continuing to process for 'arg'.
5183 (handle_preprocessing_directive): Check the argument of the #endif
5184 directive and report error CS1025 if there are any trailing
5187 According to the C# spec, having even whitespace after the #endif
5188 directive is illegal; however, because we call arg.TrimEnd ()
5189 beforehand, we have the same behavior as csc, allowing whitespace
5190 after the directive.
5194 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5198 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5199 (Constructor.GetObsoleteAttribute): Implemented correctly.
5201 2005-05-10 Martin Baulig <martin@ximian.com>
5203 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5204 resolve the type; fixes #74864.
5205 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5206 in DoResolve(); fixes #74862.
5208 2005-05-10 Martin Baulig <martin@ximian.com>
5210 * support.cs (ReflectionParameters.ParameterModifier): Use
5211 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5212 and `ParameterAttributes.In'. Fixes #74884.
5214 2005-05-10 Martin Baulig <martin@ximian.com>
5216 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5217 the cache if we're just looking for `MemberTypes.NestedType' in a
5220 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5221 constraints if we're still resolving the type tree.
5222 (Expression.MemberLookup): If we're resolving the type tree, only
5223 look for `MemberTypes.NestedType' since we're only interested in
5226 * class.cs (TypeContainer.DefineType): Don't resolve the type
5227 parameters here; do this later in ResolveType() after the type
5228 tree has been resolved.
5229 (TypeContainer.ResolveType): New public method; this is called
5230 after the type tree is resolved and before the types are being
5231 populated. We resolve the generic constraints here.
5232 (TypeContainer.DoDefineMember): Check the constraints on our base
5233 class and interfaces.
5235 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5236 set the `ResolvingTypeTree' flag on the EmitContext.
5238 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5240 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5242 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5244 * expression.cs (Argument.GetParameterModifier): Turned to property.
5245 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5247 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5250 2005-05-09 Raja R Harinath <rharinath@novell.com>
5253 * decl.cs (MemberCache.AddMethods): Register override methods,
5254 rather than non-override methods.
5255 * typemanager.cs (RegisterOverride): New.
5256 (IsOverride): Update.
5258 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5260 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5262 2005-05-06 Martin Baulig <martin@ximian.com>
5265 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5266 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5268 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5272 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5273 recursive declaration.
5275 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5277 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5279 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5281 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5283 2005-05-05 Raja R Harinath <rharinath@novell.com>
5286 * decl.cs (DeclSpace.FamilyAccessible):
5287 Use TypeManager.IsNestedFamilyAccessible.
5289 Fix reopened #64812.
5290 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5293 2005-05-04 Raja R Harinath <rharinath@novell.com>
5294 Abin Thomas <projectmonokochi@rediffmail.com>
5295 Anoob V E <projectmonokochi@rediffmail.com>
5296 Harilal P R <projectmonokochi@rediffmail.com>
5299 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5300 allow access to all static members.
5302 2005-05-04 Martin Baulig <martin@ximian.com>
5304 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5306 2005-05-04 Martin Baulig <martin@ximian.com>
5310 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5311 section at the end; make things work if `default' is not the last
5314 2005-05-04 Martin Baulig <martin@ximian.com>
5318 * statement.cs (Switch): Replaced the `got_default' field with a
5319 `default_section' one.
5320 (Switch.CheckSwitch): Set `default_section' here.
5321 (Switch.Resolve): If we're a constant switch and the constant is
5322 not found, use the default section.
5324 2005-05-03 Martin Baulig <martin@ximian.com>
5326 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5328 * statement.cs (Foreach.ArrayForeach): New nested class.
5329 (Foreach.TemporaryVariable): New nested class.
5330 (Foreach.EmitArrayForeach): Removed; this is now in the new
5333 2005-05-03 Raja R Harinath <rharinath@novell.com>
5335 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5337 (VerifyPendingMethods): Revert change below.
5339 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5340 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5341 that used to trigger warning -28. Remove warning -28.
5342 * expression.cs (Invocation.OverloadResolve): Use
5343 TypeManager.IsOverride to distinguish override methods.
5346 * pending.cs (VerifyPendingMethods): If a base type implements the
5347 requested interface, don't bother checking individual methods of
5348 the base type. As a side-effect, this prevents the creation of
5349 unnecessary proxies.
5351 2005-05-02 Martin Baulig <martin@ximian.com>
5355 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5356 Also `And' the locals if the old vector is null.
5357 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5358 null; in this case we basically reset all the variables.
5360 2005-05-02 Martin Baulig <martin@ximian.com>
5364 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5365 Added `FlowBranching branching' argument; always `and' the
5366 variables instead of `or'ing them unless we're an infinite loop.
5368 * statement.cs (While.Resolve): Create a new sibling unless we're
5371 2005-05-02 Martin Baulig <martin@ximian.com>
5375 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5376 arguments; use it instead of creating a new TopLevelBlock.
5377 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5378 our ConstructorInitializer.
5381 (TopLevelBlock.TopLevelBranching): New public property.
5382 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5383 and create our `TopLevelBranching'.
5385 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5386 anonymous method host, use `block.TopLevelBranching' rather than
5387 creating a new branching.
5389 2005-04-20 Miguel de Icaza <miguel@novell.com>
5391 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5392 a ScopeInfo, if any of the current children is a child of the new
5393 entry, move those children there.
5395 2005-04-30 Martin Baulig <martin@ximian.com>
5397 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5398 at the beginning of a SwitchSection. Fix #73335.
5400 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5403 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5405 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5406 (FieldExpr.DoResolve): Obsolete members are ignored for field
5409 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5411 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5412 of arrays detection.
5414 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5416 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5418 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5421 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5423 * cs-parser.jay: Use the prefered version of -unsafe in error
5426 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5428 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5431 2005-04-20 John Luke <john.luke@gmail.com>
5433 * driver.cs: fix typo in error message, --outout to --output
5435 2005-04-30 Martin Baulig <martin@ximian.com>
5437 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5438 handle the .NET 2.x security attributes.
5440 2005-04-30 Martin Baulig <martin@ximian.com>
5443 (TypeManager.ExpandInterfaces): Don't add things twice.
5446 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5448 2005-04-29 Martin Baulig <martin@ximian.com>
5450 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5452 * anonymous.cs: Added support for anonymous generic methods.
5454 2005-04-29 Martin Baulig <martin@ximian.com>
5456 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5459 2005-04-29 Martin Baulig <martin@ximian.com>
5461 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5463 * expression.cs (New.DoResolve): Fix the CS0304 check.
5465 2005-04-29 Martin Baulig <martin@ximian.com>
5467 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5470 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5471 explicit interface implementation, compare the interface types.
5472 (MethodData.Define): Use the new naming scheme from the latest
5474 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5476 * decl.cs (MemberName.GetMemberName): Removed.
5477 (MemberName.MethodName, FullName): New properties.
5479 2005-04-25 Raja R Harinath <rharinath@novell.com>
5481 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5483 2005-04-22 Martin Baulig <martin@ximian.com>
5485 * generic.cs (GenericMethod): Create the EmitContext in the
5486 `Define()'; in `Define(MethodBuilder)', create the type parameters
5487 before calling `Define()'. Fixes #73933.
5489 2005-04-22 Martin Baulig <martin@ximian.com>
5492 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5493 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5495 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5496 ConstructedType, check its constraints.
5498 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5500 * codegen.cs (InRefOutArgumentResolving): New field.
5502 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5503 fields outside contructor.
5505 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5507 2005-04-19 Miguel de Icaza <miguel@novell.com>
5509 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5510 parameter code was not completed ever, so it was not as up-to-date
5511 as local variables. Must finish it.
5513 The bug fix was to compare the Toplevel of the block, not the
5514 current block. Thanks for Ben for pointing this out.
5516 2005-04-19 Raja R Harinath <rharinath@novell.com>
5518 * decl.cs (AddMethods): Use the declaring type of the problem
5519 method to determine if we want to squash a warning.
5521 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5523 * attribute.cs: Removed debug output.
5525 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5527 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5530 2005-04-18 Raja R Harinath <rharinath@novell.com>
5533 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5534 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5535 all null comparisons against reference types.
5537 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5540 * class.cs (TypeContainer.CircularDepException) New nested
5542 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5543 (TypeContainer.DefineType): Removed error, reset InTransit before
5545 (Class.DefineType): Throw exception when is in Transit.
5546 Catch exception and report error.
5547 (Struct.DefineType): Throw exception when is in Transit.
5548 Catch exception and report error.
5549 (Interface.DefineType): Throw exception when is in Transit.
5550 Catch exception and report error.
5552 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5553 handle nested exception handlers.
5555 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5558 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5559 InFinally and InCatch storage.
5561 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5562 (Catch.Resolve): Set and Restore ec.InCatch.
5563 (Try.Resolve): Set and Restore ec.InFinally.
5564 (Try.HasCatch): True when try has catch.
5566 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5568 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5569 for the same event member, so exclude such cases from warning 419.
5572 2005-04-16 Miguel de Icaza <miguel@novell.com>
5574 * expression.cs (Binary.ResolveOperator): Apply patch from John
5575 Luke to fix bug 59864: operators &, | and ^ on enumerations
5576 require that the same enum type on both sides.
5578 * driver.cs: Add warnings to old flag usage, this is to assist
5579 people who produce Makefiles and hope that the Makefiles will be
5582 * class.cs (TypeContainer.EmitType): Moved the definition of the
5583 special $PRIVATE$ field from the resolve phase to the Emit phase.
5584 During resolve we do not know if we are a struct with
5585 HasExplicitLayout, we know this only after the attributes for the
5588 Set the FieldOffset to zero on the dummy field that we create for
5589 the class. Fixes 74590.
5591 2005-04-16 Raja R Harinath <rharinath@novell.com>
5594 * ecore.cs (PropertyExpr.resolved): New.
5595 (DoResolve): Use it to handle a case of double resolution here.
5596 Handle a case of identical-name-and-type-name.
5597 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5598 resolution by storing the results of expression resolution back
5599 into the "probes" array.
5601 2005-04-15 Raja R Harinath <rharinath@novell.com>
5603 Fix cs0208-7.cs and cs0208-8.cs.
5604 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5605 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5606 error reporting to point out the reason a struct is not unmanaged.
5608 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5610 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5611 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5613 2005-04-13 Raja R Harinath <rharinath@novell.com>
5616 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5617 IdenticalNameAndTypeName here.
5618 (EventExpr.InstanceResolve): Likewise.
5620 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5622 C# 2.0 DefaultCharSetAttribute implementation
5624 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5625 which allows us to set GlobalNamespace for every resolve.
5626 (Attribute.ResolveArguments): Cut from Resolve.
5627 (Attribute.GetCharSetValue): Returns CharSet named argument.
5628 (Attribute.DefinePInvokeMethod): Gets default charset from
5630 (GlobalAttribute.ResolveAsTypeStep): Override.
5631 (GlobalAttribute.ResolveArguments): Override.
5633 * class.cs (TypeAttr): Is protected.
5635 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5636 (ModuleClass.DefaultCharSetType): New memeber.
5637 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5639 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5640 charset from module.
5642 * delegate.cs (TypeAttr): Override.
5643 (Delegate.DefineType): Use this TypeAttr.
5645 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5646 at very early stage (before types are defined) to resolve model
5647 module attributes. It will probably not work with corlib but it
5650 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5651 charset from module.
5653 * typemanager.cs (default_charset_type): New type.
5655 2005-04-13 Raja R Harinath <rharinath@novell.com>
5657 * decl.cs (MemberCache.AddMethods): Don't warn if
5658 System.Object.Finalize has buggy MethodAttributes.
5660 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5663 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5665 * doc.cs : detect ambiguous reference to overloaded members.
5666 Fixed bug #71603. MS 1.1 csc does not detect it.
5668 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5670 * doc.cs : delegates must not be referenced with parameters.
5673 2005-04-12 Miguel de Icaza <miguel@novell.com>
5675 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5677 2005-04-10 Miguel de Icaza <miguel@novell.com>
5679 * driver.cs (MainDriver): Stop processing if the CLS stage found
5682 (CompilerCallableEntryPoint.InvokeCompiler): Always
5683 reset after execution; Take a TextWriter argument for the
5686 * report.cs: Use the error stream instead of hardcoding stderr.
5688 2005-04-09 Miguel de Icaza <miguel@novell.com>
5690 * class.cs: Reduce code paths to test, too small of an
5691 optimization to make it worth the extra testing. Always perform
5694 2005-04-08 Raja R Harinath <rharinath@novell.com>
5697 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5698 operators that had errors reported on them.
5700 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5702 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5704 (Attribute.Resolve): Add named argument type checking.
5706 * class.cs (FixedField.Define): Use IsPrimitiveType
5708 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5710 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5711 unsafe parameter types.
5713 * statement.cs (Using.ResolveExpression): Add better error description.
5715 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5717 2005-04-08 Raja R Harinath <rharinath@novell.com>
5720 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5721 AttributeUsageAttribute in the emitcontext of the attribute class,
5722 not in the emitcontext of the attributable entity it was attached to.
5723 * cs-parser.jay: Use 'current_class', not 'current_container',
5724 when creating a GlobalAttribute.
5726 2005-04-08 Alp Toker <alp@atoker.com>
5728 * pending.cs: The fix to #58413 failed to compile methods implementing
5729 interfaces with/without params modifiers and vice versa, even though
5730 params modifiers aren't part of the signature. Make the modifier check
5731 less strict as in csc.
5733 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5734 Anoob V E <projectmonokochi@rediffmail.com>
5735 Harilal P R <projectmonokochi@rediffmail.com>
5738 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5739 modifiers of pending methods.
5740 (PendingImplementation.PendingImplementation): Initialize it.
5741 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5742 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5743 with ParameterData. Add check for modifiers.
5744 * class.cs (MethodData.Define): Update to changes.
5746 2005-04-07 Raja R Harinath <rharinath@novell.com>
5748 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5750 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5752 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5755 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5758 * typemanager.cs: Registered RequiredAttributeAttribute.
5760 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5762 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5763 Warning CS0169 is back at level 3.
5764 (IMethodData.SetMemberIsUsed): New method.
5766 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5767 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5769 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5771 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5773 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5776 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5779 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5780 to avoid the problems with nested types.
5782 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5783 Anoob V.E <projectmonokochi@rediffmail.com>
5784 Harilal P.R <projectmonokochi@rediffmail.com>
5785 Raja R Harinath <rharinath@novell.com>
5788 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5790 * typemanager (GetConstructor): Make public.
5792 2005-04-05 John Luke <john.luke@gmail.com>
5793 Raja R Harinath <rharinath@novell.com>
5796 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5797 struct too. Return false quicker in a few cases.
5798 (VerifyUnManaged): Use it.
5800 2005-04-05 Raja R Harinath <rharinath@novell.com>
5803 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5804 not 'unreachable_seen'.
5806 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5808 * attribute.cs (Attribute.GetValue): Removed unused.
5810 * codegen.cs (CodeGen.TrimExt): Removed unused.
5812 * cs-parser.jay (output): Removed unused.
5814 * cs-tokenizer.cs (hex_digits): Removed unused.
5816 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5818 * expression.cs (Indirection.LoadExprValue): Removed unused.
5819 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5821 * iterators.cs (Iterator.param_types): Removed unused.
5823 * statement.cs (Goto.block): Removed unused.
5824 (ToplevelBlock.did): Removed unused.
5825 (Switch.ResolveConstantSwitch): Removed unused.
5827 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5829 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5832 2005-04-19 Martin Baulig <martin@ximian.com>
5834 Merged r42462 from MCS and made it work for GMCS.
5836 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5838 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5840 2005-04-01 Raja R Harinath <rharinath@novell.com>
5842 Fix #74232 and cs0208-3.cs.
5843 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5844 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5845 unmanaged type. Don't use FieldBuilders when 't' is a
5846 TypeBuilder. Use ModFlags and MemberType fields.
5847 * class.cs (MemberBase.member_type): Rename from MemberType.
5848 (MemberBase.MemberType): New property. Determines member_type on
5850 (MemberBase.DoDefine): Don't initialize MemberType here.
5851 (FieldMember.Define): Likewise.
5853 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5856 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5857 Attributes are emitted there.
5859 2005-04-01 Raja R Harinath <rharinath@novell.com>
5861 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5862 keyword in 'partial enum' too.
5863 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5865 Report from Kamil Skalski <nazgul@omega.pl>.
5868 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5869 have partial containers too.
5871 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5872 in block' checks to Block.CheckInvariantMeaningInBlock.
5873 * statement.cs (Block.GetKnownVariableInfo): Make private.
5874 (Block.IsVariableUsedInChildBlock): Remove.
5875 (Block.IsVariableUsedInBlock): Likewise.
5876 (Block.CheckInvariantMeaningInBlock): New. Show location of
5877 conflicting declaration.
5878 (Block.AddVariable): Make error messages less long-winded and more
5879 specific. Show location of conflicting declaration.
5880 * parameter.cs (Parameters.Location): New readonly property.
5882 2005-03-31 Raja R Harinath <rharinath@novell.com>
5884 Clean up semantics of invoking ResolveMemberAccess.
5885 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5886 can have an instance, ensure that we pass in a non-TypeExpression
5887 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5888 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5889 argument. Update to changes and simplify.
5890 (FieldExpr.Emitinstance): Remove CS0120 check.
5891 (PropertyExpr.EmitInstance): Likewise.
5892 * expression.cs (Argument.Resolve): Likewise.
5893 (Invocation.DoResolve): Update to changes in semantics of
5896 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5899 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5902 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5904 2005-03-31 Raja R Harinath <rharinath@novell.com>
5906 Fix difference in behaviour with commandline invocation.
5907 * driver.cs (Driver.Reset): New.
5908 (CompilerCallableEntryPoint): Call it.
5910 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5911 variable" warnings if the boolean expression failed to resolve.
5913 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5915 * attribute.cs: Fix the union of several permissions when some of them
5916 are unrestricted (so the result isn't an unrestricted permission set).
5919 2005-03-30 Raja R Harinath <rharinath@novell.com>
5921 * ecore.cs (MemberExpr): New class. Convert from interface
5923 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5924 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5926 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5927 (MethodGroupExpr.IsExplicitImpl): Remove.
5928 (Expression.GetFieldFromEvent): Remove.
5929 (SimpleName.MemberStaticCheck): Remove.
5930 (SimpleName.DoSimpleNameResolve): Update to changes.
5931 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5932 (MemberAccess.IdenticalNameAndTypeName): Remove.
5933 (MemberAccess.error176): Move to MemberExpr.
5934 (MemberAccess.DoResolve): Update to changes.
5935 (BaseAccess.DoResolve): Likewise.
5937 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5939 C# 2.0 Conditional attribute class implementation
5941 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5942 Analyzes class whether it has attribute which has ConditionalAttribute
5943 and its condition is not defined.
5945 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5946 (Class.IsExcluded): New method. Search for at least one defined
5947 condition in ConditionalAttribute of attribute class.
5949 2005-03-30 Raja R Harinath <rharinath@novell.com>
5951 * ecore.cs (PropertyExpr): Derive from Expression, not
5952 ExpressionStatement.
5953 (PropertyExpr.EmitStatement): Remove.
5955 2005-03-29 Raja R Harinath <rharinath@novell.com>
5958 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5959 internal field "value__" of an enum be private. The examples for
5960 "value__" that I found on MSDN all used FieldAttributes.Private.
5962 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5963 Don't mention IL method attribute names.
5965 Fix #47991. Remove a TODO.
5966 * statement.cs (Block.Toplevel): Make into a field.
5967 (Block.Parameters): Move into ToplevelBlock.
5968 (Block.known_variables): Rename from child_variable_names.
5969 (Block.Block): Remove variants that take Parameters. Initialize
5970 'Toplevel' with the immediately surrounding toplevel block.
5971 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5972 LocalInfo parameter.
5973 (Block.GetKnownVariableInfo): New.
5974 (Block.IsVariableNameUsedInChildBlock): Update.
5975 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5976 the block, even though it may not be in scope.
5977 (Block.AddVariable): Remove Parameters parameter. Use
5978 Toplevel.Parameters instead.
5979 (Block.AddConstant): Remove Parameters parameter.
5980 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5981 (Block.IsParamaterReference): Likewise.
5982 (Block.IsLocalParameter): Likewise. Simplify a lot.
5983 (ToplevelBlock.Parameters): New. Moved from Block.
5984 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5985 initialize Parameters to a non-null value.
5986 * cs-parser.jay: Update to changes.
5987 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5988 simple names that mean different things in the same block. Use
5989 Block.IsVariableNameUsedInBlock.
5991 2005-03-28 Raja R Harinath <rharinath@novell.com>
5993 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5995 2005-03-26 Raja R Harinath <harinath@acm.org>
5998 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5999 fails to resolve, ensure that the LHS is still resolved as an
6002 2005-03-25 Raja R Harinath <harinath@acm.org>
6004 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6006 (Enum.current_ec): Remove.
6007 (Enum.LookupEnumValue): Remove EmitContext argument.
6008 Just uses the one created during DefineType.
6009 (Enum.FindMembers): Update.
6010 * expression.cs (MemberAccess.DoResolve): Update.
6012 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6014 * assign.cs (Assign.DoResolve): Check for CS1717 when
6015 source and target are same (uses Equals).
6017 * expression.cs (LocalVariableReference, ParameterReference,
6018 This): Implemented Equals, GetHashCode.
6020 * statement.cs (Block.GetParameterReference): Removed useless
6023 2005-03-22 Raja R Harinath <rharinath@novell.com>
6026 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6027 blocks before deciding whether the error is cs0136 or cs0128.
6029 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6030 (using_alias_directive, using_namespace_directive): Pass
6031 MemberName, not an expression to Namespace.UsingAlias and
6033 (MakeName): Use the MemberName of the namespace.
6034 * namespace.cs (Namespace.MemberName): New.
6035 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6036 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6038 * decl.cs (MemberName.Name): Make readonly.
6039 (MemberName.FromDotted): New "constructor".
6040 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6041 (MemberCore.Name): Compute from MemberName on demand.
6042 (MemberCore.SetMemberName): Provide a way to change the
6044 (MemberCore.AddToContainer): Don't take a fullname parameter.
6045 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6046 fully qualified name of the container to the member name.
6047 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6048 only if the type is a member of the root container.
6049 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6050 MemberName.Left rather than searching for an embedded ".".
6051 (PartialContainer.CreatePart): Update to changes in RootContext.
6052 (MemberBase.ShortName): Turn into a property. Use
6053 MemberCore.SetMemberName.
6054 (MemberBase.ExplicitInterfaceName): Remove.
6055 (MemberBase.UpdateMemberName): Remove.
6056 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6057 (PropertyBase.SetMemberName): New override.
6058 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6059 (Tree.GetDecl): New.
6060 (Tree.AllDecls): Rename from Decls.
6061 * attribute.cs, enum.cs, report.cs: Update to changes.
6062 * driver.cs (MainDriver): Use MemberName.FromDotted on
6063 RootContext.MainClass.
6065 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6067 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6070 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6072 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6074 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6075 property accessor modifiers.
6077 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6078 fixed buffer attribute (CS1716).
6079 (PropertyMethod.HasCustomAccessModifier): When property accessor
6080 has custom modifier.
6082 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6084 (PropertyExpr.DoResolveLValue): Add CS0272.
6086 2005-03-17 Miguel de Icaza <miguel@novell.com>
6088 * convert.cs: When converting to a pointer, use the proper Conv.U
6089 or Conv.I depending on the source data type.
6091 * cs-tokenizer.cs: Make the size for large decimal constants,
6094 2005-03-17 Martin Baulig <martin@ximian.com>
6096 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6097 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6099 2005-03-17 Martin Baulig <martin@ximian.com>
6101 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6102 to bool so we can return an error condition.
6103 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6106 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6108 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6111 2005-03-16 Raja R Harinath <rharinath@novell.com>
6113 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6114 Refactor to avoid traversing the list of assemblies, and to avoid
6115 string concatenation.
6116 * typemanager.cs (guid_attr_type): Remove.
6117 (negative_hits, pointers, references): Remove hashes.
6119 (GetConstructedType): New. Uses type_hash to handle constructed
6120 types (arrays, references, pointers).
6121 (GetReferenceType, GetPointerType): Use it.
6122 (GetNestedType): New. Uses type_hash to handle nested types of
6124 (LookupType, LookupTypeDirect): Remove.
6125 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6126 'types' hash and LookupTypeReflection directly.
6127 (params_string, params_object): Use GetConstructedType.
6128 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6130 (Namespace.Lookup): Use cached_types.
6131 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6132 provided by old TypeManager.LookupType.
6133 * rootcontext.cs (MakeFQN): Remove.
6134 * decl.cs (DeclSpace.MakeFQN): Likewise.
6135 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6136 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6137 TypeManager.GetConstructedType.
6138 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6140 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6142 * cs-parser.jay: Fix build.
6144 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6146 * class.cs (TypeContainer.CircularDepException) New nested
6147 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6149 * cs-parser.jay: Reports CS1527 for any namespace element.
6151 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6154 * expression.cs (ParameterReference.IsAssigned): Changed error to
6156 (Error_WrongNumArguments): Moved CS0245 detection here.
6158 * statement.cs (Return.Resolve): Add CS1622 report.
6160 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6162 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6164 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6166 * attribute.cs expression.cs: Get rid of some allocations.
6168 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6170 * doc.cs : just eliminate the latest change.
6172 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6174 * doc.cs : commented out the latest change. It breaks xml-030.cs
6176 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6178 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6179 fail. So invoke CreateType() in FindDocumentedType().
6181 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6183 * cs-tokenizer.cs : added IsKeyword().
6184 * doc.cs : Detect keyword incorrectly used as identifier.
6185 Allow identifiers prefixed by @.
6187 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6189 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6190 It caused exception in namespace resolving (again!).
6192 * class.cs (Class.ctor): Removed exit.
6193 (PropertyMethod.ctor): ditto.
6195 * codegen.cs (Codegen.Reset): Reset static data.
6196 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6198 * cs-tokenizer.cs (Cleanup): Removed.
6200 * driver.cs (GetSystemDir): Rewrote to one line command.
6201 It caused problem with unloaded dynamic modules.
6202 (UnixParseOption): Removed Exit.
6203 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6204 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6205 Now can be mcs used as library.
6207 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6210 * location.cs (Reset): Reset static data.
6212 * namespace.cs (Reset): Reset static data.
6214 * report.cs (Report.Reset): Reset static data.
6216 * rootcontext.cs (RootContext.Reset): Reset static data.
6218 * tree.cs (RootTypes.ctor): Use Location.Null
6220 * typemanager.cs (TypeManager.Reset): Reset static data.
6221 (CoreLookupType): Removed Exit.
6222 (TypeHandle.Reset): Reset static data.
6224 2005-03-10 Raja R Harinath <rharinath@novell.com>
6227 * typemanager.cs (ComputeNamespaces): Import namespaces from
6228 referenced modules too.
6230 2005-03-09 Raja R Harinath <rharinath@novell.com>
6232 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6235 2005-03-09 Raja R Harinath <rharinath@novell.com>
6237 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6238 enclosing DeclSpace. This ensures that a name-lookup populates
6239 more caches and there are fewer 'TypeExpression's. Carve out
6240 nested type lookup into ...
6241 (LookupNestedTypeInHierarchy): ... this.
6243 2005-04-15 Martin Baulig <martin@ximian.com>
6245 Merged r41590 from MCS and make it work in the generics land.
6247 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6250 * class.cs (PartialContainer.UpdateConstraints): Removed.
6251 (PartialContainer.CheckConstraints): Removed.
6252 (PartialContainer.SetParameterInfo): Store the constraints here.
6253 (PartialContainer.DefineTypeParameters): New public method;
6254 resolve the type parameter's constraints here. Note that the
6255 PartialContainer doesn't have an EmitContext anymore, so we must
6256 do this in the ClassPart.
6258 2005-03-09 Raja R Harinath <rharinath@novell.com>
6260 Clean up a few partial-class semantics.
6261 Fixes test-357.cs and cs1618-2.cs.
6262 * cs-parser.jay (struct_declaration): Use 'current_class' as
6263 parent of newly-created struct. Remove call to Register ().
6264 Use 'pop_current_class' to complete handing the current struct.
6265 (interface_declaration): Likewise.
6266 (class_declaration): Likewise.
6267 (enum_declaration): Use 'current_class' as parent of newly created
6269 (delegate_declaration): Likewise.
6270 (pop_current_class): New function. This is used to handle closing
6271 up the 'current_class' and 'current_container', and pointing them
6272 to the enclosing class/container.
6273 (CSharpParser): Initialize 'current_class' too.
6274 * decl.cs (MemberCore): Add check for invariant: a partial
6275 container is not a parsed entity, and thus does not enclose any
6277 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6278 (DeclSpace.BaseTypeExpr): Use it.
6279 (DeclSpace.LookupType): Add check for invariant.
6280 * class.cs (TypeContainer): Add check for invariant: a nested
6281 class should have the same NamespaceEntry as its enclosing class.
6282 (TypeContainer.EmitFieldInitializers): Make virtual.
6283 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6285 (TypeContainer.Register): Remove.
6286 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6287 null. Use TypeResolveEmitContext for resolving base types and
6288 interfaces. Move initialization of Parts.TypeBuilder here from
6290 (TypeContainer.DefineNestedTypes): ... here.
6291 (PartialContainer): Take a Namespace not a NamespaceEntry.
6292 (PartialContainer.Create): Don't use Register. Call the
6293 appropriate Add... function directly.
6294 (ClassPart): Take both the PartialContainer and the enclosing
6295 class as constructor arguments.
6296 (ClassPart.EmitFieldInitializers): Override.
6297 (ClassPart.PartFindNestedTypes): Remove.
6298 (FieldBase.GetInitializerExpression): Resolve the initializer
6299 expression in the emit context of the enclosing class.
6300 * tree.cs (RootTypes): Remove Register ().
6302 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6304 * cs-parser.jay: Removed CS0134.
6306 * driver.cs: Removed CS1901.
6308 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6309 for predefined types.
6311 2005-03-07 Duncan Mak <duncan@novell.com>
6313 * codegen.cs (Save): Catch UnauthorizedAccessException as
6314 well. Fixes bug #73454.
6316 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6318 * cs-tokenizer.cs (xtoken): Add CS1035.
6320 * class.cs (MethodData.Define): Add CS0683.
6321 (FieldMember.ctor): Add CS0681.
6323 2005-03-07 Raja R Harinath <rharinath@novell.com>
6325 * ecore.cs (SimpleName.DoResolve): Rename from
6326 SimpleName.DoResolveAllowStatic.
6327 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6328 Pass 'intermediate' flag to MemberStaticCheck.
6329 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6330 of "intermediate" lookups via MemberAccess.
6331 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6332 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6334 2005-03-07 Raja R Harinath <rharinath@novell.com>
6337 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6338 slipped in because of variable names that are identical to a
6339 builtin type's BCL equivalent ('string String;', 'int Int32;').
6340 (PropertyExpr.EmitInstance): Likewise.
6342 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6344 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6346 * report.cs (warning_ignore_table): Made public.
6348 2005-03-04 Raja R Harinath <rharinath@novell.com>
6351 * class.cs (MethodData.Emit): Pass 'container' to
6352 container.GetObsoleteAttribute instead of 'container.Parent'.
6354 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6356 * cs-parser.jay: Add 1534 error test.
6358 * iterators.cs (Yield.CheckContext): Add error 1629.
6359 (Iterator.ctor): Save unsafe modifier.
6360 (MoveNextMethod.DoEmit): Restore unsafe context.
6362 * namespace.cs (UsingAlias): Better error message.
6364 2005-03-03 Dan Winship <danw@novell.com>
6366 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6367 the warning message [#73219]
6369 2005-03-03 Raja R Harinath <rharinath@novell.com>
6371 Fix compile with MCS 1.0.0.0.
6372 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6373 w_restore to not depend on string constant folding.
6375 2005-03-03 Raja R Harinath <rharinath@novell.com>
6377 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6378 CS0246 check to users who passed 'silent = false'.
6379 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6381 (SimpleName.SimpleNameResolve): Update.
6382 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6383 (MemberAccess.IdenticalNameAndTypeName): Update.
6384 * doc.cs (FindDocumentedTypeNonArray): Update.
6386 2005-03-03 Raja R Harinath <rharinath@novell.com>
6388 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6389 * parameters.cs (ComputeAndDefineParameters): Remove.
6390 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6391 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6392 Use GetParameterInfo.
6394 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6396 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6398 2005-03-02 Raja R Harinath <rharinath@novell.com>
6400 Unify DeclSpace.LookupType and DeclSpace.FindType.
6401 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6402 is in charge of defining nested types on demand.
6403 (DeclSpace.LookupType): Use it when the current_type is a
6404 TypeBuilder. Use LookupTypeDirect for reflected types.
6405 (DeclSpace.FindType): Remove.
6406 (DeclSpace.LookupInterfaceOrClass): Likewise.
6407 (DeclSpace.DefineTypeAndParents): Likewise.
6408 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6409 DeclSpace.LookupType.
6410 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6411 * typemanager.cs (LookupType): Simplify.
6412 (AddUserType): Remove type from negative_hits.
6413 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6414 * class.cs (TypeContainer.FindMembers): Move handling of nested
6416 (TypeContainer.FindMembers_NestedTypes): ... here.
6417 (TypeContainer.FindNestedType): Implement override.
6418 (ClassPart.FindNestedType): Delegate to PartialContainer.
6419 (ClassPart.PartFindNestedType): Looks up the nested types of the
6422 2005-04-14 Martin Baulig <martin@ximian.com>
6424 * generic.cs (ConstructedType): Moved all the type lookup and
6425 nested class logic into SimpleName.
6426 (ConstructedType.ResolveConstructedType): Our underlying type is
6427 already fully resolved; all the type lookup stuff is in
6430 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6431 constructed types here instead of in ConstructedType.
6433 * decl.cs (MemberName.GetTypeExpression): Always create a
6434 SimpleName, not a ConstructedType.
6435 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6437 2005-03-02 Martin Baulig <martin@ximian.com>
6439 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6440 static constructor in static classes.
6442 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6444 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6445 sizeParamIndex is not specified.
6447 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6450 * report.cs (WarningMessage.IsEnabled): Missing null check.
6452 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6454 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6455 in the fields and not in the properties.
6457 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6459 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6462 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6464 * attribute.cs: Small refactoring (improved robustness).
6465 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6466 (ValidateGuid): Removed.
6467 (Resolve): Removed referenced to above mentioned.
6468 (GetAttributeUsage): Made private and changed to work without
6470 (GetIndexerAttributeValue): Don't crash.
6471 (GetConditionalAttributeValue): Ditto.
6472 (GetClsCompliantAttributeValue): Ditto.
6473 (ExtractSecurityPermissionSet): All attributes exceptions are
6475 (GetPropertyValue): New helper.
6476 (GetMethodImplOptions): New method.
6477 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6478 some missing properties.
6480 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6481 (Method.ApplyAttributeBuilder): Updated.
6483 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6486 2005-02-28 Raja R Harinath <rharinath@novell.com>
6489 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6490 non-simple types (array, pointer, reference).
6492 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6494 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6496 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6498 (Method.CheckBase): Catch wrong destructor here.
6499 (MethodData.Define): Add errors 550, 668.
6501 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6503 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6505 * pending.cs (VerifyPendingMethods): Add error 551.
6507 * typemanager.cs (CSharpName): Next error report helper.
6509 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6511 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6512 attributes. Removed useless attribute double check.
6513 It saves almost 2MBs for corlib.
6515 2005-02-25 Raja R Harinath <rharinath@novell.com>
6518 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6519 called twice in case of error.
6521 2005-02-23 Chris Toshok <toshok@ximian.com>
6523 Fix compiler portions of #72827.
6524 * statement.cs (Block.Emit): call Begin/EndScope on the
6525 EmitContext instead of the ILGenerator.
6527 * codegen.cs (EmitContext.BeginScope): new method, call
6528 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6530 (EmitContext.BeginScope): same, but EndScope and CloseScope
6532 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6533 offset and call the superclass's OpenScope(int) with it.
6534 (SymbolWriter.CloseScope): get the current il
6535 offset and call superclass's CloseScope(int) with it.
6537 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6539 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6540 CS1677 for out and ref as well.
6542 * class.cs (Method.Define): Add error CS1599 detection.
6544 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6546 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6548 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6550 * support.cs.cs (ModifierDesc): New helper method.
6552 2005-02-23 Raja R Harinath <rharinath@novell.com>
6553 Abin Thomas <projectmonokochi@rediffmail.com>
6554 Anoob V E <projectmonokochi@rediffmail.com>
6555 Harilal P R <projectmonokochi@rediffmail.com>
6558 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6559 MemberLookup (used for error reporting) actually returns a result.
6560 Fix error report number (122, not 112).
6562 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6563 Anoob V E <projectmonokochi@rediffmail.com>
6564 Harilal P R <projectmonokochi@rediffmail.com>
6567 * pending.cs (PendingImplementation.GetAbstractMethods):
6568 Find NonPublic members too.
6570 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6572 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6575 * class.cs (MethodCore.CheckMethodAgainstBase):
6576 Add error 239 report.
6578 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6580 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6582 * class.cs (Operator.Define): Add error 217 report.
6584 2005-02-21 Raja R Harinath <rharinath@novell.com>
6587 * expression.cs (Invocation.IsApplicable): Make public.
6588 (Invocation.IsParamsMethodApplicable): Likewise.
6589 * delegate.cs (Delegate.VerifyApplicability): Don't use
6590 Invocation.VerifyArgumentCompat for parameter applicability
6591 testing. Use Invocation.IsApplicable and
6592 Invocation.IsParamsMethodApplicable.
6594 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6596 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6598 * class.cs (Operator.Define): Add error 217 report.
6600 2005-02-21 Raja R Harinath <rharinath@novell.com>
6602 * namespace.cs (UsingEntry.Resolve): Undo change below.
6604 2005-02-21 Raja R Harinath <rharinath@novell.com>
6607 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6608 disable the error message when the extended MemberLookup also
6610 (Expression.MemberLookupFinal): Update.
6611 (SimpleName.DoSimpleNameResolve): Update.
6612 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6613 Don't use MemberLookupFinal.
6614 (New.DoResolve): Update.
6615 (BaseAccess.CommonResolve): Update.
6617 2005-02-21 Raja R Harinath <rharinath@novell.com>
6620 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6621 occured previously, don't resolve again.
6623 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6626 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6627 argument. Call ResolveAttributeUsage for unresolved.
6628 when types doesn't match ctor arguments.
6630 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6631 for nested attribute classes.
6632 (Class.attribute_usage): Removed.
6633 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6634 for attribute class.
6636 * ecore.cs (IsAttribute): Removed.
6638 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6640 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6642 (attribute_types): Removed.
6643 (EmitCode): Global attributes are emited as the latest.
6645 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6647 * class.cs (EmitFieldInitializers): Don't emit field initializer
6648 for default values when optimilization is on.
6650 * constant.cs (Constant.IsDefaultValue): New property.
6652 * driver.cs: Add /optimize handling.
6656 * literal.cs: Implement new IsDefaultValue property.
6658 * rootcontext.cs (Optimize): New field, holds /optimize option.
6660 2005-02-18 Raja R Harinath <rharinath@novell.com>
6662 Fix crasher in re-opened #72347.
6663 * namespace.cs (Namespace.Lookup): Return null if
6664 DeclSpace.DefineType returns null.
6667 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6669 2005-02-18 Raja R Harinath <rharinath@novell.com>
6671 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6672 now returns null if it cannot resolve to an lvalue.
6673 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6674 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6675 returned null. Remove check for SimpleName.
6676 (EventExpr.DoResolveLValue): New.
6677 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6678 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6680 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6682 (Unary.ResolveOperator): Move CS0211 check ...
6683 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6685 (Unary.DoResolveLValue): Simplify.
6686 (AddressOf.DoResolveLValue): New.
6687 (ArrayAccess.DoResolveLValue): New.
6689 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6691 * attribute.cs (Attribute.Resolve): Add arguments casting for
6692 when types doesn't match ctor arguments.
6694 2005-02-16 Raja R Harinath <rharinath@novell.com>
6696 Fix parts of #63202.
6697 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6698 lookup of operator in base type. Ensure that all checks happen
6699 when the operator resolves to an "op_..." method.
6701 2005-02-15 Raja R Harinath <rharinath@novell.com>
6704 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6705 'ignore_cs0104' parameter. Pass it to ...
6706 (NamespaceEntry.Lookup): ... this.
6707 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6708 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6709 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6710 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6711 Update. Request that cs0104 errors be ignored.
6712 (ComposedCast.ResolveAsTypeStep): Update.
6714 2005-02-14 Raja R Harinath <rharinath@novell.com>
6717 * expression.cs (Invocation.BetterFunction): Remove support for
6718 comparing virtual functions and their overrides.
6719 (Invocation.IsOverride): New.
6720 (Invocation.OverloadResolve): Don't consider 'override' functions
6721 during candidate selection. Store them in a lookaside list.
6722 If the selected method is a 'virtual' function, use the list to
6723 find any overrides that are closer to the LHS type.
6725 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6727 * expression.cs (New.DoResolve): Add complex core type reduction.
6728 (New.Constantify): Converts complex core type syntax like 'new int ()'
6731 2005-02-14 Raja R Harinath <rharinath@novell.com>
6733 * decl.cs (EntryType.EntryType): New constructor to create an
6734 updated copy of a cache entry.
6735 (MemberCache.AddMethods): Use it.
6736 (MemberCache.ClearDeclaredOnly): Remove.
6737 (MemberCache.MemberCache): Update.
6739 2005-02-11 Miguel de Icaza <miguel@novell.com>
6741 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6742 variable. This one is represents the actual low-level declaration
6743 of the method, as opposed to the semantic level `IsStatic'.
6745 An anonymous method which is hosted into a static method might be
6746 actually an instance method. IsStatic would reflect the
6747 container, while MethodIsStatic represents the actual code
6750 * expression.cs (ParameterReference): Use the new MethodIsStatic
6751 instead of IsStatic.
6753 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6754 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6755 set on the current EmitContext.
6757 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6758 resolve our casted expression as an LValue. This triggers the
6759 proper LValue processing that is later required by Assign.
6763 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6765 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6767 C# 2.0 Fixed buffer implementation
6769 * anonymous.cs: Update after RegisterHelperClass renaming.
6771 * attribute.cs (AttributeTester.fixed_buffer_cache):
6772 Cache of external fixed buffers.
6773 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6774 implementation if field is fixed buffer else null.
6777 (TypeContainer.AddField): Accept FieldMember instead of Field.
6778 (FieldBase.IsFieldClsCompliant): Extracted code from
6779 VerifyClsCompliance descendant customization.
6780 (FixedField): New class handles fixed buffer fields.
6781 (FixedFieldExternal): Keeps information about imported fixed
6783 (IFixedField): Make access to internal or external fixed buffer
6786 * cs-parser.jay: Add fixed buffer parsing.
6788 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6791 * expression.cs (Indirection): Extended implementation to accept
6793 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6794 (ElementAccess.MakePointerAccess): Get type as parameter.
6795 (DoResolve): Add fixed buffer field expression conversion.
6796 (DoResolveLValue): Ditto.
6797 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6798 (ArrayPtr): Derives from FixedBufferPtr.
6799 (ArrayPtr.Emit): Add extra emit for array elements.
6801 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6803 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6804 for compiler generated types.
6805 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6807 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6808 and consume less memory.
6809 (Fixed.Resolve): Add fixed buffer case.
6811 * typemanager.cs (compiler_generated_attr_ctor,
6812 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6813 (HasElementType): Add our own implementation to work on every
6816 2005-02-11 Miguel de Icaza <miguel@novell.com>
6818 * anonymous.cs (CaptureContext): Track whether `this' has been
6821 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6822 only captured `this' if it was implicitly done (instance
6823 methods/variables were used).
6825 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6826 `this' must be captured.
6828 2005-01-30 Miguel de Icaza <miguel@novell.com>
6830 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6831 is null it means that there has been no need to capture anything,
6832 so we just create a sibling.
6834 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6836 Just a partial fix. The other half is fairly elusive.
6838 2005-02-10 Raja R Harinath <rharinath@novell.com>
6840 Fix #52586, cs0121-4.cs.
6841 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6842 and return a hashtable.
6843 (MemberCache.ClearDeclaredOnly): New.
6844 (MemberCache.MemberCache): Update to change. Make a deep copy of
6845 the method_hash of a base type too.
6846 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6847 type methods. Overwrite entries with the same MethodHandle so
6848 that the ReflectedType is correct. The process leaves in base
6849 virtual functions and their overrides as distinct entries.
6850 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6851 matters since it was boxed in a ArrayList before.
6852 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6854 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6855 case of a virtual function and its override (choose the overload
6857 (Invocation.OverloadResolve): Avoid 'override' members during
6858 'applicable_type' calculation.
6860 2005-03-28 Raja R Harinath <rharinath@novell.com>
6862 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6863 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6864 GetTypeHandle. It is possible for a reflected type to derive from
6865 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6866 System.Array during mscorlib compilation).
6867 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6868 contain a method_hash, don't create one either. Don't create a
6869 deep copy of the base cache's method_hash.
6870 (MemberCache.SetupCache): Rename back from DeepCopy.
6871 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6872 already initialized. If we see an override function, add its
6873 underlying base virtual function to the member_hash too.
6875 2005-02-09 Raja R Harinath <rharinath@novell.com>
6877 Combine two near-redundant caches.
6878 * typemanager.cs (method_params): Rename from method_internal_params.
6879 (TypeManager.GetParameterData): New. Replace
6880 Invocation.GetParameterData.
6881 (TypeManager.LookupParametersByBuilder): Remove.
6882 * expression.cs (Invocation.method_parameter_cache): Remove.
6883 (Invocation.GetParameterData): Remove.
6885 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6888 2005-02-08 Raja R Harinath <rharinath@novell.com>
6891 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6892 TypeManager.multicast_delegate_type is null, resolve it by looking
6893 up "System.MulticastDelegate".
6894 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6896 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6897 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6898 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6901 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6902 (LabeledStatement.AddReference): New. Set 'referenced'.
6903 (Goto.Resolve): Use it.
6905 2005-02-05 John Luke <john.luke@gmail.com>
6907 * driver.cs: remove duplicate -doc line in Usage ()
6909 2005-02-04 Raja R Harinath <rharinath@novell.com>
6911 * location.cs (Location.AddFile): Fix CS2002 error report.
6913 2005-02-02 Martin Baulig <martin@ximian.com>
6915 * delegate.cs (Delegate.DefineType): Report an internal error if
6916 TypeManager.multicast_delegate_type is null. See bug #72015 for
6919 2005-02-02 Raja R Harinath <rharinath@novell.com>
6921 Fix a crasher in a variant of #31984.
6922 * const.cs (Constant.CheckBase): New override that defers the
6923 new-or-override check in case the base type hasn't been populated
6925 (Constant.Define): Ensure the new-or-override check is performed.
6927 2005-02-01 Duncan Mak <duncan@ximian.com>
6929 * const.cs (LookupConstantValue): Check that `ce' is not null
6930 before calling GetValue ().
6932 2005-02-01 Raja R Harinath <rharinath@novell.com>
6934 Fix test-334.cs (#69519).
6935 * cs-parser.jay (using_alias_directive): Pass in an expression to
6936 NamespaceEntry.UsingAlias.
6937 (using_namespace_directive): Pass in an expression to
6938 NamespaceEntry.Using.
6939 (namespace_name): Don't flatten to a string.
6940 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6941 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6943 (NamespaceEntry.UsingEntry): Likewise.
6944 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6946 (NamespaceEntry.LookupForUsing): Remove.
6947 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6949 (NamespaceEntry.Lookup): Remove support for dotted names.
6951 2005-02-01 Raja R Harinath <rharinath@novell.com>
6953 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6955 (NamespaceEntry.ImplicitParent): Compute on demand.
6956 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6957 parallels the current.
6958 (NamespaceEntry.LookupForUsing): Use it.
6959 (NamespaceEntry.Lookup): If the current namespace-entry is
6960 implicit, don't search aliases and using tables.
6962 2005-02-01 Raja R Harinath <rharinath@novell.com>
6965 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6967 (TypeContainer.BaseCache): Compute on demand.
6968 (TypeContainer.FindMembers): Define constants and types if they're
6969 not already created.
6970 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6972 * const.cs (Constant.Define): Make idempotent.
6974 2005-01-29 Miguel de Icaza <miguel@novell.com>
6976 * pending.cs: Produce better code (no nops produced by using Ldarg
6979 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6980 i - 1' it should be arg + 1.
6984 2005-01-28 Raja R Harinath <rharinath@novell.com>
6986 * attribute.cs (Attribute.CheckAttributeType): Make private
6988 (Attribute.ResolveType): Make virtual.
6989 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6990 handling of RootContext.Tree.Types.
6992 2005-01-27 Raja R Harinath <rharinath@novell.com>
6994 Update attribute-handling to use the SimpleName/MemberAccess
6996 * cs-parser.jay (attribute): Pass in an expression to the
6997 constructors of Attribute and GlobalAttribute.
6998 * attribute.cs (Attribute): Take an expression for the name.
6999 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7000 passed in attribute name expression.
7001 (Attribute.CheckAttributeType): Use it.
7002 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7003 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7004 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7005 argument to prevent error messages if the lookup fails.
7007 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7009 * expression.cs (Indirection): Implemented IVariable interface
7010 to support indirection in AddressOf operator.
7011 (PointerArithmetic.Emit): Add optimalization for case where
7012 result can be precomputed.
7014 2005-01-26 Martin Baulig <martin@ximian.com>
7016 * class.cs (TypeContainer.AttributeTargets): Return the correct
7017 AttributeTargets depending on our `Kind' instead of throwing an
7018 exception; fixes #71632.
7020 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7023 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7026 2005-03-17 Martin Baulig <martin@ximian.com>
7028 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7029 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7031 2005-03-17 Martin Baulig <martin@ximian.com>
7033 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7034 to bool so we can return an error condition.
7035 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7038 2005-03-17 Martin Baulig <martin@ximian.com>
7040 * generic.cs (TypeMananager.IsIEnumerable): New public method.
7042 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7043 converting from an array-type of T to `IEnumerable<T>'.
7045 2005-03-16 Martin Baulig <martin@ximian.com>
7047 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7048 (Nullable.LiftedUnaryMutator): New public class.
7050 * expression.cs (UnaryMutator.DoResolve): Added support for
7053 2005-03-14 Martin Baulig <martin@ximian.com>
7055 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7057 2005-03-14 Martin Baulig <martin@ximian.com>
7059 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7060 the comparision operators `<', `>', `<=' and `>='.
7062 2005-03-13 Martin Baulig <martin@ximian.com>
7065 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7066 avoid confusion with the `NullLiteral'.
7067 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7069 2005-03-13 Martin Baulig <martin@ximian.com>
7071 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7072 comparing arbitrary types with the null literal.
7074 2005-03-13 Martin Baulig <martin@ximian.com>
7076 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7077 boolean operators '&&', '||', '&' and '|'.
7078 (Nullable.OperatorTrueOrFalse): New public class.
7080 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7081 instead of a `StaticCallExpr'; added support for nullables.
7083 2005-03-10 Martin Baulig <martin@ximian.com>
7086 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7087 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7089 2005-03-07 Martin Baulig <martin@ximian.com>
7091 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7092 it work if `expr' is not an IMemoryLocation.
7093 (Nullable.Lifted): Implement IMemoryLocation.
7094 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7097 2005-03-05 Martin Baulig <martin@ximian.com>
7099 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7100 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7101 (Nullable): Added support for lifted unary and binary operators.
7103 * expression.cs (Unary.DoResolve): Added support for nullable types.
7104 (Binary.DoResolve): Likewise.
7105 (Conditional.DoResolve): Likewise.
7107 2005-03-02 Martin Baulig <martin@ximian.com>
7109 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7111 * class.cs (ClassPart.SetParameterInfo): Override this.
7112 (PartialContainer.SetParameterInfo): Override this.
7113 (TypeContainer.CheckConstraints): New protected method.
7114 (PartialContainer.CheckConstraints): Override this and check
7115 whether the same contraints were specified in all parts of a
7116 partial generic type definition.
7117 (PartialContainer.UpdateConstraints): New public method.
7119 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7121 2005-03-02 Martin Baulig <martin@ximian.com>
7123 Committing a patch from Carlos Alberto Cortez to fix #72887.
7125 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7126 casts from `T []' to `int []'.
7128 2005-03-02 Martin Baulig <martin@ximian.com>
7130 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7132 * expression.cs (Binary.ResolveOperator): When resolving a
7133 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7134 `=='. Fixes #71866. See gen-127.cs.
7136 2005-03-02 Martin Baulig <martin@ximian.com>
7138 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7139 static constructor in static classes.
7141 2005-03-02 Martin Baulig <martin@ximian.com>
7144 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7145 (Nullable.LiftedConversion): Added support for user-defined
7148 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7150 * cs-parser.jay: Use ComposedCast everywhere instead of
7151 NullableType, so we don't need to check for NullableType
7153 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7154 case where we'll be resolved into a `parenthesized_expression_0'
7158 (Convert.UserDefinedConversion): Added nullable conversions.
7160 2005-02-28 Martin Baulig <martin@ximian.com>
7162 * generic.cs (TypeManager.IsNullableType): New static method.
7163 (Nullable): New abstract class.
7164 (Nullable.NullLiteral): New public class.
7165 (Nullable.LiftedConversion): New public class.
7167 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7168 `builtin_types opt_nullable'.
7171 (Convert.ImplicitConversionStandard): Added nullable conversions.
7172 (Convert.ExplicitConversionStandard): Likewise.
7173 (Convert.ExplicitConversion): Likewise.
7175 2005-02-26 Martin Baulig <martin@ximian.com>
7177 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7178 begin with a "?", for instance "?[]". Don't do a type lookup if
7181 2005-02-25 Martin Baulig <martin@ximian.com>
7183 The first part of Nullable Types :-)
7185 * generic.cs (NullableType): New public class.
7186 (NullCoalescingOperator): New public class.
7187 (TypeArguments.Resolve): Add a CS0306 check.
7189 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7190 (opt_nullable): New rule.
7191 (type): Added `opt_nullable' to `namespace_or_type_name',
7192 `builtin_types' and `pointer_type'.
7193 (array_type): Added `opt_nullable'.
7194 (opt_rank_specifier_or_nullable): New rule; this is the
7195 combination of `opt_rank_specifier' and `opt_nullable'.
7196 (opt_error): New rule; catch errors here.
7197 (nullable_type_or_conditional): New rule; we use this to check for
7198 nullable and still detect the conditional operator.
7199 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7200 instead `opt_rank_specifier'.
7202 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7205 2005-02-24 Martin Baulig <martin@ximian.com>
7207 * README, README.Changes: Removed; they're old and obsolete.
7209 2005-02-22 Martin Baulig <martin@ximian.com>
7211 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7212 returned an error, set `constraints' to null to avoid a crash
7214 (TypeParameter.ResolveType): Likewise.
7216 2005-02-22 Martin Baulig <martin@ximian.com>
7219 (Constraints.ResolveTypes): Protect against being called twice.
7220 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7221 (TypeParameter.ResolveType): New public method; calls
7222 constraints.ResolveTypes().
7223 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7224 into the new ResolveType().
7225 (GenericMethod.Define): Call ResolveType() on all our
7228 2005-02-21 Martin Baulig <martin@ximian.com>
7231 (TypeManager.generic_nullable_type): New static public field.
7232 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7235 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7237 2005-02-15 Martin Baulig <martin@ximian.com>
7239 * generic.cs (ConstructedType.Constraints): Correctly check
7240 constraints if the argument type is a type parameter; fixes
7243 2005-02-02 Martin Baulig <martin@ximian.com>
7245 * delegate.cs (Delegate.DefineType): Report an internal error if
7246 TypeManager.multicast_delegate_type is null. See bug #72015 for
7249 2005-01-29 Miguel de Icaza <miguel@novell.com>
7251 * pending.cs: Produce better code (no nops produced by using Ldarg
7254 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7255 i - 1' it should be arg + 1.
7259 2005-01-26 Martin Baulig <martin@ximian.com>
7261 * cs-parser.jay (indexer_declarator): Don't report an error if we
7262 have type parameters since we can be an explicit interface
7263 implementation; fixes #71449.
7265 2005-01-26 Martin Baulig <martin@ximian.com>
7267 * class.cs (TypeContainer.AttributeTargets): Return the correct
7268 AttributeTargets depending on our `Kind' instead of throwing an
7269 exception; fixes #71632.
7271 2005-01-26 Martin Baulig <martin@ximian.com>
7273 * delegate.cs (Delegate.DefineType): Correctly define our type
7274 parameters. Fixes #71483.
7276 2005-01-25 Raja R Harinath <rharinath@novell.com>
7279 * expression.cs (MemberAccess.DoResolve): Don't complain with
7280 cs0572 when the LHS of a member access has identical name and type
7283 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7286 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7288 Create custom PermissionSet only for PermissionSetAttribute.
7290 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7293 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7294 delegates in static class.
7296 2005-01-24 Martin Baulig <martin@ximian.com>
7298 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7299 merging an implicit block, just use its reachability.
7301 * statement.cs (Block.Resolve): Make the unreachable code check
7302 work wrt. implicit blocks; see test-337 from #63842.
7304 2005-01-21 Alp Toker <alp@atoker.com>
7306 * cs-parser.jay: destructor_declaration's container is PartialContainer
7307 not Class when partial types are used, so use Kind prop instead of
7310 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7312 * cs-parser.jay: Improve error reporting when an interface
7315 2005-01-20 Dick Porter <dick@ximian.com>
7317 * support.cs: SeekableStreamReader fix from Sandor Dobos
7318 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7319 chars are read. Fixes bug 70369.
7321 2005-01-20 Raja R Harinath <rharinath@novell.com>
7323 * cs-parser.jay (catch_clause): Simplify current_block handling
7326 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7328 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7329 code with ImplicitStandardConversion to handle the implicit
7330 conversion of method groups into valid delegate invocations.
7332 The problem is that in parameter handling we were using this code
7333 path. Fixes bug #64698
7335 2005-01-19 Raja R Harinath <rharinath@novell.com>
7337 * cs-parser.jay: Fix several infelicities.
7338 - Avoid assigning to the parser value stack. Code like
7339 '$3 = null' is unclean. Synthesize a value for the code block
7341 - Avoid using oob_stack for storing location information. Use ...
7342 (_mark_): ... this. New (empty) rule. Saves the current location
7344 (foreach_statement): Avoid using oob_stack for current_block
7345 handling. Use technique used in for_statement and
7346 using_statement. Synthesize a value for the code block to store
7347 additional intermediate information.
7349 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7351 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7352 of a different type is only allowed to private fields of a
7353 containing type, not on fields of a base class.
7355 See test-174.cs and error cs0122-9.cs
7357 2005-01-13 Raja R Harinath <rharinath@novell.com>
7359 Fix test-335.cs (bug #58126).
7360 * cs-parser.jay (argument): Split out non-expression parts of the
7361 rule into 'non_simple_argument'.
7362 (invocation_expression): Support parenthesized invocations with
7363 multiple arguments, and with single non-simple arguments.
7365 2005-01-13 Raja R Harinath <rharinath@novell.com>
7367 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7370 2005-01-12 Raja R Harinath <rharinath@novell.com>
7372 Fix cs0038-1.cs, cs1640-6.cs.
7373 * ecore.cs (Expression.Resolve): Remove special-case for
7374 SimpleName in error-handling.
7375 (Expression.almostMatchedMembers): Relax access permission to
7377 (Expression.MemberLookupFailed): Handle duplicates in
7378 almostMatchedMembers list.
7379 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7380 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7381 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7382 overload if the passed in MemberInfo is a MethodBase.
7384 2005-01-25 Martin Baulig <martin@ximian.com>
7387 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7389 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7392 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7393 for non-CAS & merge permission sets properly.
7395 2005-01-11 Raja R Harinath <rharinath@novell.com>
7397 Improve standard-compliance of simple name and member access
7398 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7399 * ecore.cs (FullNamedExpression): New abstract base class
7400 for Namespaces and TypeExpressions.
7401 (ResolveFlags.SimpleName): Remove.
7402 (SimpleName): Remove support for dotted names.
7403 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7404 DeclSpace.FindType and DeclSpace.LookupType.
7405 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7406 (Expression.ExprClassName): Make member function.
7407 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7408 a namespace. Remove creation of dotted "SimpleName"s.
7409 (MemberAccess.DoResolve): Likewise.
7410 * decl.cs (DeclSpace.Cache): Make private.
7411 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7412 (DeclSpace.FindType): Update.
7413 (DeclSpace.LookupType): Move here from RootContext. Return a
7414 FullNamedExpression.
7415 * namespace.cs (Namespace): Derive from FullNamedExpression
7416 so that it can be part of expression resolution.
7417 (Namespace.Lookup): Return an FullNamedExpression.
7418 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7420 * rootcontext.cs (NamespaceLookup): Remove.
7421 (LookupType): Move to DeclSpace.
7422 * attribute.cs (CheckAttributeType): Update.
7423 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7424 (FindDocumentedTypeNonArray): Likewise.
7426 2005-01-11 Raja R Harinath <rharinath@novell.com>
7428 Fix cs0509.cs, cs1632.cs.
7429 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7430 is the same as IsInterface.
7431 (TypeContainer.GetClassBases): Likewise.
7432 * statement.cs (LabeledStatement.ig): New field.
7433 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7435 (LabeledStatement.DoEmit): Check that the label was created with
7436 the same ILGenerator.
7438 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7441 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7442 accessors to its properties.
7444 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7445 from accessors to property.
7447 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7450 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7453 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7455 * attribute.cs: Check for null and empty strings.
7457 I have lost another battle to Paolo.
7459 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7462 * class.cs (PropertyMethod): Set Parent field in ctors.
7463 (SetMethod.InternalParameters): Add unsafe switch hack.
7464 Override MarkForDuplicationCheck where it is appropriate.
7466 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7467 It says whether container allows members with the same name.
7469 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7470 Removed is_method parameter.
7472 2005-01-06 Duncan Mak <duncan@ximian.com>
7474 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7475 because the previous change led to incorrect reporting of CS1032
7476 ("Cannot define/undefine preprocessor symbols after first token in
7477 file"). Instead of using `tokens_seen' as the only flag that
7478 triggers CS1040, introduce `comments_seen'. This new flag is used
7479 to signify having seen comments on the current line, so it is
7480 unset after a newline.
7482 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7484 * doc.cs : When searching for a type, find nested type too.
7485 This fixes bug #71040.
7487 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7490 - Warn missing member comment on those classes which also does not
7491 have doc comments. Fixed bug #71041.
7492 - Don't warn missing doc comment on default constructor.
7495 2005-01-06 Duncan Mak <duncan@ximian.com>
7497 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7498 comments, set `tokens_seen' to true. This allows us to detect
7499 misplaced preprocessor directives (i.e. not at the beginning of
7500 the a line, nor after whitespaces). In that case, report error
7501 CS1040. This fixes bug #56460.
7503 * cs-parser.jay (interface_member_declaration): Add checks for
7504 IsExplicitImpl, and report CS0541 error if an interface member is
7505 defined as an explicit interface declaration.
7507 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7510 * class.cs (PropertyMethod): Set Parent field in ctors.
7511 (SetMethod.InternalParameters): Add unsafe switch hack.
7513 * decl.cs (MemberCore.Parent): Cannot be readonly.
7515 2005-01-06 Raja R Harinath <rharinath@novell.com>
7517 * decl.cs (DeclSpace.ResolveType): Remove.
7518 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7519 Merge in code from ...
7520 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7521 * class.cs, enum.cs: Update to changes.
7523 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7525 * anonymous.cs: Ensure that we init the scope of our parent if it
7526 has not been initialized yet.
7528 2004-12-30 Duncan Mak <duncan@ximian.com>
7530 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7531 if field.FieldBuilder is null. Fixes #70758.
7533 * convert.cs: Fixed some typos and updated some of the comments.
7534 (ImplicitStandardConversionExists):
7535 (TryImplicitIntConversion): If `target_type' is an interface and
7536 the type of `ic' implements this interface, return true or a new
7537 BoxedCast instead of null. This fixes #70468.
7539 2004-12-29 Duncan Mak <duncan@ximian.com>
7541 * expression.cs (Argument.Emit): Check that Expr is
7542 IMemoryLocation before casting to it, and report CS1510 otherwise.
7546 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7548 * statement.cs (Block.ThisVariable): remove the recursion here, to
7549 make the --profile more sane.
7551 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7553 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7554 assembly, by JB Evain.
7556 2004-12-17 Raja R Harinath <rharinath@novell.com>
7558 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7559 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7560 "parent" refers to enclosing type/class. "base" refers to superclass.
7562 2004-12-17 Raja R Harinath <rharinath@novell.com>
7564 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7565 Ensure that we only have GlobalAttributes.
7566 * attribute.cs (Attribute.Emit): Make non-virtual.
7567 (GlobalAttribute.Emit): Remove.
7568 (Attribute.Resolve): Make virtual.
7569 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7570 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7571 the argument. Don't create one.
7572 (Attribute.GetObsoleteAttribute): Likewise.
7573 (Attribute.GetClsCompliantAttributeValue): Likewise.
7574 * class.cs, decl.cs: Update to changes.
7576 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7578 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7580 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7582 * statement.cs (Foreach.Resolve): Add error 186 report.
7584 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7586 * expression.cs (Conditional.DoResolve): Add warning 429.
7588 * statement.cs (If.Resolve): Add warning 665.
7590 2004-12-16 Raja R Harinath <rharinath@novell.com>
7592 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7593 except when in the parser, and in GlobalAttribute.
7594 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7595 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7596 RootContext.Tree.Types.NamespaceEntry once work is done.
7597 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7598 and resets RootContext.Tree.Types.NamespaceEntry.
7600 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7602 * cs-parser.jay: Don't create a block for every variable.
7604 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7606 * location.cs: Provide extra information.
7608 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7609 variables from the captured environment, it is the ldarg_0.
7611 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7613 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7616 * class.cs: Changed warning level for 169 to avoid developer
7617 displeasure from warning flooding. It will be changed back when they
7618 fix most of current BCL warnings.
7620 * RootContext.cs: Pushed default WarningLevel to 3.
7622 * statement.cs: Removed unused variable.
7624 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7626 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7627 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7628 Add error 502 report.
7629 (StaticClass.DefineType): Add error 441 report.
7630 (Class.AllowedModifiersProp): New virtual property as temporary
7631 extension to AllowedModifiers.
7632 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7633 to share implementation with StaticClass and don't call virtual
7636 * driver.cs (MainDriver): Add error 1558 test.
7638 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7639 report. Moved error 36 test here.
7641 * statement.cs (Throw.Resolve): Add error 724 report.
7643 * typemanager.cs: Add out_attribute_type core type.
7645 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7647 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7649 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7651 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7654 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7656 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7657 Add error 3023 report.
7658 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7660 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7663 2004-12-12 John Luke <john.luke@gmail.com>
7665 * driver.cs (AddArgs): take -- into account when
7666 adding arguments, fixes bug 65710
7668 2004-12-12 Martin Baulig <martin@ximian.com>
7670 * expression.cs (Unary.TryReduceNegative): Added support for
7671 SByteConstant and ByteConstant.
7672 (Unary.Reduce): Check error values from TryReduceNegative().
7674 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7676 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7677 and report exception as error 182.
7679 2004-12-10 Raja R Harinath <rharinath@novell.com>
7681 * driver.cs (Main): Fix message when there are warnings.
7683 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7685 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7687 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7689 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7690 Reduced number of warnings.
7692 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7694 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7696 * driver.cs: Removed message.
7698 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7700 2004-12-08 <vargaz@freemail.hu>
7702 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7704 2004-12-08 Martin Baulig <martin@ximian.com>
7706 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7707 instead of a CS3002 for properties and indexer.
7709 2004-12-08 Martin Baulig <martin@ximian.com>
7711 * decl.cs (MemberName.ToString): Make this work again.
7713 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7715 * attribute.cs (Resolve): Add error 591 detection.
7717 * class.cs (FieldMember.Define): Add error 1547 detection.
7718 (Indexer.Define): Add error 620 detection.
7719 (Operator.Define): Add error 590 detection.
7721 * ecore.cs: Missing argument for error 79.
7723 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7726 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7729 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7732 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7734 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7735 Some operator comments were suppressed.
7736 * doc.cs : Implicit/explicit operator name in doc comments are like
7737 "op_Explicit(type)~returnType", so added suffix handling.
7739 2005-01-21 Alp Toker <alp@atoker.com>
7741 * cs-parser.jay: destructor_declaration's container is PartialContainer
7742 not Class when partial types are used, so use Kind prop instead of 'is'.
7744 2004-12-12 Martin Baulig <martin@ximian.com>
7746 * expression.cs (Unary.TryReduceNegative): Added support for
7747 SByteConstant and ByteConstant.
7748 (Unary.Reduce): Check error values from TryReduceNegative().
7750 2004-12-11 Martin Baulig <martin@ximian.com>
7752 * support.cs (ReflectionParameters.ParameterName): If we have a
7753 `gpd', call `ParameterName' on it.
7755 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7757 * pending.cs (PendingImplementation.DefineProxy): Call
7758 DefineParameter() for all of the MethodBuilder's arguments.
7760 2004-12-09 Martin Baulig <martin@ximian.com>
7762 * doc.cs (DocUtil): Make this a static class.
7764 2004-12-09 Martin Baulig <martin@ximian.com>
7766 * expression.cs (Invocation.InferType): Moved the type inference
7767 implementation into TypeManager.
7769 * generics.cs (TypeManager): Moved the type inference
7770 implementation here.
7772 2004-12-09 Martin Baulig <martin@ximian.com>
7774 * typemanager.cs (TypeManager): Make this a partial class.
7777 (TypeManager): Move the generics part of `TypeManager' here.
7779 2004-12-08 Martin Baulig <martin@ximian.com>
7781 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7782 instead of a CS3002 for properties and indexer. Added CS3024
7783 check for generic interfaces.
7785 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7786 instances are not CLS-compliant.
7788 2004-12-08 Martin Baulig <martin@ximian.com>
7791 (void_pointer_expression): New rule for `void*', `void**' etc.
7792 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7794 2004-12-08 Martin Baulig <martin@ximian.com>
7796 * expression.cs (Invocation.InferType): Removed the hack for
7797 MethodCore.MayUnify().
7799 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7802 * class.cs (MethodCore.MayUnify): Use
7803 TypeManager.MayBecomeEqualGenericTypes().
7805 2004-12-08 Martin Baulig <martin@ximian.com>
7807 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7808 parameter, box it. Fixes #69233.
7810 2004-12-08 Martin Baulig <martin@ximian.com>
7812 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7813 have the ctor constraint. Fixes #68326.
7815 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7817 * cs-parser.jay : interface comment was not consumed because of
7818 extra opt_semicolon before doc handling.
7820 2004-12-03 Raja R Harinath <rharinath@novell.com>
7822 Fix test-327.cs, test-328.cs, and put in early infrastructure
7823 for eventually fixing #52697.
7824 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7825 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7827 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7828 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7829 (VerifyUsing, error246): Update.
7830 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7831 'NamespaceEntry.LookupNamespaceOrType'.
7833 2004-12-07 Martin Baulig <martin@ximian.com>
7835 * driver.cs: Call it "BETA SOFTWARE" :-)
7837 2004-12-06 Raja R Harinath <rharinath@novell.com>
7839 Fix crash on cs0657-17.cs.
7840 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7841 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7842 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7843 the case where the NamespaceEntry gets overwritten.
7845 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7847 Fixed #69195, #56821
7848 * ecore.cs (ResolveBoolean): Tiny refactoring.
7850 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7851 of right expression resolving when left is false constant and
7852 operator is LogicalAnd OR true constant and operator is LogicalOr.
7854 * statement.cs (ResolveUnreachable): Always reports warning.
7856 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7858 * class.cs: Distinguish between 1721 and 1722 (just a little help
7859 for the programmer).
7861 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7863 * delegate.cs: Only allow this on new versions of the language.
7865 2004-12-02 Duncan Mak <duncan@ximian.com>
7867 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7869 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7870 here as a static method. Take an additional bool out parameter
7871 `must_do_cs1540_check' for signaling to InstanceResolve.
7872 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7873 member field from PropertyExpr class and made it an argument of
7875 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7876 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7877 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7878 and `remove_accessor' as well as InstanceResolve: report CS0122
7883 2004-12-07 Martin Baulig <martin@ximian.com>
7885 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7886 and CS0692 where appropriate.
7888 2004-12-06 Martin Baulig <martin@ximian.com>
7890 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7891 IsDuplicateImplementation() and improved it.
7893 * expression.cs (Invocation.InferTypeArguments): Added
7894 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7895 and removed the "ref" modifier from `infered_types'.
7897 * decl.cs (MemberName.ToString): Removed the exception.
7899 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7901 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7902 comments are allowed.
7904 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7906 * delegate.cs: Add checks for subtypes in paramaters and return values
7907 in VerifyMethod () to add support for Covariance/Contravariance
7910 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7912 * report.cs: Remove extra closing parenthesis.
7914 * convert.cs (Error_CannotImplicitConversion): If the name of the
7915 types are the same, provide some extra information.
7917 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7920 * attribute.cs (Resolve): Improved implementation of params
7921 attribute arguments.
7923 * support.cs (ParameterData): Add HasParams to be faster.
7925 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7927 all things are for /doc support:
7929 * doc.cs: new file that supports XML documentation generation.
7930 * mcs.exe.sources: added doc.cs.
7932 Handle /doc command line option.
7933 Report error 2006 instead of 5 for missing file name for /doc.
7934 Generate XML documentation when required, after type resolution.
7936 Added support for picking up documentation (/// and /** ... */),
7937 including a new XmlCommentState enumeration.
7939 Added lines to fill Documentation element for field, constant,
7940 property, indexer, method, constructor, destructor, operator, event
7941 and class, struct, interface, delegate, enum.
7942 Added lines to warn incorrect comment.
7944 Added Documentation field (passed only when /doc was specified).
7946 Added DocComment, DocCommentHeader, GenerateDocComment() and
7947 OnGenerateDocComment() and some supporting private members for
7948 /doc feature to MemberCore.
7950 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7952 Added overriden DocCommentHeader.
7954 Added overriden DocCommentHeader and GenerateDocComment().
7956 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7958 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7959 unwrapping the enumeration values, chain to
7960 DoConstantNumericPromotions again, so we can promote things to the
7961 fundamental types (takes care of enums that are bytes, sbytes).
7965 2004-12-01 Raja R Harinath <rharinath@novell.com>
7967 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7968 Fix long-standing bug in type-lookup. Use FindType instead of
7969 LookupType when ec.ResolvingTypeTree.
7970 (Attribute.ResolveType, Attribute.Resolve)
7971 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7973 (Attributes.Search): Remove internal version. Update.
7974 (Attributes.SearchMulti): Update.
7975 (Attributes.GetClsCompliantAttribute): Remove.
7976 (Attributes.GetIndexerNameAttribute): Remove.
7977 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7978 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7979 * class.cs (Indexer.Define): Likewise.
7981 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7984 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7985 MarshallByReference members access.
7987 * expression.cs: Use CheckMarshallByRefAccess;
7988 Better error CS0197 message.
7990 * report.cs: Print whole related error message.
7992 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7994 * class (GetClassBases): Better error 60 report.
7995 (EventProperty): Disabled warning 67 detection.
7997 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8000 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8002 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8005 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8008 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8010 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8012 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8014 * attribute.cs (Attribute.Resolve): Refine error reporting and
8015 report a cs0117 if the identifier does not exist, to distinguish
8016 from 0617 which is a miss-use of the actual identifier.
8018 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8019 between cs0070 and cs0079.
8021 * class.cs (MemberBase.DoDefine): When reporting a wrong
8022 accessibility level, we use MethodCore to compare instead of
8023 Method (this was a regression in some refactoring effort).
8025 So now we correctly report cs0056 again.
8027 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8028 testing the target_type (which was known to be object_type) and
8029 not the source type (which is anonymous_method).
8031 Fixed reporting of error cs1660.
8033 * expression.cs (UserCast.Source): Expose the underlying cast.
8035 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8036 allowed types to find a match to int32 first (most common).
8038 In addition, it ignores any ImplicitUserConversions that did an
8039 internal implicit conversion (as the switch statement allows only
8040 one integral conversion to exist).
8042 * class.cs (PartialContainer.Create): rename `name' to
8043 `member_name' for clarity. Then replace the string calls with a
8044 call to MemberName.GetPartialName, as now using
8045 MemberName.ToString is an error (this is due to the side effects
8046 it had, that were fixed in the past).
8048 This will restore the error reporting on a number of partial class
8049 errors that were missusing this (and getting an exception as a
8050 results, which is now just a plain textual warning, because
8051 yyparse debug output would crash otherwise).
8053 2004-11-26 Raja R Harinath <rharinath@novell.com>
8055 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8057 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8059 * rootcontext.cs (LookupType): Make sure to cache lookups that
8060 don't give us a negative result. This saves about 5% of corlib
8063 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8065 * report.cs (AbstractMessage.Print): messages are sent to stderr
8067 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8068 non-interface in the list of interfaces (at this point, either
8069 parent was properly set, or a base class is being listed in the
8070 interfaces section).
8072 This flags error 1722, and resolves the crash from bug 69259.
8074 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8076 * statement.cs (Using.EmitExpressionFinally): make this work right
8077 for valuetypes. Fixes 69926.
8079 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8081 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8082 converted to an enum" here, before we try to change the underlying
8083 type. This code exists, but it is a different code path than the
8084 one used while encoding constants.
8086 (ImplicitReferenceConversionExists): In addition, resynchronized
8087 the code here, so it matches the same code in
8088 ImplicitReferenceConversionExists for the `from any class-type S
8089 to any interface-type T'.
8091 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8093 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8095 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8097 * cs-parser.jay: Use verbosity accordingly.
8099 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8101 * expression.cs (Unary.ResolveOperator): Do not report warning;
8102 AddressOf reads from variable.
8104 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8106 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8110 * attribute.cs (Attributable): Removed CheckTargets.
8111 (Attributes.Emit): Explicit attribute targets are tested here.
8113 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8114 not enabled for interfaces.
8116 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8117 (GetAssemblyName): Ouch next bug there.
8119 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8121 * expression.cs: Error 275 added.
8123 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8125 Fix bug #69177 (Implemented decimal constant support)
8127 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8128 (BinaryFold): Add DecimalConstant.
8130 * const.cs (Define): Decimal constant
8132 (ChangeType): Add decimal type handling.
8133 (LookupConstantValue): Don't set value for decimal type but
8134 emit DecimalConstantAttribute. Needed for constant optimization.
8136 * constant.cs (ToDecimal): New method.
8137 (ConvertToDecimal): New method.
8138 (IntConstant): Implemented ConvertToDecimal.
8139 (DecimalConstant.Emit): Emit optimized version for decimals in
8142 * expression.cs (ResolveOperator): Changed order of constant
8143 reduction to work correctly with native types which have
8144 overloaded operators.
8145 (ResolveMemberAccess): Extract constant value from attribute
8148 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8150 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8151 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8152 (ChangeType): Decimal is special.
8153 (TypeToCoreType): Add decimal type.
8155 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8157 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8160 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8162 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8165 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8167 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8169 * pending.cs (PendingImplementation): Grab only interfaces.
8171 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8173 * statement.cs (ForeachHelperMethods): Add location member and
8174 error 202 detection.
8176 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8178 * expression.cs (DoResolveBase): Fixed wrong warning for out
8181 2004-12-04 Martin Baulig <martin@ximian.com>
8183 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8184 to check whether the conversion is ok.
8186 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8187 `Type.EmptyTypes' if we're not a generic TypeContainer.
8189 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8191 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8192 old bug: when converting from the null literal to a pointer,
8193 return an EmptyCast, not the NullLiteral.
8195 This fixes #69921, the recent null_type changes probably made this
8198 2004-12-03 Martin Baulig <martin@ximian.com>
8200 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8201 method as our child, call AnonymousMethod.Compatible() on it.
8203 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8205 * class.cs (FieldBase): Use an unused bit field from the field to
8206 encode the `has_offset' property from the FieldMember. This saves
8207 a couple of Ks on bootstrap compilation.
8209 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8210 method as our child, return the AnonymousMethod resolved
8213 * expression.cs (New.DoResolve): Allow return values from
8214 NewDelegate to also include AnonymousMethods.
8218 2004-11-29 Raja R Harinath <rharinath@novell.com>
8220 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8222 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8223 System.Runtime.InteropServices._Exception, since it's a base
8224 interface of the core type System.Exception in the net_2_0 profile.
8226 2004-11-27 Martin Baulig <martin@ximian.com>
8228 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8230 2004-11-26 Raja R Harinath <rharinath@novell.com>
8232 * Makefile: Convert to use executable.make.
8233 * gmcs.exe.sources: New.
8235 2004-11-25 Martin Baulig <martin@ximian.com>
8237 * expression.cs (Invocation.InferType): Added support for byref types.
8239 2004-11-25 Martin Baulig <martin@ximian.com>
8241 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8242 in TypeManager.TypeToCoreType().
8244 2004-11-25 Martin Baulig <martin@ximian.com>
8246 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8247 "Dispose" method from the `current_type'.
8248 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8249 DoDefineMembers() instead of using the MethodBuilder; this is
8250 required for generic iterators.
8252 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8254 2004-11-24 Martin Baulig <martin@ximian.com>
8256 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8258 2004-11-20 Martin Baulig <martin@ximian.com>
8260 * expression.cs (Invocation.InferType): Correctly infer generic
8261 instances; see gen-103.cs.
8262 (Invocation.InferTypeArguments): If a generic method doesn't have
8263 any unbound type parameters, we don't need to infer anything.
8265 2004-11-19 Raja R Harinath <rharinath@novell.com>
8267 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8269 2004-11-17 Raja R Harinath <rharinath@novell.com>
8271 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8272 (TypeHandle.GetMemberCache): New.
8273 (TypeHandle.TypeHandle): Update.
8274 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8275 (TypeManager.LookupParentInterfacesCache):
8276 Rename from LookupInterfaceCache. Optimize slightly.
8277 (TypeManager.MemberLookup_FindMembers): Update.
8278 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8280 (AddCacheContents): Rename from AddHashtable.
8281 * class.cs (TypeContainer.parent_container): Remove.
8282 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8283 (TypeContainer.DoDefineMembers): Don't initialize it.
8284 Update to name changes.
8286 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8288 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8289 that factors the code to check access modifiers on override.
8291 (PropertyBase): Use the code here.
8293 Patch from Lluis S'anchez, fixes bug #69361.
8295 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8297 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8298 routine that is used to report the use of a captured variable
8299 whose address has been taken.
8301 There are two checks: one when variables are being captured and
8302 the other check is when the address of a variable is taken.
8304 (because an anonymous methods might be resolved before *or* after
8305 the address has been taken) and
8307 * expression.cs (Conditional.DoResolve): Remove the special
8308 casing that Martin added to trueExpr and falseExpr being both
8309 NullLiteral. We get the right behavior now just by introducing
8310 the null_type into the compiler.
8312 * convert.cs (ExplicitConversion): Change the code to use
8313 null_type instead of testing `expr is NullLiteral'.
8314 (ImplicitConversionStandard): use null_type too.
8315 (ImplicitReferenceConversionExists): use null_type too.
8316 (ImplicitReferenceConversion): use null_type too.
8318 * literal.cs: The type of `NullLiteral' is now null_type instead
8320 (Resolve): Set the type here.
8322 * typemanager.cs: Introduce null_type.
8324 2004-11-18 Martin Baulig <martin@ximian.com>
8327 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8329 2004-11-18 Martin Baulig <martin@ximian.com>
8331 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8333 2004-11-18 Martin Baulig <martin@ximian.com>
8335 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8336 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8337 call ResolveConstructedType() on it to resolve it without checking
8339 (Constraints.ResolveTypes): Check them here.
8340 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8341 but don't check constraints.
8342 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8343 check constraints here.
8344 (ConstructedType.ResolveConstructedType): New public method. This
8345 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8346 resolve ourselves without checking constraints.
8348 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8350 2004-11-18 Martin Baulig <martin@ximian.com>
8353 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8355 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8357 2004-11-18 Martin Baulig <martin@ximian.com>
8359 * ecore.cs (TypeExpr.ResolveType): Removed.
8360 (Expression.ResolveAsTypeTerminal): We always return a fully
8361 resolved `TypeExpr', so we can just access its `Type'.
8363 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8365 2004-11-17 Martin Baulig <martin@ximian.com>
8367 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8368 sure we don't return any unresolved TypeExpr's.
8369 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8371 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8373 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8374 unresolved `ConstructedType's.
8376 2004-11-17 Martin Baulig <martin@ximian.com>
8378 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8380 2004-11-17 Martin Baulig <martin@ximian.com>
8383 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8385 * decl.cs (DeclSpace.ResolveType): Removed.
8386 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8388 2004-11-17 Martin Baulig <martin@ximian.com>
8390 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8391 direction, like FindMembers() does. Fixes #69546, testcase is in
8394 2004-11-16 Martin Baulig <martin@ximian.com>
8396 This is based on a patch from Marek Safar, see bug #69082.
8397 Fixes bugs #63705 and #67130.
8399 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8400 method; create a MemberCache for an interface type and cache the
8403 * decl.cs (IMemberContainer.ParentContainer): Removed.
8404 (IMemberContainer.ParentCache): New property.
8405 (MemberCache.SetupCacheForInterface): Removed.
8406 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8407 to create a cache for an interface's "parent".
8409 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8412 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8414 * statement.cs: Avoid adding bools to a hashtable.
8416 2004-11-15 Martin Baulig <martin@ximian.com>
8418 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8420 2004-11-11 Martin Baulig <martin@ximian.com>
8422 * typemanager.cs (TypeManager.GetMethodName): New method.
8424 * class.cs (MethodData.Define): Include the generic arity in the
8425 name of an explicit interface; also add it to the method name.
8427 * pending.cs (PendingImplementation.InterfaceMethod): The method
8428 name now includes the generic arity.
8430 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8432 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8433 calling an unsafe method from a safe location.
8435 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8438 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8440 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8442 * namespace.cs (VerifyUsing): use GetPartialName instead of
8445 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8447 * statement.cs (Return.Resolve): Fix regression in typo: if
8448 `in_exc', we have to request a NeedReturnLabel, this was a typo
8449 introduced in the anonymous method check-in. Fixes #69131.
8451 * Indexers were using the ShortName when defining themselves,
8452 causing a regression in the compiler bootstrap when applying the
8453 patch from 2004-11-02 (first part), now they use their full name
8454 and the bug is gone.
8456 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8458 * driver.cs: Strip the path from the names of embedded resources. Fixes
8461 2004-11-04 Raja R Harinath <rharinath@novell.com>
8463 Fix error message regression: cs0104-2.cs.
8464 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8465 (AliasEntry.Resolve): Update.
8466 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8468 (RootContext.LookupType): Update.
8470 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8472 * cs-parser.jay: Add support for handling accessor modifiers
8473 * class: Add support port accessor modifiers and error checking,
8474 define PropertyMethod.Define as virtual (not abstract anymore)
8475 * ecore.cs: Add checking for proeprties access with access modifiers
8476 * iterators.cs: Modify Accessor constructor call based in the modified
8478 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8480 * expression.cs (StringConcat): Handle being called twice,
8481 as when we have a concat in a field init with more than two
8484 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8486 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8487 special case explicit implementations, we should always produce
8488 the .property or .event declaration.
8490 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8491 since it will not return correct data if people use this
8492 unresolved in the presence of using statements (see test-313).
8494 * class.cs (MethodData.Define): If we are an explicit interface
8495 implementation, set the method name to the full name of the
8496 interface plus the name of the method.
8498 Notice that using the method.MethodName.GetFullName() does not
8499 work, as it will only contain the name as declared on the source
8500 file (it can be a shorthand in the presence of using statements)
8501 and not the fully qualifed type name, for example:
8505 class D : ICloneable {
8506 object ICloneable.Clone () {
8510 Would produce a method called `ICloneable.Clone' instead of
8511 `System.ICloneable.Clone'.
8513 * namespace.cs (Alias.Resolve): Use GetPartialName.
8515 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8517 * cs-parser.jay: Add error 1055 report.
8519 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8521 * assign.cs (Assign.DoResolve): Only do the transform of
8522 assignment into a New if the types are compatible, if not, fall
8523 through and let the implicit code deal with the errors and with
8524 the necessary conversions.
8526 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8528 * cs-parser.jay: Add error 1031 report.
8530 * cs-tokenizer.cs: Add location for error 1038.
8532 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8534 * cs-parser.jay: Add error 1016 report.
8536 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8538 * cs-parser.jay: Add errors 1575,1611 report.
8540 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8542 * cs-parser.jay: Add error 1001 report.
8544 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8547 * attribute.cs (GetMarshal): Add method argument for
8548 caller identification.
8550 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8551 agument for GetMarshal and RuntimeMissingSupport.
8553 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8555 * attribute.cs (ExtractSecurityPermissionSet): Removed
8556 TypeManager.code_access_permission_type.
8558 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8560 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8562 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8563 for obsolete use of a variable here. Fixes regression on errors
8564 cs0619-25 and cs0619-26.
8566 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8568 Fix #62358, implemented security attribute encoding.
8570 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8571 Tests permitted SecurityAction for assembly or other types.
8572 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8573 data from SecurityPermissionAttribute to PermisionSet class.
8575 * class.cs (ApplyAttributeBuilder): Added special handling
8576 for System.Security.Permissions.SecurityAttribute based types.
8578 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8579 special handling for System.Security.Permissions.SecurityAttribute
8582 * enum.cs (ApplyAttributeBuilder): Added special handling
8583 for System.Security.Permissions.SecurityAttribute based types.
8585 * parameter.cs (ApplyAttributeBuilder): Added special handling
8586 for System.Security.Permissions.SecurityAttribute based types.
8588 * rootcontext.cs: Next 2 core types.
8590 * typemanager.cs (TypeManager.security_permission_attr_type):
8591 Built in type for the SecurityPermission Attribute.
8592 (code_access_permission_type): Build in type.
8594 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8596 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8597 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8598 all of this information into
8599 EmitContext.EmitCapturedVariableInstance.
8601 * codegen.cs (EmitCapturedVariableInstance): move here the
8602 funcionality of emitting an ldarg.0 in the presence of a
8603 remapping. This centralizes the instance emit code.
8605 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8606 then emit a load of this: it means that we have reached the
8607 topmost ScopeInfo: the one that contains the pointer to the
8608 instance of the class hosting the anonymous method.
8610 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8611 captures to the topmost CaptureContext.
8613 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8615 * expression.cs (LocalVariableReference): Move the knowledge about
8616 the iterators into codegen's EmitCapturedVariableInstance.
8618 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8620 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8621 all code paths return a value from an anonymous method (it is the
8622 same as the 161 error, but for anonymous methods).
8624 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8626 The introduction of anonymous methods in the compiler changed
8627 various ways of doing things in the compiler. The most
8628 significant one is the hard split between the resolution phase
8629 and the emission phases of the compiler.
8631 For instance, routines that referenced local variables no
8632 longer can safely create temporary variables during the
8633 resolution phase: they must do so from the emission phase,
8634 since the variable might have been "captured", hence access to
8635 it can not be done with the local-variable operations from the runtime.
8639 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8640 is a toplevel block.
8642 (ToplevelBlock): A new kind of Block, these are the blocks that
8643 are created by the parser for all toplevel method bodies. These
8644 include methods, accessors and anonymous methods.
8646 These contain some extra information not found in regular blocks:
8647 A pointer to an optional CaptureContext (for tracking captured
8648 local variables and parameters). A pointer to the parent
8651 (Return.Resolve): Catch missmatches when returning a value from an
8652 anonymous method (error 1662).
8653 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8656 (Break.Resolve): ditto.
8658 (SwitchLabel): instead of defining the labels during the
8659 resolution phase, we now turned the public ILLabel and ILLabelCode
8660 labels into methods called GetILLabelCode() and GetILLabel() that
8661 only define the label during the Emit phase.
8663 (GotoCase): Track the SwitchLabel instead of the computed label
8664 (its contained therein). Emit the code by using
8665 SwitchLabel.GetILLabelCode ().
8667 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8668 whether the Local has been captured or not.
8670 (LocalInfo.IsCaptured): New property, used to tell whether the
8671 local has been captured.
8673 * anonymous.cs: Vastly updated to contain the anonymous method
8676 The main classes here are: CaptureContext which tracks any
8677 captured information for a toplevel block and ScopeInfo used to
8678 track the activation frames for various local variables.
8680 Each toplevel block has an optional capture context associated
8681 with it. When a method contains an anonymous method both the
8682 toplevel method and the anonymous method will create a capture
8683 context. When variables or parameters are captured, they are
8684 recorded on the CaptureContext that owns them, for example:
8688 MyDelegate d = delegate {
8693 Here `a' will be recorded as captured on the toplevel
8694 CapturedContext, the inner captured context will not have anything
8695 (it will only have data if local variables or parameters from it
8696 are captured in a nested anonymous method.
8698 The ScopeInfo is used to track the activation frames for local
8699 variables, for example:
8701 for (int i = 0; i < 10; i++)
8702 for (int j = 0; j < 10; j++){
8703 MyDelegate d = delegate {
8708 At runtime this captures a single captured variable `i', but it
8709 captures 10 different versions of the variable `j'. The variable
8710 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8711 recorded on a child.
8713 The toplevel ScopeInfo will also track information like the `this'
8714 pointer if instance variables were referenced (this is necessary
8715 as the anonymous method lives inside a nested class in the host
8716 type of the method).
8718 (AnonymousMethod): Expanded to track the Toplevel, implement
8719 `AnonymousMethod.Compatible' to tell whether an anonymous method
8720 can be converted to a target delegate type.
8722 The routine now also produces the anonymous method content
8724 (AnonymousDelegate): A helper class that derives from
8725 DelegateCreation, this is used to generate the code necessary to
8726 produce the delegate for the anonymous method that was created.
8728 * assign.cs: API adjustments for new changes in
8729 Convert.ImplicitStandardConversionExists.
8731 * class.cs: Adjustments to cope with the fact that now toplevel
8732 blocks are of type `ToplevelBlock'.
8734 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8735 insteda of standard blocks.
8737 Flag errors if params arguments are passed to anonymous methods.
8739 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8740 `CurrentAnonymousMethod' which points to the current Anonymous
8741 Method. The variable points to the AnonymousMethod class that
8742 holds the code being compiled. It is set in the new EmitContext
8743 created for the anonymous method.
8745 (EmitContext.Phase): Introduce a variable and an enumeration to
8746 assist in enforcing some rules about when and where we are allowed
8747 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8748 only one that enfonces this right now).
8750 (EmitContext.HaveCaptureInfo): new helper method that returns
8751 whether we have a CapturedContext initialized.
8753 (EmitContext.CaptureVariable): New method used to register that a
8754 LocalInfo must be flagged for capturing.
8756 (EmitContext.CapturedParameter): New method used to register that a
8757 parameters must be flagged for capturing.
8759 (EmitContext.CapturedField): New method used to register that a
8760 field must be flagged for capturing.
8762 (EmitContext.HaveCapturedVariables,
8763 EmitContext.HaveCapturedFields): Return whether there are captured
8764 variables or fields.
8766 (EmitContext.EmitMethodHostInstance): This is used to emit the
8767 instance for the anonymous method. The instance might be null
8768 (static methods), this (for anonymous methods that capture nothing
8769 and happen to live side-by-side with the current method body) or a
8770 more complicated expression if the method has a CaptureContext.
8772 (EmitContext.EmitTopBlock): Routine that drives the emission of
8773 code: it will first resolve the top block, then emit any metadata
8774 and then emit the code. The split is done so that we can extract
8775 any anonymous methods and flag any captured variables/parameters.
8777 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8778 during this phase, the ILGenerator should not be used as labels
8779 and local variables declared here might not be accessible to any
8780 code that is part of an anonymous method.
8782 Exceptions to this include the temporary variables that are
8783 created by some statements internally for holding temporary
8786 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8789 (EmitContext.TemporaryReturn): This method is typically called
8790 from the Emit phase, and its the only place where we allow the
8791 ReturnLabel to be defined other than the EmitMeta. The reason is
8792 that otherwise we would have to duplicate a lot of logic in the
8793 Resolve phases of various methods that today is on the Emit
8796 (EmitContext.NeedReturnLabel): This no longer creates the label,
8797 as the ILGenerator is not valid during the resolve phase.
8799 (EmitContext.EmitThis): Extended the knowledge in this class to
8800 work in anonymous methods in addition to iterators.
8802 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8803 code is necessary on the stack to access the instance to a local
8804 variable (the variable will be accessed as a field).
8806 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8807 EmitContext.EmitAddressOfParameter): Routines to support
8808 parameters (not completed at this point).
8810 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8811 will also remove the parameters.
8813 * convert.cs (Convert): Define a `ConstantEC' which points to a
8814 null. This is just to prefity some code that uses
8815 ImplicitStandardConversion code and do not have an EmitContext
8818 The idea is to flag explicitly that at that point in time, it is
8819 known that the conversion will not trigger the delegate checking
8820 code in implicit conversions (which requires a valid
8823 Everywhere: pass new EmitContext parameter since
8824 ImplicitStandardConversionExists now requires it to check for
8825 anonymous method conversions.
8827 (Convert.ImplicitStandardConversionExists): If the type of an
8828 expression is the anonymous_method_type, and the type is a
8829 delegate, we invoke the AnonymousMethod.Compatible method to check
8830 whether an implicit conversion is possible.
8832 (Convert.ImplicitConversionStandard): Only do implicit method
8833 group conversions if the language level is not ISO_1.
8835 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8836 MethodInfo for the Invoke method. used by Delegate and
8839 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8840 method conversions if the target type is a delegate.
8842 Removed extra debugging nops.
8844 (LocalVariableReference): Turn the `local_info' into a public
8847 Add `prepared' field, the same hack used for FieldExprs to cope
8848 with composed assignments, as Local variables do not necessarily
8849 operate purely on the stack as they used to: they can be captured
8852 Add `temp' for a temporary result, like fields.
8854 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8856 It now copes with Local variables that are captured and emits the
8857 proper instance variable to load it from a field in the captured
8860 (ParameterReference.DoResolveBase): During the resolve phase,
8861 capture parameters if we are in an anonymous method.
8863 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8864 anonymous method, use the EmitContext helper routines to emit the
8865 parameter reference.
8867 * iterators.cs: Set RemapToProxy to true/false during the
8870 * parameters.cs (GetParameterByName): New helper method.
8872 * typemanager.cs (anonymous_method_type) a new type that
8873 represents an anonyous method. This is always an internal type,
8874 used as a fencepost to test against the anonymous-methodness of an
8877 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8879 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8881 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8883 2004-11-10 Martin Baulig <martin@ximian.com>
8885 * expression.cs (Invocation.BetterFunction): If two methods have
8886 equal parameter types, but only one of them is generic, the
8887 non-generic one wins.
8888 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8889 instance; just use `Type.IsValueType' to determine whether
8890 something is a struct or not.
8891 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8892 so we can be called multiple times.
8894 2004-11-10 Martin Baulig <martin@ximian.com>
8896 * generic.cs (TypeParameter.DefineConstraints): New public method.
8897 (TypeParameter.CheckAccessLevel): Override this and return true.
8898 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8899 override ResolveType() anymore.
8900 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8902 2004-11-10 Martin Baulig <martin@ximian.com>
8904 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8905 call DeclSpace.ResolveNestedType() on it.
8907 2004-11-10 Martin Baulig <martin@ximian.com>
8909 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8910 non-null, call ParameterModifier() on it.
8912 2004-11-10 Martin Baulig <martin@ximian.com>
8915 (Iterators): Added `current_type' and `this_type' fields.
8916 (Iterators.DefineIterator): Create a new EmitContext and store it
8917 in `ec'; compute `this_type'.
8919 2004-11-10 Martin Baulig <martin@ximian.com>
8922 (TypeManager.IsPrivateAccessible): New public method.
8923 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8925 2004-11-10 Martin Baulig <martin@ximian.com>
8927 * class.cs (TypeContainer.DefineType): Call
8928 TypeBuilder.DefineGenericParameters() before resolving the type
8930 (MethodData.parent_method): New protected field.
8931 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8932 (MethodData.Define): Compute `parent_method'.
8935 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8936 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8937 (DeclSpace.ec): New protected field; store the EmitContext here.
8938 (DeclSpace.EmitContext): New public property.
8939 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8940 (DeclSpace.ResolveNestedType): New public method.
8941 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8942 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8943 (DeclSpace.FamilyAccessible): Likewise.
8944 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8945 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8948 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8951 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8952 (Enum.Emit): Don't create a new EmitContext.
8954 2004-10-18 Martin Baulig <martin@ximian.com>
8956 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8957 `Type' directly, but call ResolveType() on it.
8958 (Catch.Resolve): Likewise.
8959 (Foreach.Resolve): Likewise.
8961 2004-10-18 Martin Baulig <martin@ximian.com>
8963 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8964 `Type' directly, but call ResolveType() on it.
8965 (Probe.DoResolve): Likewise.
8966 (ArrayCreation.LookupType): Likewise.
8967 (TypeOf.DoResolve): Likewise.
8968 (SizeOf.DoResolve): Likewise.
8970 2004-10-18 Raja R Harinath <rharinath@novell.com>
8972 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8975 2004-10-17 John Luke <john.luke@gmail.com>
8977 * class.cs (Operator.GetSignatureForError): use CSharpName
8979 * parameter.cs (Parameter.GetSignatureForError): Returns
8980 correct name even if was not defined.
8982 2004-10-13 Raja R Harinath <rharinath@novell.com>
8985 * class.cs (TypeContainer.EmitContext): New property.
8986 (DefineNestedTypes): Create an emitcontext for each part.
8987 (MethodCore.DoDefineParameters): Use container's emitcontext.
8988 Pass type array to InternalParameters.
8989 (MemberBase.DoDefine): Use container's emitcontext.
8990 (FieldMember.Define): Likewise.
8991 (Event.Define): Likewise.
8992 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8993 Pass type array to InternalParameters.
8994 (SetIndexerMethod.GetParameterInfo): Likewise.
8995 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8996 * delegate.cs (Define): Pass emitcontext to
8997 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8998 array to InternalParameters.
8999 * expression.cs (ParameterReference.DoResolveBase): Pass
9000 emitcontext to GetParameterInfo.
9001 (ComposedCast.DoResolveAsTypeStep): Remove check on
9002 ec.ResolvingTypeTree.
9003 * parameter.cs (Parameter.Resolve): Change argument to
9004 EmitContext. Use ResolveAsTypeTerminal.
9005 (Parameter.GetSignature): Change argument to EmitContext.
9006 (Parameters.ComputeSignature): Likewise.
9007 (Parameters.ComputeParameterTypes): Likewise.
9008 (Parameters.GetParameterInfo): Likewise.
9009 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9010 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9011 * support.cs (InternalParameters..ctor): Remove variant that takes
9013 * typemanager.cs (system_intptr_expr): New.
9014 (InitExpressionTypes): Initialize it.
9016 2004-10-12 Chris Toshok <toshok@ximian.com>
9018 * cs-parser.jay: fix location for try_statement and catch_clause.
9020 2004-10-18 Martin Baulig <martin@ximian.com>
9022 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9023 `Type' directly, but call ResolveType() on it.
9024 (MemberBase.DoDefine): Likewise.
9026 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9027 `Type' directly, but call ResolveType() on it.
9028 (ComposedCast.DoResolveAsTypeStep): Likewise.
9030 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9031 `Type' directly, but call ResolveType() on it.
9033 2004-10-17 John Luke <john.luke@gmail.com>
9035 * class.cs (Operator.GetSignatureForError): use CSharpName
9037 * parameter.cs (Parameter.GetSignatureForError): Returns
9038 correct name even if was not defined.
9040 2004-10-13 Raja R Harinath <rharinath@novell.com>
9043 * class.cs (TypeContainer.EmitContext): New property.
9044 (DefineNestedTypes): Create an emitcontext for each part.
9045 (MethodCore.DoDefineParameters): Use container's emitcontext.
9046 Pass type array to InternalParameters.
9047 (MemberBase.DoDefine): Use container's emitcontext.
9048 (FieldMember.Define): Likewise.
9049 (Event.Define): Likewise.
9050 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9051 Pass type array to InternalParameters.
9052 (SetIndexerMethod.GetParameterInfo): Likewise.
9053 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9054 * delegate.cs (Define): Pass emitcontext to
9055 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9056 array to InternalParameters.
9057 * expression.cs (ParameterReference.DoResolveBase): Pass
9058 emitcontext to GetParameterInfo.
9059 (ComposedCast.DoResolveAsTypeStep): Remove check on
9060 ec.ResolvingTypeTree.
9061 * parameter.cs (Parameter.Resolve): Change argument to
9062 EmitContext. Use ResolveAsTypeTerminal.
9063 (Parameter.GetSignature): Change argument to EmitContext.
9064 (Parameters.ComputeSignature): Likewise.
9065 (Parameters.ComputeParameterTypes): Likewise.
9066 (Parameters.GetParameterInfo): Likewise.
9067 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9068 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9069 * support.cs (InternalParameters..ctor): Remove variant that takes
9071 * typemanager.cs (system_intptr_expr): New.
9072 (InitExpressionTypes): Initialize it.
9074 2004-10-12 Chris Toshok <toshok@ximian.com>
9076 * cs-parser.jay: fix location for try_statement and catch_clause.
9078 2004-10-07 Raja R Harinath <rharinath@novell.com>
9080 More DeclSpace.ResolveType avoidance.
9081 * decl.cs (MemberCore.InUnsafe): New property.
9082 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9083 with newly created EmitContext.
9084 (FieldMember.Define): Likewise.
9085 * delegate.cs (Delegate.Define): Likewise.
9086 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9087 only if normal name-lookup fails.
9088 (TypeExpr.DoResolve): Enable error-checking.
9089 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9090 (SizeOf.DoResolve): Likewise.
9091 (ComposedCast.DoResolveAsTypeStep): Likewise.
9092 (StackAlloc.DoResolve): Likewise.
9093 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9094 (Block.Unsafe): New property.
9095 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9096 (Unsafe): Set 'unsafe' flag of contained block.
9097 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9098 (Fixed.Resolve): Likewise.
9099 (Catch.Resolve): Likewise.
9100 (Using.ResolveLocalVariableDecls): Likewise.
9101 (Foreach.Resolve): Likewise.
9103 2004-10-05 John Luke <john.luke@gmail.com>
9105 * cs-parser.jay: add location to error CS0175
9107 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9109 * ecore.cs (Expression.Constantity): Add support for turning null
9112 * const.cs (Const.Define): Allow constants to be reference types
9113 as long as the value is Null.
9115 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9117 * namespace.cs (NamespaceEntry.Using): No matter which warning
9118 level is set, check if this namespace name has already been added.
9120 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9122 * expression.cs: reftype [!=]= null should always use br[true,false].
9125 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9128 * attribute.cs: Enum conversion moved to
9129 GetAttributeArgumentExpression to be applied to the all
9132 2004-10-01 Raja R Harinath <rharinath@novell.com>
9134 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9135 * class.c (TypeContainer.DefineType): Flag error if
9136 base types aren't accessible due to access permissions.
9137 * decl.cs (DeclSpace.ResolveType): Move logic to
9138 Expression.ResolveAsTypeTerminal.
9139 (DeclSpace.ResolveTypeExpr): Thin layer over
9140 Expression.ResolveAsTypeTerminal.
9141 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9142 Refactor code into NestedAccess. Use it.
9143 (DeclSpace.NestedAccess): New.
9144 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9145 argument to silence errors. Check access permissions.
9146 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9147 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9148 (Cast.DoResolve): Likewise.
9149 (New.DoResolve): Likewise.
9150 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9151 (TypeOf.DoResolve): Likewise.
9153 * expression.cs (Invocation.BetterConversion): Return the Type of
9154 the better conversion. Implement section 14.4.2.3 more faithfully.
9155 (Invocation.BetterFunction): Make boolean. Make correspondence to
9156 section 14.4.2.2 explicit.
9157 (Invocation.OverloadResolve): Update.
9158 (Invocation): Remove is_base field.
9159 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9160 (Invocation.Emit): Likewise.
9162 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9164 * cs-parser.jay: Reverted 642 warning fix.
9166 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9169 * decl.cs (FindMemberWithSameName): Indexer can have more than
9172 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9174 * expression.cs (LocalVariableReference.DoResolveLValue):
9175 Do not report warning 219 for out values.
9176 (EmptyExpression.Null): New member to avoid extra allocations.
9178 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9180 * cs-parser.jay: Fix wrong warning 642 report.
9182 * cs-tokenizer.cs (CheckNextToken): New helper;
9183 Inspect next character if is same as expected.
9185 2004-09-23 Martin Baulig <martin@ximian.com>
9187 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9188 (Convert.ImplicitReferenceConversionExists): Likewise.
9190 2004-11-09 Raja R Harinath <rharinath@novell.com>
9192 * Makefile (DISTFILES): Comment out a few missing files.
9194 2004-10-29 Raja R Harinath <rharinath@novell.com>
9196 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9197 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9198 (gmcs.exe): Invoke bootstrap-libs.
9199 (clean-local): Clean the net_2_0_bootstrap profile too.
9200 (PROGRAM_INSTALL_DIR): New.
9201 (install-local): Use it.
9203 2004-10-13 Martin Baulig <martin@ximian.com>
9205 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9206 (TypeParameter.DefineType): If we're a method type parameter and
9207 that method is overriding something, "inflate" its constraints.
9209 2004-10-12 Martin Baulig <martin@ximian.com>
9211 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9212 and have type arguments, create and resolve a ConstructedType.
9214 2004-10-12 Martin Baulig <martin@ximian.com>
9216 * decl.cs (MemberCache.FindMemberToOverride): Use
9217 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9218 to compare the invocationType.
9220 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9221 When comparing two type parameters, only do the signature-only
9222 comparision for method type parameters.
9224 2004-10-11 Martin Baulig <martin@ximian.com>
9226 * report.cs: Don't make --fatal abort on warnings, we have
9227 -warnaserror for that.
9229 2004-10-11 Martin Baulig <martin@ximian.com>
9232 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9233 (TypeManager.IsEqual): Call ourself recursively instead of using
9236 2004-10-11 Martin Baulig <martin@ximian.com>
9238 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9239 on our own type parameters, not on the ones we inherit from a containing
9242 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9245 * generic.cs (TypeParameter.Define): We may only be called once.
9247 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9248 instead of TypeManager.IsEqual().
9250 2004-09-28 Martin Baulig <martin@ximian.com>
9253 (GenericConstraints.EffectiveBaseClass): New public property.
9254 (TypeParameter.GenericConstraints): New public property.
9255 (ConstructedType.CheckConstraints): Improved.
9257 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9258 (Convert.TypeParameterConversion): New private method; use this in
9259 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9260 for all conversions related to type parameters.
9262 2004-09-24 Martin Baulig <martin@ximian.com>
9264 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9265 type parameter conversions for type parameters which are known to
9268 2004-09-24 Martin Baulig <martin@ximian.com>
9270 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9271 `IsValueType' properties.
9273 * support.cs (ReflectionConstraints): Use
9274 Type.GetGenericParameterConstraints() instead of the old hack.
9276 2004-09-24 Martin Baulig <martin@ximian.com>
9278 * generic.cs (GenericConstraints): Moved here and made it an
9281 * support.cs (GenericConstraints): Moved to generic.cs.
9283 2004-09-24 Martin Baulig <martin@ximian.com>
9286 (ReflectionConstraints): Un-nested this class and made it public.
9289 (TypeManager.GetTypeParameterConstraints): New public method.
9290 (TypeManager.HasConstructorConstraint): Use the attributes.
9292 2004-09-24 Martin Baulig <martin@ximian.com>
9294 * support.cs (GenericConstraints): Replaced `HasConstructor',
9295 `IsReferenceType' and `IsValueType' with `Attributes'.
9296 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9297 method and made the .ctor public.
9299 * generic.cs (Constraints.Attributes): New public property.
9300 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9301 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9302 `IsValueType' -> `HasValueTypeConstraint'.
9304 2004-09-23 Martin Baulig <martin@ximian.com>
9306 * generic.cs (Constraints): Reflect latest runtime changes.
9308 2004-09-23 Martin Baulig <martin@ximian.com>
9310 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9311 (Convert.ImplicitReferenceConversionExists): Likewise.
9313 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9315 * class.cs (Operator.Define): Add error 448 and 559 report.
9317 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9319 * class.cs (MemberBase.IsTypePermitted): New protected
9320 method for checking error CS0610.
9322 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9324 * class.cs (TypeContainer.HasExplicitLayout): New property
9325 Returns whether container has StructLayout attribute set Explicit.
9326 (FieldMember): New abstract class for consts and fields.
9327 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9328 (Field): Reuse FieldMember.
9330 * const.cs (Const): Reuse FieldMember.
9332 * rootcontext.cs: EmitConstants call moved to class.
9334 2004-09-22 Martin Baulig <martin@ximian.com>
9336 Marek and me just fixed one of our oldest bugs: #28562 :-)
9338 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9340 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9341 we're an EnumConstant, just return that.
9342 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9343 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9344 to get the value which'll actually be written into the attribute.
9345 However, we have to use GetValue() to access the attribute's value
9348 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9350 * constant.cs (Constant.IsNegative): New abstract property
9353 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9354 (StackAlloc.DoResolve): Reused IsNegative.
9356 2004-09-22 Martin Baulig <martin@ximian.com>
9358 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9359 public method; like LookupTypeContainer, but also works for
9362 * report.cs (Report.SymbolRelatedToPreviousError): Use
9363 TypeManager.LookupGenericTypeContainer().
9365 2004-09-22 Martin Baulig <martin@ximian.com>
9367 Thanks to Peter Sestoft for this bug report.
9369 * expression.cs (Conditional): If both the `trueExpr' and the
9370 `falseExpr' is a NullLiteral, return a NullLiteral.
9372 2004-09-22 Martin Baulig <martin@ximian.com>
9374 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9375 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9376 for the "get_Current" call.
9378 2004-09-21 Martin Baulig <martin@ximian.com>
9380 * convert.cs (Convert.ImplicitReferenceConversion): When
9381 converting to an interface type, first check whether we're
9382 converting from a reference type.
9384 2004-09-14 Martin Baulig <martin@ximian.com>
9386 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9388 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9391 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9392 called and is obsolete then this member suppress message
9393 when call is inside next [Obsolete] method or type.
9395 * expression.cs: Use TestObsoleteMethodUsage member.
9397 2004-09-14 Martin Baulig <martin@ximian.com>
9399 * genericparser.cs: Removed.
9401 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9403 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9405 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9407 * attribute.cs (Attribute.Resolve): Add error 653 report.
9409 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9411 (Method.ApplyAttributeBuilder): Add error 685 report.
9412 (Operator.Define): Add error 564 report.
9414 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9416 * expression.cs (Invocation.DoResolve): Add error
9419 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9422 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9424 * class.cs (ConstructorInitializer.Resolve):
9425 Wrong error number (515->516).
9427 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9429 * class.cs (Indexer.Define): Add error 631 report.
9431 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9433 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9435 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9437 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9439 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9441 * cs-parser.jay: Added error CS0241 report.
9443 2004-09-10 Raja R Harinath <rharinath@novell.com>
9445 * cs-parser.jay (fixed_statement): Introduce a scope for the
9446 declaration in the 'fixed' statement.
9448 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9450 * cs-parser.jay: Added CS0230 error report.
9452 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9454 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9456 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9458 * expression.cs (Argument.Resolve): Added error CS0192 and
9461 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9463 C# 2.0 #pragma warning feature
9465 * cs-tokenizer.cs (PreProcessPragma): New method;
9466 Handles #pragma directive.
9468 * report.cs (WarningRegions): New class; Support
9469 class for #pragma warning directive. It tests whether
9470 warning is enabled for a given line.
9472 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9474 * const.cs: Add more descriptive error report, tahnks to
9477 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9479 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9481 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9483 * expression.cs: Apply patch from Ben: Remove dead code from
9484 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9485 as that code just threw an exception anwyays.
9487 * const.cs: Remove the call to the turnintoconstant, for details
9490 * literal.cs: The type of the null-literal is the null type; So
9491 we use a placeholder type (literal.cs:System.Null, defined here)
9494 * expression.cs (Conditional.DoResolve): Remove some old code that
9495 is no longer needed, conversions have been fixed.
9497 (ArrayCreationExpression.DoResolve): Return false if we fail to
9498 resolve the inner expression.
9500 2004-09-07 Raja R Harinath <rharinath@novell.com>
9503 * cs-parser.jay (delegate_declaration): Record a delegate
9504 declaration as a type declaration.
9505 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9507 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9509 * parameter.cs: Do not crash if the type can not be resolved.
9511 * expression.cs: Report errors with unsafe pointers, fixes #64896
9513 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9515 * expression.cs: Pointer arith always needs to do a conv.i
9516 if the operand is a long. fix 65320
9518 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9520 Fixed cs0619-37.cs, cs0619-38.cs
9522 * enum.cs (GetObsoleteAttribute): Removed.
9524 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9525 on Enum member is double staged. The first is tested member
9528 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9530 Fixed #56986, #63631, #65231
9532 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9533 adds member to name container.
9534 (TypeContainer.AddToTypeContainer): New method, adds type to
9536 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9537 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9538 AddOperator): Simplified by reusing AddToMemberContainer.
9539 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9541 (Method.CheckForDuplications): Fixed implementation to test all
9543 (MemberBase): Detection whether member is explicit interface
9544 implementation is now in constructor.
9545 (MemberBase.UpdateMemberName): Handles IndexerName.
9546 (Accessor): Changed to keep also location information.
9547 (AbstractPropertyEventMethod): Is derived from MemberCore.
9548 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9549 will be emited or not.
9550 (PropertyBase.AreAccessorsDuplicateImplementation):
9551 Tests whether accessors are not in collision with some method.
9552 (Operator): Is derived from MethodCore to simplify common
9555 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9557 (DeclSpace.AddToContainer): Adds the member to defined_names
9558 table. It tests for duplications and enclosing name conflicts.
9560 * enum.cs (EnumMember): Clean up to reuse the base structures
9562 2004-09-03 Martin Baulig <martin@ximian.com>
9564 Merged latest changes into gmcs. Please keep this comment in
9565 here, it makes it easier for me to see what changed in MCS since
9566 the last time I merged.
9568 2004-09-03 Martin Baulig <martin@ximian.com>
9570 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9571 into TypeContainer, to make partial classes work again.
9573 2004-09-03 Martin Baulig <martin@ximian.com>
9575 * rootcontext.cs (RootContext.V2): Removed.
9577 2004-03-23 Martin Baulig <martin@ximian.com>
9579 * expression.cs (Invocation.OverloadResolve): Added `bool
9580 may_fail' argument and use it instead of the Location.IsNull() hack.
9582 2004-09-09 Martin Baulig <martin@ximian.com>
9584 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9586 2004-09-09 Martin Baulig <martin@ximian.com>
9588 * generic.cs (TypeParameter.DefineType): Added support for
9589 explicit interface methods.
9591 2004-09-09 Martin Baulig <martin@ximian.com>
9593 * README.Changes: New document. Started to list important changes
9594 between MCS and GMCS here.
9596 2004-09-08 Martin Baulig <martin@ximian.com>
9599 (TypeContainer.CheckRecursiveDefinition): New protected method.
9600 (TypeContainer.DefineType): Move the CS0146 check into
9601 CheckRecursiveDefinition().
9603 2004-09-06 Martin Baulig <martin@ximian.com>
9605 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9606 types for the constructor constraint.
9608 2004-09-03 Martin Baulig <martin@ximian.com>
9610 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9611 into TypeContainer, to make partial classes work again.
9613 2004-09-03 Martin Baulig <martin@ximian.com>
9615 * rootcontext.cs (RootContext.V2): Removed.
9617 2004-03-23 Martin Baulig <martin@ximian.com>
9619 * expression.cs (Invocation.OverloadResolve): Added `bool
9620 may_fail' argument and use it instead of the Location.IsNull() hack.
9622 2004-09-03 Martin Baulig <martin@ximian.com>
9624 Merged latest changes into gmcs. Please keep this comment in
9625 here, it makes it easier for me to see what changed in MCS since
9626 the last time I merged.
9628 2004-09-03 Raja R Harinath <rharinath@novell.com>
9631 * expression.cs (BetterConversion): Don't allow either conversion
9632 to be null. Remove redundant implicit conversion test when 'q ==
9633 null' -- when this function is invoked, we already know that the
9634 implicit conversion exists.
9635 (BetterFunction): Assume that 'best' is non-null. Remove
9636 redundant reimplementation of IsApplicable when 'best' is null.
9637 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9638 number of arguments.
9639 (IsAncestralType): Extract from OverloadResolve.
9640 (OverloadResolve): Make robust to the MethodGroupExpr being
9641 unsorted. Implement all the logic of Section 14.5.5.1, and
9642 support overloading of methods from multiple applicable types.
9643 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9645 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9646 (RealError, Warning): Append type of report to related symbol.
9648 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9650 * enum.cs: Fixed CLS-Compliance checks for enum members.
9651 Error tests cs3008-8.cs, cs3014-8.cs
9653 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9655 Fixed bug #62342, #63102
9656 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9657 like ImplementMethod.
9659 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9661 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9664 2004-09-02 Martin Baulig <martin@ximian.com>
9666 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9667 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9670 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9672 C# 2.0 Static classes implemented
9674 * class.cs (TypeContainer): instance_constructors,
9675 initialized_fields, initialized_static_fields,
9676 default_constructor, base_inteface_types are protected to be
9677 accessible from StaticClass.
9678 (TypeContainer.DefineDefaultConstructor): New virtual method
9679 for custom default constructor generating
9680 (StaticClass): New class to handle "Static classes" feature.
9682 * cs-parser.jay: Handle static keyword on class like instance
9685 * driver.cs: Added "/langversion" command line switch with two
9686 options (iso-1, default).
9688 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9690 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9692 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9694 * delegate.cs: Style.
9696 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9698 * delegate.cs: Add seperate instance expr field for miguel.
9700 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9702 * PointerArithmetic (Resolve): make sure we are not doing
9703 pointer arith on void*. Also, make sure we are resolved
9704 by not setting eclass until resolve.
9706 All callers: Make sure that PointerArithmetic gets resolved.
9708 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9710 * ArrayCreation (LookupType): If the type does not resolve
9711 to an array, give an error.
9713 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9715 * statement.cs (Try.Resolve): Fixed bug #64222
9717 2004-08-27 Martin Baulig <martin@ximian.com>
9720 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9723 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9725 * ecore.cs (Constantify): Get underlying type via
9726 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9727 Windows in special cases.
9729 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9731 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9732 for obtaining also private methods.
9733 (GetRemoveMethod): Used GetRemoveMethod (true)
9734 for obtaining also private methods.
9736 2004-09-02 Martin Baulig <martin@ximian.com>
9738 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9739 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9742 2004-08-27 Martin Baulig <martin@ximian.com>
9745 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9748 2004-08-25 Martin Baulig <martin@ximian.com>
9750 * support.cs (ReflectionParameters..ctor): If this is a generic
9751 method, retrieve and store its type parameters.
9752 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9753 (ReflectionParameters.GenericConstraints): The argument specifies
9754 the type parameter, not the method parameter.
9755 (InternalParameters.GenericConstraints): Likewise.
9757 * generic.cs (TypeParameter.DefineType): Correctly handle
9758 constraints wrt. generic methods in interfaces and their
9761 2004-08-24 Martin Baulig <martin@ximian.com>
9763 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9764 (Constraints.IsSubclassOf): New internal method.
9766 * typemanager.cs (TypeManager.FindMembers): Added special support
9767 for GenericTypeParameterBuilder's.
9768 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9771 2004-08-24 Martin Baulig <martin@ximian.com>
9774 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9775 this for accessibility checks.
9776 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9777 IsNestedFamilyAccessible.
9778 (TypeManager.IsSubclassOf): New method, do what the name actually
9781 2004-08-24 Martin Baulig <martin@ximian.com>
9783 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9784 as a SimpleName, include the generic arity.
9786 2004-08-24 Martin Baulig <martin@ximian.com>
9788 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9789 MethodAttributes.HideBySig for operators.
9791 2004-08-23 Martin Baulig <martin@ximian.com>
9793 Back to the old error reporting system :-)
9795 * report.cs (Message): Removed.
9796 (Report.MessageData, ErrorData, WarningData): Removed.
9797 (Report.Error, Warning): Back to the old system.
9799 2004-08-23 Martin Baulig <martin@ximian.com>
9801 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9803 * class.cs (TypeContainer.ParentContainer): New public virtual
9804 method; replaces the explicit interface implementation.
9805 (ClassPart.ParentContainer): Override.
9807 2004-08-23 Martin Baulig <martin@ximian.com>
9809 * statement.cs (Switch): Added support for constant switches; see
9810 #59428 or test-285.cs.
9812 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9815 * statement.cs (GetEnumeratorFilter): Removed useless
9816 logic because C# specs is strict. GetEnumerator must be
9819 2004-08-22 Martin Baulig <martin@ximian.com>
9821 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9822 a switch and may break, reset the barrier. Fixes #59867.
9824 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9826 CLS-Compliance speed up (~5% for corlib)
9828 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9829 New method. Tests container for CLS-Compliant names
9831 * class.cs (TypeContainer.VerifyClsName): New method.
9832 Checks whether container name is CLS Compliant.
9833 (Constructor): Implements IMethodData.
9835 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9836 low-case table for CLS Compliance test.
9837 (MemberCache.VerifyClsParameterConflict): New method.
9838 Checks method parameters for CS3006 error.
9840 * enum.cs (EnumMember): Is derived from MemberCore.
9841 (Enum.VerifyClsName): Optimized for better performance.
9843 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9845 * report.cs: Renamed Error_T to Error and changed all
9848 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9850 * class.cs (TypeContainer.IndexerArrayList): New inner class
9851 container for indexers.
9852 (TypeContainer.DefaultIndexerName): New constant for default
9853 indexer name. Replaced all "Item" with this constant.
9854 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9856 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9857 DefaultMemberAttribute constructor.
9859 2004-08-05 Martin Baulig <martin@ximian.com>
9861 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9864 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9866 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9867 multi platforms problem.
9869 * compiler.csproj: Included shared files.
9871 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9873 Fix bug 60333, 55971 in the more general way
9874 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9875 Added arg_type argument for constant conversion.
9876 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9878 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9881 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9882 OperatorArrayList, MethodCoreArrayList for typecontainer
9883 containers. Changed class member types to these new types.
9884 (MethodArrayList.DefineMembers): Added test for CS0659.
9886 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9888 * cfold.cs: Synchronize the folding with the code in expression.cs
9889 Binary.DoNumericPromotions for uint operands.
9891 * attribute.cs: Revert patch from Raja, it introduced a regression
9892 while building Blam-1.2.1 (hard to isolate a test case).
9894 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9898 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9900 (MethodCore.parent_method): New member. The method we're overriding
9901 if this is an override method.
9902 (MethodCore.CheckBase): Moved from Method class and made common.
9903 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9905 (MethodCore.CheckForDuplications): New abstract method. For custom
9906 member duplication search in a container
9907 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9908 method and its return type.
9909 (Event.conflict_symbol): New member. Symbol with same name in the
9913 (MemberCache.FindMemberWithSameName): New method. The method
9914 is looking for conflict with inherited symbols.
9916 2004-08-04 Martin Baulig <martin@ximian.com>
9918 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9920 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9922 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9924 * report.cs (Message): New enum for better error, warning reference in
9926 (MessageData): New inner abstract class. It generally handles printing of
9927 error and warning messages.
9928 Removed unused Error, Warning, Message methods.
9930 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9932 Fix for cs0592-8.cs test
9934 (Attributable.ValidAttributeTargets): Made public.
9935 (Attribute.ExplicitTarget): New member for explicit target value.
9936 (Attribute.CheckTargets): Now we translate explicit attribute
9937 target to Target here.
9939 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9941 * ecore.cs (MethodGroupExpr): new IsBase property.
9943 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9945 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9946 rather than an instance expr.
9948 (DelegateCreation.Emit): Use the method group rather than
9949 the instance expression. Also, if you have base.Foo as the
9950 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9952 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9954 (NewDelegate.DoResolve): Only check for the existance of Invoke
9955 if the method is going to be needed. Use MethodGroupExpr.
9957 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9959 * expression.cs: For pointer arith., make sure to use
9960 the size of the type, not the size of the pointer to
9963 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9966 * class.cs (Class): Added error CS0502 test.
9968 2004-08-03 John Luke <jluke@cfl.rr.com>
9969 Raja R Harinath <rharinath@novell.com>
9972 * attribute.cs (Attribute.complained_before): New flag.
9973 (Attribute.ResolveType, Attribute.Resolve),
9974 (Attribute.DefinePInvokeMethod): Set it.
9975 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9977 2004-08-03 Martin Baulig <martin@ximian.com>
9979 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9980 use a user-defined operator; we still need to do numeric
9981 promotions in case one argument is a builtin type and the other
9982 one has an implicit conversion to that type. Fixes #62322.
9984 2004-08-18 Martin Baulig <martin@ximian.com>
9986 * class.cs (Method.Define): Use the correct method name when
9987 creating the MethodBuilder for a generic method.
9989 2004-08-17 Martin Baulig <martin@ximian.com>
9991 * generic.cs (Constraints): Support type parameter constraints.
9993 2004-08-16 Martin Baulig <martin@ximian.com>
9995 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9996 (Token.GENERIC_DIMENSION): New token; this is returned if we
9997 encounter an unbound generic type in a typeof() expression.
9999 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10000 this token is only generated while parsing a typeof() expression.
10001 (typeof_expression): Removed the old unbound_type hack.
10003 * generic.cs (TypeArguments.IsUnbound): New public property.
10005 * decl.cs (MemberName): Added support for unbound types.
10007 2004-08-14 Martin Baulig <martin@ximian.com>
10010 (TypeManager.IsEqualGenericInstance): New static method.
10011 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10012 just used to check accessibility, so follow the rules of 26.1.6.
10014 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10015 ConstructedType instead of a TypeExpression if we have type arguments.
10017 * cs-parser.jay (typeof_expression): Support unbound generic types.
10019 * ecore.cs (UnboundTypeExpression): New public class.
10021 2004-08-12 Martin Baulig <martin@ximian.com>
10023 * typemanager.cs (TypeManager.IsNestedChildOf): Use
10024 TypeManager.IsEqual() rather than `=='.
10026 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10027 generic instances as well.
10029 2004-08-12 Martin Baulig <martin@ximian.com>
10031 * expression.cs (Invocation.InferType): We can only infer method
10032 type parameters. Fixes #62647.
10034 2004-08-11 Martin Baulig <martin@ximian.com>
10036 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10037 before resolving the base classes.
10039 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10041 * Makefile: install .mdb file too.
10043 2004-08-05 Martin Baulig <martin@ximian.com>
10045 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10046 initializer, the current type is just the TypeBuilder, not the
10047 instantiated generic type.
10048 (FieldExpr.IsFieldInitializer): New public property.
10050 2004-08-04 Martin Baulig <martin@ximian.com>
10052 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10054 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10056 2004-08-03 Martin Baulig <martin@ximian.com>
10058 * class.cs (MethodData.Define): If we're an explicit
10059 implementation, remove the generic arity from the type name.
10061 2004-08-03 Martin Baulig <martin@ximian.com>
10063 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10064 use a user-defined operator; we still need to do numeric
10065 promotions in case one argument is a builtin type and the other
10066 one has an implicit conversion to that type. Fixes #62322.
10068 2004-08-02 Martin Baulig <martin@ximian.com>
10070 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10071 `TypeExpr[]' array.
10072 (TypeContainer.GetClassBases): Return the unexpanded list of
10073 interfaces; we expand them later.
10074 (TypeContainer.DefineType): After creating the TypeBuilder, call
10075 TypeManager.ExpandInterfaces() to get an expanded and resolved
10076 list of interfaces.
10078 * ecore.cs (TypeExpr.GetInterfaces): Removed
10080 * generics.cs (Constraints.InterfaceConstraints): Remove.
10081 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10082 register the interface constraints.
10085 (TypeManager.AddUserType): Removed the `ifaces' argument.
10086 (TypeManager.AddTypeParameter): Likewise.
10087 (TypeManager.AddUserInterface): Removed, was unused.
10088 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10089 `TypeExpr[]' array for the interfaces.
10090 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10091 has been defined, returns a list of the resolved interfaces types.
10092 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10093 (TypeManager.GetExplicitInterfaces): Likewise.
10095 2004-08-02 Martin Baulig <martin@ximian.com>
10097 * expression.cs (Invocation.EmitCall): If we're invoking a method
10098 on a type parameter, use the new `Constrained' prefix opcode.
10100 2004-08-02 Martin Baulig <martin@ximian.com>
10102 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10103 (LocalInfo.IsThis): New public property.
10104 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10106 2004-08-01 Martin Baulig <martin@ximian.com>
10108 * class.cs (TypeContainer.GetClassBases): Don't set the default
10109 here since we may get called from GetPartialBases().
10110 (TypeContainer.DefineType): If GetClassBases() didn't return a
10111 parent, use the default one.
10113 2004-07-30 Martin Baulig <martin@ximian.com>
10115 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10117 * class.cs (SourceMethod): New public class, derive from the
10118 symbol writer's ISourceMethod.
10119 (Method): Use the new symbol writer API.
10121 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10122 as argument and use the new symbol writer.
10125 (SourceFile): Implement the symbol writer's ISourceFile.
10126 (Location.SymbolDocument): Removed.
10127 (Location.SourceFile): New public property.
10129 * symbolwriter.cs: Use the new symbol writer API.
10131 2004-07-30 Raja R Harinath <rharinath@novell.com>
10133 * Makefile (install-local): Remove. Functionality moved to
10136 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10138 * Makefile: Install mcs.exe.config file together with mcs.exe.
10139 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10140 correct runtime version.
10142 2004-07-25 Martin Baulig <martin@ximian.com>
10145 (TypeContainer.RegisterOrder): Removed, this was unused.
10146 (TypeContainer, interface_order): Removed.
10147 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10148 TypeContainer as argument since we can also be called with a
10149 `PartialContainer' for a partial class/struct/interface.
10150 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10151 of checking whether we're an `Interface' - we could be a
10152 `PartialContainer'.
10153 (PartialContainer.Register): Override; call
10154 AddClass()/AddStruct()/AddInterface() on our parent.
10156 * cs-parser.jay (interface_member_declaration): Add things to the
10157 `current_container', not the `current_class'.
10159 * rootcontext.cs (RegisterOrder): The overloaded version which
10160 takes an `Interface' was unused, removed.
10162 * typemanager.cs (TypeManager.LookupInterface): Return a
10163 `TypeContainer', not an `Interface'.
10164 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10165 contain a `PartialContainer' for an interface, so check it's
10166 `Kind' to figure out what it is.
10168 2004-07-25 Martin Baulig <martin@ximian.com>
10170 * class.cs (Class.DefaultTypeAttributes): New public constant.
10171 (Struct.DefaultTypeAttributes): Likewise.
10172 (Interface.DefaultTypeAttributes): Likewise.
10173 (PartialContainer.TypeAttr): Override this and add the
10174 DefaultTypeAttributes.
10176 2004-07-25 Martin Baulig <martin@ximian.com>
10178 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10179 we can just use the `Parent' field instead.
10181 2004-07-25 Martin Baulig <martin@ximian.com>
10183 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10185 2004-07-25 Martin Baulig <martin@ximian.com>
10187 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10188 our parts before defining any methods.
10189 (TypeContainer.VerifyImplements): Make this virtual.
10190 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10191 on our PartialContainer.
10193 2004-07-25 Martin Baulig <martin@ximian.com>
10195 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10197 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10198 argument, we can just use the `Parent' field instead.
10201 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10202 (MemberBase.DoDefine): Likewise.
10204 2004-07-24 Martin Baulig <martin@ximian.com>
10206 * decl.cs (MemberCore.Parent): New public field.
10207 (DeclSpace.Parent): Moved to MemberCore.
10209 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10210 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10212 (FieldBase, Field, Operator): Likewise.
10213 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10214 (EventField, Event): Likewise.
10216 2004-07-23 Martin Baulig <martin@ximian.com>
10218 * class.cs (PartialContainer): New public class.
10219 (ClassPart): New public class.
10220 (TypeContainer): Added support for partial classes.
10221 (TypeContainer.GetClassBases): Splitted some of the functionality
10222 out into GetNormalBases() and GetPartialBases().
10224 * cs-tokenizer.cs (Token.PARTIAL): New token.
10225 (Tokenizer.consume_identifier): Added some hacks to recognize
10226 `partial', but only if it's immediately followed by `class',
10227 `struct' or `interface'.
10229 * cs-parser.jay: Added support for partial clases.
10231 2004-07-23 Martin Baulig <martin@ximian.com>
10233 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10234 a `DeclSpace' and also made it readonly.
10235 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10236 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10237 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10239 * cs-parser.jay: Pass the `current_class', not the
10240 `current_container' (at the moment, this is still the same thing)
10241 to a new Method, Property, Event, Indexer or Constructor.
10243 2004-07-23 Martin Baulig <martin@ximian.com>
10245 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10246 and removed the `current_interface' one.
10247 (struct_declaration, class_declaration, interface_declaration):
10248 Set `current_class' to the newly created class/struct/interface;
10249 set their `Bases' and call Register() before parsing their body.
10251 2004-07-23 Martin Baulig <martin@ximian.com>
10253 * class.cs (Kind): New public enum.
10254 (TypeContainer): Made this class abstract.
10255 (TypeContainer.Kind): New public readonly field.
10256 (TypeContainer.CheckDef): New public method; moved here from
10258 (TypeContainer.Register): New public abstract method.
10259 (TypeContainer.GetPendingImplementations): New public abstract
10261 (TypeContainer.GetClassBases): Removed the `is_class' and
10262 `is_iface' parameters.
10263 (TypeContainer.DefineNestedTypes): Formerly known as
10265 (ClassOrStruct): Made this class abstract.
10267 * tree.cs (RootTypes): New public type.
10269 2004-07-20 Martin Baulig <martin@ximian.com>
10271 * tree.cs (Tree.RecordNamespace): Removed.
10272 (Tree.Namespaces): Removed.
10274 * rootcontext.cs (RootContext.IsNamespace): Removed.
10276 * cs-parser.jay (namespace_declaration): Just create a new
10277 NamespaceEntry here.
10279 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10281 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10282 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10283 entry to make sure it runs in the correct runtime version.
10285 2004-07-18 Martin Baulig <martin@ximian.com>
10287 * generic.cs (ConstructedType.CheckConstraints): Improved
10288 constraints checking.
10290 2004-07-18 Martin Baulig <martin@ximian.com>
10292 * expression.cs (Invocation.BetterMethod): Call
10293 TypeManager.TypeToCoreType() on all types and removed my previous
10294 hack; we're already doig the right thing here.
10296 2004-07-17 Martin Baulig <martin@ximian.com>
10298 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10300 2004-07-16 Martin Baulig <martin@ximian.com>
10302 * iterators.cs: Added generics support.
10304 2004-07-16 Martin Baulig <martin@ximian.com>
10306 * iterators.cs: Rewrote this. We're now using one single Proxy
10307 class for both the IEnumerable and the IEnumerator interface and
10308 `Iterator' derives from Class so we can use the high-level API.
10310 * class.cs (TypeContainer.AddIterator): New method.
10311 (TypeContainer.DoDefineType): New protected virtual method, which
10312 is called from DefineType().
10313 (TypeContainer.DoDefineMembers): Call DefineType() and
10314 DefineMembers() on all our iterators.
10315 (TypeContainer.Emit): Call Emit() on all our iterators.
10316 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10318 * codegen.cs (EmitContext.CurrentIterator): New public field.
10320 2004-07-15 Martin Baulig <martin@ximian.com>
10323 (TypeManager.not_supported_exception_type): New type.
10325 2004-07-14 Martin Baulig <martin@ximian.com>
10328 (TypeManager.generic_ienumerable_type): New type.
10329 (TypeManager.generic_ienumerator_type): New type.
10332 (RootContext.interfaces_first_stage): Added
10333 "System.Collections.Generic.IEnumerator`1" and
10334 "System.Collections.Generic.IEnumerable`1".
10336 2004-07-14 Martin Baulig <martin@ximian.com>
10338 * iterators.cs: Use real error numbers.
10340 2004-07-14 Martin Baulig <martin@ximian.com>
10342 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10343 requires this to be a System.Collection.IEnumerable and not a
10344 class implementing that interface.
10345 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10347 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10349 * class.cs: Fixed previous fix, it broke some error tests.
10351 2004-07-12 Martin Baulig <martin@ximian.com>
10353 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10356 2004-07-14 Martin Baulig <martin@ximian.com>
10358 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10359 an exclamation mark (!) for the generic arity to reflect the
10360 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10362 2004-07-13 Martin Baulig <martin@ximian.com>
10364 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10365 specifiers being part of a type argument.
10367 2004-07-13 Martin Baulig <martin@ximian.com>
10369 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10370 name for generic types.
10372 2004-07-13 Martin Baulig <martin@ximian.com>
10374 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10377 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10379 * assign.cs (LocalTemporary): Add new argument: is_address,If
10380 `is_address' is true, then the value that we store is the address
10381 to the real value, and not the value itself.
10383 * ecore.cs (PropertyExpr): use the new local temporary
10384 stuff to allow us to handle X.Y += z (where X is a struct)
10386 2004-07-08 Martin Baulig <martin@ximian.com>
10388 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10389 not always return, just like we're doing in Using.Resolve().
10391 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10393 * cs-parser.jay (fixed_statement): flag this as Pinned.
10395 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10397 * typemanager.cs (TypeManager): Removed MakePinned method, this
10398 mechanism is replaced with the .NET 2.x compatible mechanism of
10399 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10401 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10402 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10403 `IsFixed' property which has a different meaning.
10405 2004-07-02 Raja R Harinath <rharinath@novell.com>
10407 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10408 visible from inside a nested class, not just the names of the
10409 immediately enclosing class.
10410 Fix for bug #60730.
10412 2004-06-24 Raja R Harinath <rharinath@novell.com>
10414 * expression.cs (BetterConversion): Remove buggy special-case
10415 handling of "implicit constant expression conversions". At this
10416 point, we already know that the conversion is possible -- we're
10417 only checking to see which is better.
10419 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10421 * cs-parser.jay: Added error CS0210 test.
10423 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10425 * cs-parser.jay: Added error CS0134 test.
10427 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10430 * cs-parser.jay: Added error CS0145 test.
10432 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10434 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10436 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10438 * expression.cs (StackAlloc.Resolve): The argument may not
10439 be a constant; deal with this case.
10441 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10443 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10444 GetIndexerAttributeValue.
10445 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10447 * class.cs (Indexer.Define): Added error tests for CS0415,
10450 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10452 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10455 2004-06-23 Martin Baulig <martin@ximian.com>
10457 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10458 neither return nor throw, reset the barrier as well. Fixes #60457.
10460 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10462 * class.cs : EventAttributes is now set to None by default.
10463 This fixes bug #60459.
10465 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10468 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10469 Don't throw exception but return null (it's sufficient now).
10471 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10473 * typemanager.cs (GetArgumentTypes): Faster implementation.
10475 2004-06-18 Martin Baulig <martin@ximian.com>
10477 * attribute.cs (Attribute.Resolve): Check whether we're an
10478 EmptyCast which a Constant child. Fixes #60333.
10480 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10482 * statement.cs (EmitCollectionForeach): Account for the fact that
10483 not all valuetypes are in areas which we can take the address of.
10484 For these variables, we store to a temporary variable. Also, make
10485 sure that we dont emit a `callvirt' on a valuetype method.
10487 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10489 * expression.cs (StackAlloc.DoReSolve): Added test for
10490 negative parameter (CS0247).
10492 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10495 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10497 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10500 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10503 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10505 Fix bug #58254 & cs1555.cs, cs1556.cs
10506 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10508 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10510 * cs-parser.jay: Added error CS1669 test for indexers.
10512 2004-06-18 Martin Baulig <martin@ximian.com>
10514 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10515 argument. Fixes #60441.
10517 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10518 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10519 The name needs to have the actual name of the method in order
10520 for other tests (such as the one in OverloadResolve for Invoke
10521 on a delegate) to work. As well, it does not really help
10522 error reporting because the method group had multiple methods.
10523 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10524 Make profiling work.
10526 2004-06-13 Martin Baulig <martin@ximian.com>
10528 * cs-parser.jay: Don't allow generic attributes.
10530 2004-06-13 Martin Baulig <martin@ximian.com>
10532 * class.cs (MemberBase.DoDefineBase): New protected method.
10533 (MemberBase.DoDefine): Compute the `flags' in the new
10534 DoDefineBase() which must be called first.
10535 (Method.Define): Call DoDefineBase() first so we have the flags
10536 when defining the generic method.
10538 * cs-parser.jay (interface_method_declaration): Support generic methods.
10540 2004-06-13 Martin Baulig <martin@ximian.com>
10542 * decl.cs (TypeName): Removed.
10543 (MemberName): Removed TypeName and MemberNow; now we just have
10546 * cs-parser.jay: Don't distinguish between type arguments and type
10547 parameters in the grammar and simplified the rules a bit. The
10548 reduce/reduce conflicts are now gone (except the one we inherited
10551 2004-06-11 Martin Baulig <martin@ximian.com>
10553 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10554 call this twice: for params and varargs methods.
10556 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10559 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10561 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10563 * attribute.cs (Attribute.GetValidTargets): Made public.
10566 (AbstractPropertyEventMethod): New class for better code sharing.
10567 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10569 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10571 2004-06-09 Martin Baulig <martin@ximian.com>
10573 * cs-parser.jay: Removed a reduce/reduce conflict.
10575 2004-06-03 Martin Baulig <martin@ximian.com>
10577 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10578 GetSimpleName() and return a SimpleName.
10580 * ecore.cs (SimpleName.Arguments): New public field.
10581 (SimpleName): Added overloaded ctor which takes an additional
10582 TypeArguments argument.
10583 (SimpleName.SimpleNameResolve): Added support for generic methods.
10584 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10585 formerly in MemberAccess.DoResolve(), but we also need it in
10586 SimpleNameResolve().
10588 * expression.cs (MemberAccess.DoResolve): Use the new
10589 MethodGroupExpr.ResolveGeneric().
10591 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10593 * decl.cs: If possible, use lookuptypedirect here. We can only do
10594 this if there is no `.' after the namespace. Avoids using
10595 LookupType, which does lots of slow processing.
10596 (FindNestedType) New method, does what it says :-).
10597 * namespace.cs: use LookupTypeDirect.
10598 * rootcontext.cs: use membercache, if possible.
10599 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10601 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10604 According to the spec,
10606 In a member access of the form E.I, if E is a single identifier,
10607 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10608 field, property, localvariable, or parameter with the same type as
10609 the meaning of E as a type-name (§3.8), then both possible
10610 meanings of E are permitted.
10612 We did not check that E as a simple-name had the same type as E as
10615 This trivial check gives us 5-7% on bootstrap time.
10617 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10619 * expression.cs (Invocation.OverloadResolve): Avoid the
10620 use of hashtables and boxing here by allocating on demand.
10622 2004-05-30 Martin Baulig <martin@ximian.com>
10624 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10625 we're doing a silent lookup. Don't try to lookup nested types in
10626 TypeManager.object_type (thanks to Ben Maurer).
10628 2004-05-30 Martin Baulig <martin@ximian.com>
10630 Committing a patch from Ben Maurer.
10632 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10634 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10636 * convert.cs: add a trivial cache for overload operator resolution.
10638 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10641 (AttributeTester.GetObsoleteAttribute): Returns instance of
10642 ObsoleteAttribute when type is obsolete.
10645 (TypeContainer.VerifyObsoleteAttribute): Override.
10646 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10647 (MethodCode.VerifyObsoleteAttribute): Override.
10648 (MemberBase.VerifyObsoleteAttribute): Override.
10651 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10652 and report proper error.
10655 (Delegate.VerifyObsoleteAttribute): Override.
10658 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10659 and report proper error.
10660 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10663 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10667 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10668 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10669 Added test for ObsoleteAttribute.
10672 (Catch): Derived from Statement.
10674 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10676 * decl.cs: If possible, use lookuptypedirect here. We can only do
10677 this if there is no `.' after the namespace. Avoids using
10678 LookupType, which does lots of slow processing.
10679 (FindNestedType) New method, does what it says :-).
10680 * namespace.cs: use LookupTypeDirect.
10681 * rootcontext.cs: use membercache, if possible.
10682 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10684 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10687 According to the spec,
10689 In a member access of the form E.I, if E is a single identifier,
10690 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10691 field, property, localvariable, or parameter with the same type as
10692 the meaning of E as a type-name (§3.8), then both possible
10693 meanings of E are permitted.
10695 We did not check that E as a simple-name had the same type as E as
10698 This trivial check gives us 5-7% on bootstrap time.
10700 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10702 Fixed bug #59071 & cs0160.cs
10703 * statement.cs (Try.Resolve): Check here whether order of catch
10704 clauses matches their dependencies.
10706 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10709 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10712 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10714 * expression.cs (Invocation.OverloadResolve): Avoid the
10715 use of hashtables and boxing here by allocating on demand.
10717 2004-05-30 Martin Baulig <martin@ximian.com>
10719 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10720 we're doing a silent lookup. Don't try to lookup nested types in
10721 TypeManager.object_type (thanks to Ben Maurer).
10723 2004-05-30 Martin Baulig <martin@ximian.com>
10725 Committing a patch from Ben Maurer.
10727 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10729 2004-05-29 Martin Baulig <martin@ximian.com>
10731 * class.cs (IMethodData.ShouldIgnore): New method.
10733 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10734 `Location' argument, we don't need it anywhere. Use
10735 `IMethodData.ShouldIgnore ()' instead of
10736 `MethodData.GetMethodFlags ()'.
10737 (TypeManager.AddMethod): Removed.
10738 (TypeManager.AddMethod2): Renamed to AddMethod.
10740 2004-05-29 Martin Baulig <martin@ximian.com>
10742 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10744 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10745 converting from a class type S to an interface type and we already
10746 have an object on the stack, don't box it again. Fixes #52578.
10748 2004-05-29 Martin Baulig <martin@ximian.com>
10750 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10751 Added support for `params' parameters. Fixes #59267.
10753 2004-05-29 Martin Baulig <martin@ximian.com>
10755 * literal.cs (NullPointer): Provide a private .ctor which sets
10756 `type' to TypeManager.object_type. Fixes #59048.
10758 2004-05-29 Martin Baulig <martin@ximian.com>
10760 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10761 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10763 * ecore.cs (EventExpr.instance_expr): Make the field private.
10765 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10767 Fixed bug #50080 & cs0214-2.cs
10768 * expression.cs (Cast.DoResolve): Check unsafe context here.
10770 * statement.cs (Resolve.DoResolve): Likewise.
10772 2004-05-26 Martin Baulig <martin@ximian.com>
10774 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10776 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10777 (RootContext.LookupType): Pass down the `silent' flag.
10779 2004-05-25 Martin Baulig <martin@ximian.com>
10782 (MethodGroupExpr.IdenticalTypeName): New public property.
10783 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10784 expression actually refers to a type.
10786 2004-05-25 Martin Baulig <martin@ximian.com>
10788 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10789 for #56176 and made it actually work.
10791 2004-05-25 Martin Baulig <martin@ximian.com>
10793 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10794 (FieldExpr, PropertyExpr): Override and implement
10795 CacheTemporaries. Fixes #52279.
10797 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10799 * location.cs: In the new compiler listing a file twice is a
10800 warning, not an error.
10802 2004-05-24 Martin Baulig <martin@ximian.com>
10804 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10805 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10807 2004-05-24 Martin Baulig <martin@ximian.com>
10809 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10810 walking the `using' list. Fixes #53921.
10812 2004-05-24 Martin Baulig <martin@ximian.com>
10814 * const.cs (Const.LookupConstantValue): Added support for
10815 EmptyCast's; fixes #55251.
10817 2004-05-24 Martin Baulig <martin@ximian.com>
10819 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10820 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10821 which does the CS0135 check. The reason is that we first need to
10822 check whether the variable actually exists.
10824 2004-05-24 Martin Baulig <martin@ximian.com>
10826 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10827 than RootContext.LookupType() to find the explicit interface
10828 type. Fixes #58584.
10830 2004-05-24 Raja R Harinath <rharinath@novell.com>
10832 * Makefile: Simplify. Use executable.make.
10833 * mcs.exe.sources: New file. List of sources of mcs.exe.
10835 2004-05-24 Anders Carlsson <andersca@gnome.org>
10839 Use the invariant culture when doing String.Compare for CLS case
10842 2004-05-23 Martin Baulig <martin@ximian.com>
10844 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10845 don't have any dots. Fixes #52622, added cs0246-8.cs.
10847 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10849 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10851 * class.cs (MemberBase.Define): Reuse MemberType member for
10852 resolved type. Other methods can use it too.
10854 2004-05-23 Martin Baulig <martin@ximian.com>
10856 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10857 the variable also exists in the current block (otherwise, we need
10858 to report a CS0103). Fixes #58670.
10860 2004-05-23 Martin Baulig <martin@ximian.com>
10862 * flowanalysis.cs (Reachability.Reachable): Compute this
10863 on-the-fly rather than storing it as a field.
10865 2004-05-23 Martin Baulig <martin@ximian.com>
10867 * flowanalysis.cs (Reachability.And): Manually compute the
10868 resulting `barrier' from the reachability.
10870 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10873 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10874 instance of ObsoleteAttribute when symbol is obsolete.
10877 (IMethodData): Extended interface for ObsoleteAttribute support.
10879 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10881 * attribute.cs: Fix bug #55970
10883 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10887 (GetObsoleteAttribute): New method. Creates the instance of
10889 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10890 ObsoleteAttribute when member is obsolete.
10891 (AttributeTester.Report_ObsoleteMessage): Common method for
10892 Obsolete error/warning reporting.
10895 (TypeContainer.base_classs_type): New member for storing parent type.
10898 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10899 for this MemberCore.
10901 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10903 * attribute.cs, const.cs: Fix bug #58590
10905 2004-05-21 Martin Baulig <martin@ximian.com>
10907 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10908 out parameters if the end of the method is unreachable. Fixes
10911 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10913 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10914 Hari was right, why extra method.
10916 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10918 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10920 2004-05-20 Martin Baulig <martin@ximian.com>
10922 * delegate.cs: Convert this file to Unix mode - like the original
10925 2004-05-20 Martin Baulig <martin@ximian.com>
10927 * attribute.cs: Convert this file to Unix mode - like the original
10930 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10932 Fix bug #58688 (MCS does not report error when the same attribute
10935 * attribute.cs (Attribute.Emit): Distinction between null and default.
10937 2004-05-19 Raja R Harinath <rharinath@novell.com>
10939 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10940 of a top-level attribute without an attribute target.
10941 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10943 (Attribute.Conditional_GetConditionName),
10944 (Attribute.Obsolete_GetObsoleteMessage): Update.
10945 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10946 part of ScanForIndexerName.
10947 (Attribute.CanIgnoreInvalidAttribute): New function.
10948 (Attribute.ScanForIndexerName): Move to ...
10949 (Attributes.ScanForIndexerName): ... here.
10950 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10951 (Attributes.Search): New internal variant that can choose not to
10952 complain if types aren't resolved. The original signature now
10954 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10955 complaints suppressed.
10956 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10957 only if it not useful.
10958 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10959 top-level for attributes that are shared between the assembly
10960 and a top-level class.
10961 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10962 * class.cs: Update to reflect changes.
10963 (DefineIndexers): Fuse loops.
10964 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10965 a couple more variants of attribute names.
10967 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10969 Fix bug #52585 (Implemented explicit attribute declaration)
10972 (Attributable.ValidAttributeTargets): New abstract method. It gets
10973 list of valid attribute targets for explicit target declaration.
10974 (Attribute.Target): It holds target itself.
10975 (AttributeSection): Removed.
10976 (Attribute.CheckTargets): New method. It checks whether attribute
10977 target is valid for the current element.
10980 (EventProperty): New class. For events that are declared like
10981 property (with add and remove accessors).
10982 (EventField): New class. For events that are declared like field.
10985 * cs-parser.jay: Implemented explicit attribute target declaration.
10987 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10988 Override ValidAttributeTargets.
10991 (ReturnParameter): Class for applying custom attributes on
10993 (ParameterAtribute): New class. Class for applying custom
10994 attributes on the parameter type.
10996 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10998 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11001 (Method): Allow UNSAFE here.
11003 * modifiers.cs: Support unsafe reporting.
11005 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11007 * decl.cs: Fix bug #58478.
11009 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11011 * statement.cs: When checking for unreachable code on an EmptyStatement,
11012 set the location. Fixes bug #58488.
11014 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11016 * driver.cs: Add -pkg handling.
11018 From Gonzalo: UseShelLExecute=false
11020 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11023 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11025 (Attribute.IsClsCompliaceRequired): Moved to base for better
11027 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11028 when attribute is AttributeUsageAttribute.
11029 (Attribute.GetValidTargets): Simplified.
11030 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11031 attribute for this type.
11032 (Attribute.ApplyAttributes): Method renamed to Emit and make
11034 (GlobalAttributeSection): New class for special handling of global
11035 attributes (assembly, module).
11036 (AttributeSection.Emit): New method.
11038 * class.cs: Implemented Attributable abstract methods.
11039 (MethodCore.LabelParameters): Moved to Parameter class.
11040 (Accessor): Is back simple class.
11041 (PropertyMethod): Implemented Attributable abstract class.
11042 (DelegateMethod): Implemented Attributable abstract class.
11043 (Event): New constructor for disctintion between normal Event
11044 and Event with accessors.
11046 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11048 * codegen.cs, const.cs, decl.cs, delegate.cs:
11049 (CommonAssemblyModulClass): Implemented Attributable abstract class
11052 * enum.cs: Implement IAttributeSupport interface.
11053 (EnumMember): New class for emum members. Implemented Attributable
11057 (ParameterBase): Is abstract.
11058 (ReturnParameter): New class for easier [return:] attribute handling.
11060 * typemanager.cs: Removed builder_to_attr.
11062 2004-05-11 Raja R Harinath <rharinath@novell.com>
11065 * attribute.cs (Attribute.GetPositionalValue): New function.
11066 * class.cs (TypeContainer.VerifyMembers): New function.
11067 (TypeContainer.Emit): Use it.
11068 (ClassOrStruct): New base class for Class and Struct.
11069 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11070 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11072 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11073 then each non-static field should have a FieldOffset attribute.
11074 Otherwise, none of the fields should have a FieldOffset attribute.
11075 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11076 and FieldOffset attributes.
11077 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11078 (TypeManager.field_offset_attribute_type): New core types.
11079 (TypeManager.InitCoreTypes): Initialize them.
11081 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11083 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11084 Return correct type.
11087 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11089 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11090 be implicitly converted to ulong.
11092 * expression.cs: The logic for allowing operator &, | and ^ worked
11093 was wrong, it worked before because we did not report an error in
11094 an else branch. Fixes 57895.
11096 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11097 allow volatile fields to be reference types.
11099 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11101 * driver.cs: Add support for /debug-
11103 2004-05-07 Raja R Harinath <rharinath@novell.com>
11105 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11106 Add a 'complain' parameter to silence errors.
11107 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11108 silently overlooked type-resolutions.
11109 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11110 to reflect changes.
11111 (Attributes.Search): New function.
11112 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11113 (Attributes.GetAttributeFullName): Remove hack.
11114 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11115 Update to reflect changes.
11116 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11117 Use Attributes.Search instead of nested loops.
11119 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11122 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11123 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11124 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11126 * report.cs: (Report.Warning): Renamed to Warning_T because of
11127 parameter collision.
11129 2004-05-05 Raja R Harinath <rharinath@novell.com>
11131 * expression.cs (MemberAccess.ResolveMemberAccess):
11132 Exit with non-zero status after Report.Error.
11133 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11135 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11137 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11139 * support.cs: Don't hang when the file is empty.
11141 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11143 * support.cs: In SeekableStreamReader, compute the preamble size of the
11144 underlying stream. Position changes should take into account that initial
11147 2004-05-03 Todd Berman <tberman@sevenl.net>
11149 * driver.cs: remove unused GetSysVersion function.
11151 2004-05-03 Todd Berman <tberman@sevenl.net>
11153 * driver.cs: Remove the hack from saturday, as well as the hack
11154 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11155 link_paths to get that bit proper.
11157 2004-05-01 Todd Berman <tberman@sevenl.net>
11159 * driver.cs: Try a LoadFrom before a Load, this checks the current
11160 path. This is currently a bug in mono that is be fixed, however, this
11161 provides a workaround for now. This will be removed when the bug
11164 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11166 * CryptoConvert.cs: Updated to latest version. Fix issue with
11167 incomplete key pairs (#57941).
11169 2004-05-01 Todd Berman <tberman@sevenl.net>
11171 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11174 2004-04-30 Jackson Harper <jackson@ximian.com>
11176 * codegen.cs: Open keys readonly.
11178 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11180 * typemanager.cs: don't report cyclic struct layout when a struct
11181 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11182 which has 2 Pango.Rectangle fields.
11184 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11186 * expression.cs: Handle IntPtr comparisons with IL code
11187 rather than a method call.
11189 2004-04-29 Martin Baulig <martin@ximian.com>
11191 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11192 the list of PropertyInfo's in class hierarchy and find the
11193 accessor. Fixes #56013.
11195 2004-04-29 Martin Baulig <martin@ximian.com>
11197 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11199 2004-04-29 Martin Baulig <martin@ximian.com>
11201 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11203 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11205 2004-04-29 Martin Baulig <martin@ximian.com>
11207 * class.cs (ConstructorInitializer.Resolve): Check whether the
11208 parent .ctor is accessible. Fixes #52146.
11210 2004-04-29 Martin Baulig <martin@ximian.com>
11212 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11214 * statement.cs (Using.EmitLocalVariableDecls): Use
11215 TypeManager.idisposable_type, not typeof (IDisposable).
11216 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11218 2004-04-29 Martin Baulig <martin@ximian.com>
11220 * class.cs (Event.Define): Don't emit the field and don't set
11221 RTSpecialName and SpecialName for events on interfaces. Fixes
11224 2004-04-29 Raja R Harinath <rharinath@novell.com>
11226 Refactor Attribute.ApplyAttributes.
11227 * attribute.cs (Attributable): New base class for objects that can
11228 have Attributes applied on them.
11229 (Attribute): Make AttributeUsage fields public.
11230 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11231 (Attribute.IsInternalCall): New property.
11232 (Attribute.UsageAttr): Convert to a public read-only property.
11233 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11234 (Attribute.ResolveType, Attribute.Resolve)
11235 (Attribute.ScanForIndexerName): Update to reflect changes.
11236 (Attribute.CheckAttributeTarget): Re-format.
11237 (Attribute.ApplyAttributes): Refactor, to various
11238 Attributable.ApplyAttributeBuilder methods.
11239 * decl.cs (MemberCore): Make Attributable.
11240 * class.cs (Accessor): Make Attributable.
11241 (MethodData.ApplyAttributes): Use proper attribute types, not
11243 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11244 (TypeContainer.ApplyAttributeBuilder)
11245 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11246 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11247 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11248 (Operator.ApplyAttributeBuilder): New factored-out methods.
11249 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11250 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11251 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11252 * parameter.cs (ParameterBase): New Attributable base class
11253 that can also represent Return types.
11254 (Parameter): Update to the changes.
11256 2004-04-29 Jackson Harper <jackson@ximian.com>
11258 * driver.cs: Prefer the corlib system version when looking for
11259 assemblies in the GAC. This is still a hack, but its a better hack
11262 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11264 * decl.cs, enum.cs: Improved error 3005 reporting.
11266 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11267 (related_symbols): New private member for list of symbols
11268 related to reported error/warning.
11270 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11272 2004-04-29 Martin Baulig <martin@ximian.com>
11274 * ecore.cs (Expression.Constantify): If we're an enum and
11275 TypeManager.TypeToCoreType() doesn't give us another type, use
11276 t.UnderlyingSystemType. Fixes #56178.
11278 2004-04-29 Martin Baulig <martin@ximian.com>
11280 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11281 interfaces and for each interface, only add members directly
11282 declared in that interface. Fixes #53255.
11284 2004-04-28 Martin Baulig <martin@ximian.com>
11286 * expression.cs (ConditionalLogicalOperator): Use a temporary
11287 variable for `left' to avoid that we evaluate it more than once;
11290 2004-04-28 Martin Baulig <martin@ximian.com>
11292 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11295 2004-04-28 Martin Baulig <martin@ximian.com>
11297 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11300 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11301 whether the type is not void (CS1547).
11303 2004-04-28 Martin Baulig <martin@ximian.com>
11305 * expression.cs (Unary.DoResolveLValue): Override this and report
11306 CS0131 for anything but Operator.Indirection.
11308 2004-04-28 Martin Baulig <martin@ximian.com>
11310 Committing a patch from Ben Maurer; see bug #50820.
11312 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11315 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11318 2004-04-28 Martin Baulig <martin@ximian.com>
11320 Committing a patch from Ben Maurer; see bug #50820.
11322 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11325 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11328 2004-04-28 Martin Baulig <martin@ximian.com>
11330 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11331 (Block.AddLabel): Call DoLookupLabel() to only search in the
11334 2004-04-28 Martin Baulig <martin@ximian.com>
11336 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11337 comparing StringConstants and NullLiterals in Equality and Inequality.
11339 2004-04-28 Jackson Harper <jackson@ximian.com>
11341 * driver.cs: Attempt to load referenced assemblies from the
11342 GAC. This is the quick and dirty version of this method that
11343 doesnt take into account versions and just takes the first
11344 canidate found. Will be good enough for now as we will not have more
11345 then one version installed into the GAC until I update this method.
11347 2004-04-28 Martin Baulig <martin@ximian.com>
11349 * typemanager.cs (TypeManager.CheckStructCycles): New public
11350 static method to check for cycles in the struct layout.
11352 * rootcontext.cs (RootContext.PopulateTypes): Call
11353 TypeManager.CheckStructCycles() for each TypeContainer.
11354 [Note: We only need to visit each type once.]
11356 2004-04-28 Martin Baulig <martin@ximian.com>
11358 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11360 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11361 success and added `out object value'. Use a `bool resolved' field
11362 to check whether we've already been called rather than
11363 `ConstantValue != null' since this breaks for NullLiterals.
11365 2004-04-28 Raja R Harinath <rharinath@novell.com>
11367 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11368 setting of this flag, since the 'set' method may be non-public.
11370 2004-04-28 Raja R Harinath <rharinath@novell.com>
11372 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11373 check on current_vector.Block.
11375 2004-04-27 Martin Baulig <martin@ximian.com>
11377 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11378 a field initializer. Fixes #56459.
11380 2004-04-27 Martin Baulig <martin@ximian.com>
11382 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11383 we're not attempting to use an indexer. Fixes #52154.
11385 2004-04-27 Martin Baulig <martin@ximian.com>
11387 * statement.cs (Return): Don't create a return label if we don't
11388 need it; reverts my change from January 20th. Thanks to Ben
11391 2004-04-27 Martin Baulig <martin@ximian.com>
11393 According to the spec, `goto' can only leave a nested scope, but
11396 * statement.cs (Block.LookupLabel): Only lookup in the current
11397 block, don't recurse into parent or child blocks.
11398 (Block.AddLabel): Check in parent and child blocks, report
11399 CS0140/CS0158 if we find a duplicate.
11400 (Block): Removed this indexer for label lookups.
11401 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11402 this already does the error reporting for us.
11405 (FlowBranching.UsageVector.Block): New public variable; may be null.
11406 (FlowBranching.CreateSibling): Added `Block' argument.
11407 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11408 label for the target of a `goto' and check whether we're not
11409 leaving a `finally'.
11411 2004-04-27 Martin Baulig <martin@ximian.com>
11413 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11414 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11417 2004-04-27 Martin Baulig <martin@ximian.com>
11419 * statement.cs (Block.AddLabel): Also check for implicit blocks
11420 and added a CS0158 check.
11422 2004-04-27 Martin Baulig <martin@ximian.com>
11424 * flowanalysis.cs (FlowBranchingLoop): New class.
11425 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11426 UsageVector's instead of an ArrayList.
11427 (FlowBranching.Label): Likewise.
11428 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11429 (FlowBranching.AddBreakVector): New method.
11431 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11433 * attribute.cs: Small regression fix: only convert the type if we
11434 the type is different, fixes System.Drawing build.
11436 2004-04-27 Martin Baulig <martin@ximian.com>
11438 * attribute.cs (Attribute.Resolve): If we have a constant value
11439 for a named field or property, implicity convert it to the correct
11442 2004-04-27 Raja R Harinath <rharinath@novell.com>
11444 * statement.cs (Block.Block): Implicit blocks share
11445 'child_variable_names' fields with parent blocks.
11446 (Block.AddChildVariableNames): Remove.
11447 (Block.AddVariable): Mark variable as "used by a child block" in
11448 every surrounding block.
11449 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11450 been used in a child block, complain about violation of "Invariant
11451 meaning in blocks" rule.
11452 * cs-parser.jay (declare_local_variables): Don't use
11453 AddChildVariableNames.
11454 (foreach_statement): Don't create an implicit block: 'foreach'
11455 introduces a scope.
11457 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11459 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11460 converting from 0L to ulong. Fixes 57522.
11462 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11464 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11465 derived class hides via 'new' keyword field from base class (test-242.cs).
11466 TODO: Handle this in the more general way.
11468 * class.cs (CheckBase): Ditto.
11470 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11472 * decl.cs (caching_flags): New member for storing cached values
11474 (MemberCore.Flags): New enum where bit flags for caching_flags
11476 (MemberCore.cls_compliance): Moved to caching_flags.
11477 (DeclSpace.Created): Moved to caching_flags.
11479 * class.cs: Use caching_flags instead of DeclSpace.Created
11481 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11483 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11484 if we are only a derived class, not a nested class.
11486 * typemanager.cs: Same as above, but do this at the MemberLookup
11487 level (used by field and methods, properties are handled in
11488 PropertyExpr). Allow for the qualified access if we are a nested
11491 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11493 * class.cs: Refactoring.
11494 (IMethodData): New inteface; Holds links to parent members
11495 to avoid member duplication (reduced memory allocation).
11496 (Method): Implemented IMethodData interface.
11497 (PropertyBase): New inner classes for get/set methods.
11498 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11499 (Event): New inner classes for add/remove methods.
11500 (Event.DelegateMethod): Implemented IMethodData interface.
11502 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11503 EmitContext (related to class.cs refactoring).
11505 2004-04-21 Raja R Harinath <rharinath@novell.com>
11507 * delegate.cs (Delegate.VerifyApplicability): If the number of
11508 arguments are the same as the number of parameters, first try to
11509 verify applicability ignoring any 'params' modifier on the last
11513 2004-04-08 Martin Baulig <martin@ximian.com>
11515 Merged latest changes into gmcs. Please keep this comment in
11516 here, it makes it easier for me to see what changed in MCS since
11517 the last time I merged.
11519 2004-04-16 Raja R Harinath <rharinath@novell.com>
11521 * class.cs (TypeContainer.AddIndexer): Use
11522 'ExplicitInterfaceName' to determine if interface name was
11523 explicitly specified. 'InterfaceType' is not initialized at this time.
11524 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11525 Indexers array is already in the required order. Initialize
11526 'IndexerName' only if there are normal indexers.
11527 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11528 (TypeContainer.Emit): Emit DefaultMember attribute only if
11529 IndexerName is initialized.
11532 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11534 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11537 2004-04-15 Raja R Harinath <rharinath@novell.com>
11539 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11543 * attribute.cs (Attribute.Resolve): Check for duplicate named
11547 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11549 * iterators.cs (MarkYield): track whether we are in an exception,
11550 and generate code accordingly. Use a temporary value to store the
11551 result for our state.
11553 I had ignored a bit the interaction of try/catch with iterators
11554 since their behavior was not entirely obvious, but now it is
11555 possible to verify that our behavior is the same as MS .NET 2.0
11559 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11561 * iterators.cs: Avoid creating temporaries if there is no work to
11564 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11565 Enumerations, use TypeManager.EnumToUnderlying and call
11568 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11571 (This.Emit): Use EmitContext.EmitThis to emit our
11574 (This.EmitAssign): Ditto.
11576 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11577 codepaths, we will move all the functionality into
11580 (FieldExpr.EmitAssign): Ditto.
11582 This fixes several hidden bugs that I uncovered while doing a code
11583 review of this today.
11585 * codegen.cs (EmitThis): reworked so the semantics are more clear
11586 and also support value types "this" instances.
11588 * iterators.cs: Changed so that for iterators in value types, we
11589 do not pass the value type as a parameter.
11591 Initialization of the enumerator helpers is now done in the caller
11592 instead of passing the parameters to the constructors and having
11593 the constructor set the fields.
11595 The fields have now `assembly' visibility instead of private.
11597 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11599 * expression.cs (Argument.Resolve): Check if fields passed as ref
11600 or out are contained in a MarshalByRefObject.
11602 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11603 another compiler type.
11605 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11607 * class.cs (Indexer.Define): use the new name checking method.
11608 Also, return false on an error.
11609 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11610 (is_identifier_[start/part]_character): make static.
11612 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11614 * expression.cs (Binary.ResolveOperator): Do no append strings
11615 twice: since we can be invoked more than once (array evaluation)
11616 on the same concatenation, take care of this here. Based on a fix
11617 from Ben (bug #56454)
11619 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11621 * codegen.cs: Fix another case where CS1548 must be reported (when
11622 delay-sign isn't specified and no private is available #56564). Fix
11623 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11624 error when MCS is used on the MS runtime and we need to delay-sign
11625 (which seems unsupported by AssemblyBuilder - see #56621).
11627 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11629 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11630 (TypeManager.ComputeNamespaces): Faster implementation for
11633 * compiler.csproj: Updated AssemblyName to mcs.
11635 2004-05-11 Jackson Harper <jackson@ximian.com>
11637 * Makefile: Preserve MONO_PATH
11639 2004-05-11 Jackson Harper <jackson@ximian.com>
11641 * Makefile: Use mono and mcs to build gmcs
11643 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11645 * codegen.cs: Add patch from Robert Shade
11646 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11649 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11651 * CryptoConvert.cs: Updated to latest version. Fix issue with
11652 incomplete key pairs (#57941).
11654 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11656 * codegen.cs: Fix another case where CS1548 must be reported (when
11657 delay-sign isn't specified and no private is available #56564). Fix
11658 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11659 error when MCS is used on the MS runtime and we need to delay-sign
11660 (which seems unsupported by AssemblyBuilder - see #56621).
11662 2004-04-29 Jackson Harper <jackson@ximian.com>
11664 * Makefile: Set MONO_PATH to use the bootstrap corlib
11665 * driver.cs: Check the GAC for referenced assemblies.
11667 2004-04-29 Martin Baulig <martin@ximian.com>
11669 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11671 2004-04-07 Martin Baulig <martin@ximian.com>
11673 * expression.cs (Binary.ResolveOperator): Added special case for
11674 Equality/Inequality between a type parameter and a null literal.
11676 2004-04-07 Martin Baulig <martin@ximian.com>
11678 * convert.cs: Check null literal -> type parameter conversions.
11680 2004-04-07 Martin Baulig <martin@ximian.com>
11682 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11683 `class' and `struct' constraints.
11685 2004-04-07 Martin Baulig <martin@ximian.com>
11687 * generic.cs (SpecialConstraint): New public enum.
11688 (Constraints.Resolve): Added support for the `class' and `struct'
11691 * cs-parser.jay (type_parameter_constraint): Added support for the
11692 `class' and `struct' constraints.
11694 2004-04-07 Martin Baulig <martin@ximian.com>
11696 * support.cs (GenericConstraints): Replaced `Types' by
11697 `ClassConstraint' and `InterfaceConstraints'; added
11698 `HasClassConstraint'.
11700 2004-04-07 Martin Baulig <martin@ximian.com>
11703 (Constraints.InterfaceConstraints): New public property.
11704 (Constraints.Types): Make this property public
11705 (TypeParameter): Implement IMemberContainer.
11706 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11707 instead of a TypeBuilder/MethodBuilder; pass the interface
11708 constraints to TypeManager.AddTypeParameter().
11709 (TypeParameter.DefineType): Just take an EmitContext and no
11710 TypeBuilder/MethodBuilder. Use the new public API.
11712 * typemanager.cs (TypeManager.AddTypeParameter): Added
11713 `TypeExpr[]' argument; add the interfaces to the
11714 `builder_to_ifaces' hash.
11715 (TypeManager.LookupMemberContainer): For
11716 GenericTypeParameterBuilders, get the TypeParameter from the
11717 `builder_to_type_param'.
11718 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11719 the TypeParameter and call FindMembers on it.
11721 2004-04-07 Martin Baulig <martin@ximian.com>
11724 (MethodCore.GenericMethod): Moved this field here from Method.
11725 (MethodCore.IsDuplicateImplementation): Take the number of type
11726 parameters into account if we're a generic method.
11728 * expression.cs (Invocation.InferTypeArguments): Don't return true
11729 if `arguments' is null; we still need to check whether we actually
11730 don't need to infer anything in this case.
11731 (MemberAccess): Merged the functionality from GenericMemberAccess
11734 * generic.cs (GenericMemberAccess): Removed.
11736 2004-04-05 Martin Baulig <martin@ximian.com>
11738 * decl.cs (MemberCore): For generic classes, interfaces and
11739 structs, `Name' now includes the number of type parameters
11740 ("Stack!1.Node!1").
11741 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11742 encode the number of type arguments in the type name.
11744 * expression.cs (Expression.MemberLookup): Removed the
11745 `num_type_args' argument; we now encode the number of type
11746 arguments in the type name.
11748 * ecore.cs (SimpleName): Encode the number of type arguments in
11749 the type name itself.
11751 * generic.cs (ConstructedType): Likewise.
11753 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11754 `MemberName'; we now include the number of type parameters in the
11757 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11758 (TypeManager.MemberLookup): Removed the
11759 `num_type_args' argument; we now encode the number of type
11760 arguments in the type name.
11762 2004-04-03 Martin Baulig <martin@ximian.com>
11764 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11765 (MemberCore.MemberName): Moved here from MemberBase.
11766 (DeclSpace.SetParameterInfo): Just take the constraints as an
11767 ArrayList; we already have the type parameters in our
11768 `MemberName'; also do the CS0080 reporting here.
11770 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11771 `IDENTIFIER opt_type_parameter_list'; when constructing our
11772 `MemberName', it'll already include our type parameters.
11773 (class_declaration, interface_declaration): Likewise.
11774 (delegate_declaration): Likewise.
11775 (MakeName): Take a MemberName and return a MemberName.
11776 The following two changes are required to avoid shift/reduce conflicts:
11777 (member_name): Don't include a TypeName anymore; ie. this is now
11778 just 'IDENTIFIER opt_type_parameter_list'.
11779 (property_declaration, event_declaration): Use a
11780 `namespace_or_type_name' instead of a `member_name'.
11782 2004-04-03 Martin Baulig <martin@ximian.com>
11784 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11785 `MemberName' class.
11786 (TypeName): Formerly known as MemberName.
11788 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11789 instead of a `MemberName'.
11791 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11792 (member_name): New rule; create a MemberName.
11794 2004-04-02 Martin Baulig <martin@ximian.com>
11796 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11797 (CS0305 and CS0308).
11799 2004-04-02 Martin Baulig <martin@ximian.com>
11801 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11802 support for nested types.
11804 2004-04-02 Martin Baulig <martin@ximian.com>
11806 * ecore.cs (IAlias): New public interface.
11807 (TypeExpr, TypeExpression): Implement IAlias.
11808 (TypeAliasExpression): New public class.
11810 * namespace.cs (Namespace): Implement IAlias.
11811 (Namespace.Lookup): Return an IAlias instead on an object.
11812 (Namespace.DefineName): Take an IAlias instead of an object.
11813 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11815 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11817 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11819 (NamespaceEntry.Lookup): Likewise.
11821 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11824 * decl.cs (DeclSpace): Implement IAlias.
11825 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11827 * generic.cs (ConstructedType): Improved error checking.
11829 2004-04-02 Martin Baulig <martin@ximian.com>
11831 * convert.cs: Added type parameter conversions.
11834 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11835 (ClassCast.Emit): If the source type is a type parameter, box it.
11836 If the target type is a type parameter, emit an `unbox.any'
11837 instead of a `classcast'.1
11839 2004-04-01 Martin Baulig <martin@ximian.com>
11841 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11843 2004-04-01 Martin Baulig <martin@ximian.com>
11845 * generic.cs (ConstructedType.CheckConstraints): Use
11846 Convert.ImplicitStandardConversionExists(); user-defined implicit
11847 conversions are not allowed according to the spec.
11849 2004-03-30 Martin Baulig <martin@ximian.com>
11851 * expression.cs (New): Added support for type parameters.
11854 (TypeManager.activator_type): New public static field.
11855 (TypeManager.activator_create_instance): Likewise.
11857 2004-03-30 Martin Baulig <martin@ximian.com>
11859 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11862 2004-03-30 Martin Baulig <martin@ximian.com>
11864 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11865 the spec here: the argument type must be convertible to the
11868 2004-03-30 Martin Baulig <martin@ximian.com>
11871 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11872 TypeManager.AddTypeParameter().
11873 (ConstructedType.CheckConstraints): Re-enable this and actually
11874 check whether we have a constructor constraint.
11877 (TypeManager.builder_to_type_param): New static field.
11878 (TypeManager.AddTypeParameter): New static method.
11879 (TypeManager.LookupTypeParameter): New public method.
11881 2004-03-30 Martin Baulig <martin@ximian.com>
11883 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11884 the new API to actually define the constructor constraint.
11887 (TypeManager.new_constraint_attr_type): New static field.
11888 (TypeManager.InitCoreTypes): Initialize it.
11890 2004-03-30 Martin Baulig <martin@ximian.com>
11892 * generic.cs (Constraints): Completed error checking, use correct
11895 2004-03-29 Martin Baulig <martin@ximian.com>
11897 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11899 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11900 public version which takes a `ParameterData pd' instead of an
11903 2004-03-29 Martin Baulig <martin@ximian.com>
11905 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11908 2004-03-29 Martin Baulig <martin@ximian.com>
11910 * expression.cs (Argument.ResolveMethodGroup): If we're a
11911 ConstructedType, call GetMemberAccess() on it.
11913 2004-03-29 Martin Baulig <martin@ximian.com>
11915 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11916 (MethodCore.CheckGenericOverride): When overriding a generic
11917 method, check whether the constraints match.
11919 * support.cs (GenericConstraints): New public interface.
11920 (ParameterData.GenericConstraints): New public method.
11922 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11923 method parameter and compute our constraints if appropriate.
11924 (Parameter.GenericConstraints): New public property.
11926 * generic.cs (Constraints): Implement GenericConstraints.
11928 2004-03-29 Martin Baulig <martin@ximian.com>
11930 * decl.cs (MemberCache.FindMemberToOverride): Use
11931 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11933 2004-03-29 Martin Baulig <martin@ximian.com>
11935 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11937 2004-03-29 Martin Baulig <martin@ximian.com>
11939 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11940 not allowed on non-generic declarations").
11942 2004-03-29 Martin Baulig <martin@ximian.com>
11944 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11945 public version of this method.
11947 * class.cs (MethodCore.IsDuplicateImplementation): Use
11948 Invocation.InferTypeArguments() to check this.
11950 2004-03-29 Martin Baulig <martin@ximian.com>
11952 * convert.cs: Use TypeManager.IsDelegateType() instead of
11953 comparing types correctly.
11955 2004-03-29 Martin Baulig <martin@ximian.com>
11957 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11958 types directly to make it work for generic instances.
11960 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11962 2004-03-29 Martin Baulig <martin@ximian.com>
11964 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11965 support for arrays.
11967 2004-03-24 Martin Baulig <martin@ximian.com>
11969 * decl.cs (DeclSpace.FindType): Also use
11970 TypeManager.CheckGeneric() for types from the using clauses.
11972 2004-03-23 Martin Baulig <martin@ximian.com>
11974 * expression.cs (Invocation.OverloadResolve): Added `bool
11975 may_fail' argument and use it instead of the Location.IsNull() hack.
11977 2004-03-23 Martin Baulig <martin@ximian.com>
11979 * expression.cs (Invocation.InferType): Use correct type inference
11982 2004-03-23 Martin Baulig <martin@ximian.com>
11984 * ecore.cs (MethodGroupExpr.Name): Use
11985 TypeManager.CSharpSignature() instead of just the name.
11987 * expression.cs (Invocation.OverloadResolve): Provide better error
11989 (Invocation.DoResolve): OverloadResolve() never returns null
11990 without reporting an error, so removed the error -6 reporting here.
11992 2004-03-23 Martin Baulig <martin@ximian.com>
11994 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11997 * cs-parser.jay (delegate_declaration): Support generic delegates.
11999 * delegate.cs: Support generic delegates.
12001 2004-03-22 Martin Baulig <martin@ximian.com>
12003 * expression.cs (Invocation.InferParamsTypeArguments): New static
12004 method; does type inference for params arguments.
12006 2004-03-21 Martin Baulig <martin@ximian.com>
12008 * typemanager.cs (TypeManager.IsGenericMethod): New public static
12009 method; checks whether a method is a generic method.
12011 * expression.cs (Invocation.InferTypeArguments): New static method;
12012 infer type arguments for generic method invocation.
12014 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12015 property; we set this to true if we're resolving a generic method
12016 invocation and the user specified type arguments, ie. we're not
12017 doing type inference.
12019 2004-03-20 Martin Baulig <martin@ximian.com>
12021 * class.cs (MethodData.DeclaringType): New public property.
12022 (MethodData.Define): Set DeclaringType here.
12023 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12024 instead of OperatorMethodBuilder.DeclaringType.
12026 2004-03-20 Martin Baulig <martin@ximian.com>
12028 * cs-tokenizer.cs (xtoken): Return a special
12029 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12031 * cs-parser.jay (default_value_expression): Switch to the new
12034 2004-03-19 Martin Baulig <martin@ximian.com>
12036 * decl.cs (MemberName): New class. We use this to "construct"
12037 namespace_or_type_name's.
12039 * generics.cs (TypeArguments.GetDeclarations): New public method;
12040 returns the type arguments as a string[] and reports a CS0081 if
12041 one of them is not an identifier.
12043 * class.cs (MemberBase): The .ctor now takes the name as a
12044 MemberName instead of a string.
12045 (MemberBase.ExplicitInterfaceName): Changed type from string to
12047 (MemberBase.DoDefine): If we're an explicit implementation, the
12048 InterfaceType may be a generic instance.
12050 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12051 (namespace_name): Call MemberName.GetName () to transform the
12052 MemberName into a string and ensure we don't have any type
12054 (type_name): Call MemberName.GetTypeExpression() to transfrom the
12055 MemberName into an expression.
12056 (method_header): Use namespace_or_type_name instead of member_name.
12058 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12060 * rootcontext.cs: Add new types to the boot resolution.
12062 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12063 MulticastDelegate is not allowed.
12065 * typemanager.cs: Add new types to lookup: System.TypedReference
12068 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12069 check for TypedReference or ArgIterator, they are not allowed.
12071 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12072 makes us properly catch 1510 in some conditions (see bug 56016 for
12075 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12077 * CryptoConvert.cs: update from corlib version
12080 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12082 * class.cs (Indexer.Define): Check indexername declaration
12084 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12086 * attribute.cs (IsClsCompliant): Fixed problem with handling
12087 all three states (compliant, not-compliant, undetected).
12089 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12091 * attribute.cs (Attribute): Location is now public.
12092 (Resolve): Store resolved arguments (pos_values) in attribute class.
12093 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12094 (GetClsCompliantAttributeValue): New method that gets
12095 CLSCompliantAttribute value.
12096 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12097 if exists else null.
12098 (AttributeTester): New class for CLS-Compliant verification routines.
12100 * class.cs (Emit): Add CLS-Compliant verification.
12101 (Method.GetSignatureForError): Implemented.
12102 (Constructor.GetSignatureForError): Implemented
12103 (Constructor.HasCompliantArgs): Returns if constructor has
12104 CLS-Compliant arguments.
12105 (Constructor.Emit): Override.
12106 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12107 is needed to test only parameters.
12108 (FieldBase.GetSignatureForError): Implemented.
12109 (TypeContainer): New member for storing base interfaces.
12110 (TypeContainer.FindMembers): Search in base interfaces too.
12112 * codegen.cs (GetClsComplianceAttribute): New method that gets
12113 assembly or module CLSCompliantAttribute value.
12114 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12116 (ModuleClass.Emit): Add error 3012 test.
12118 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12120 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12121 state for all decl types.
12122 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12123 if CLS-Compliant tests are required.
12124 (IsClsCompliaceRequired): New method. Analyze whether code
12125 must be CLS-Compliant.
12126 (IsExposedFromAssembly): New method. Returns true when MemberCore
12127 is exposed from assembly.
12128 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12129 value or gets cached value.
12130 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12131 is explicitly marked with CLSCompliantAttribute.
12132 (IsIdentifierClsCompliant): New abstract method. This method is
12133 used to testing error 3005.
12134 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12135 for identifier and parameters CLS-Compliant testing.
12136 (VerifyClsCompliance): New method. The main virtual method for
12137 CLS-Compliant verifications.
12138 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12139 null. I don't know why is null (too many public members !).
12140 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12141 and get value of first CLSCompliantAttribute that found.
12143 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12144 (VerifyClsCompliance): Override and add extra tests.
12146 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12147 clscheck- disable CLS-Compliant verification event if assembly is has
12148 CLSCompliantAttribute(true).
12150 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12151 ApllyAttribute is now called in emit section as in the other cases.
12152 Possible future Emit integration.
12153 (IsIdentifierClsCompliant): New override.
12154 (VerifyClsCompliance): New override.
12155 (GetEnumeratorName): Returns full enum name.
12157 * parameter.cs (GetSignatureForError): Implemented.
12159 * report.cs (WarningData): New struct for Warning message information.
12160 (LocationOfPreviousError): New method.
12161 (Warning): New method. Reports warning based on the warning table.
12162 (Error_T): New method. Reports error based on the error table.
12164 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12165 verifications are done here.
12167 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12169 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12170 CLSCompliantAttribute.
12171 (all_imported_types): New member holds all imported types from other
12173 (LoadAllImportedTypes): New method fills static table with exported types
12174 from all referenced assemblies.
12175 (Modules): New property returns all assembly modules.
12177 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12179 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12180 throwing a parser error.
12182 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12183 which removes the hardcoded get_/set_ prefixes for properties, as
12184 IL allows for the properties to be named something else.
12188 * expression.cs: Do not override operand before we know if it is
12189 non-null. Fix 56207
12191 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12193 * typemanager.cs: support for pinned variables.
12195 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12197 * decl.cs, typemanager.cs: Avoid using an arraylist
12198 as a buffer if there is only one result set.
12200 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12202 * expression.cs: Make sure you cant call a static method
12203 with an instance expression, bug #56174.
12205 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12207 * class.cs (IsDuplicateImplementation): Improve error reporting to
12208 flag 663 (method only differs in parameter modifier).
12210 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12211 in preprocessor directives.
12213 * location.cs (LookupFile): Allow for the empty path.
12215 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12216 better approach for some of that patch, but its failing with the
12217 CharSet enumeration. For now try/catch will do.
12219 * typemanager.cs: Do not crash if a struct does not have fields.
12222 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12224 * expression.cs: cs0213, cant fix a fixed expression.
12227 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12229 * cs-parser.jay: detect invalid embeded statements gracefully.
12232 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12234 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12237 the invocation type may not be a subclass of the tye of the item/
12238 The type of the item must be a subclass of the invocation item.
12243 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12245 * attribute.cs: Added methods to get a string and a bool from an
12246 attribute. Required to information from AssemblyKeyFileAttribute,
12247 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12248 * codegen.cs: Modified AssemblyName creation to include support for
12249 strongnames. Catch additional exceptions to report them as CS1548.
12250 * compiler.csproj: Updated include CryptoConvert.cs.
12251 * compiler.csproj.user: Removed file - user specific configuration.
12252 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12253 Mono.Security assembly. The original class is maintained and tested in
12254 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12255 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12256 like CSC 8.0 (C# v2) supports.
12257 * Makefile: Added CryptoConvert.cs to mcs sources.
12258 * rootcontext.cs: Added new options for strongnames.
12260 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12262 * driver.cs: For --expect-error, report error code `2'
12263 if the program compiled with no errors, error code `1' if
12264 it compiled with an error other than the one expected.
12266 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12268 * compiler.csproj: Updated for Visual Studio .NET 2003.
12269 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12270 * compiler.sln: Updated for Visual Studio .NET 2003.
12272 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12274 * expression.cs: Fix bug #47234. We basically need to apply the
12275 rule that we prefer the conversion of null to a reference type
12276 when faced with a conversion to 'object' (csc behaviour).
12278 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12280 * statement.cs: Shorter form for foreach, eliminates
12281 a local variable. r=Martin.
12283 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12285 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12286 checks if we can use brtrue/brfalse to test for 0.
12287 * expression.cs: use the above in the test for using brtrue/brfalse.
12288 cleanup code a bit.
12290 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12292 * expression.cs: Rewrite string concat stuff. Benefits:
12294 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12295 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12296 rather than a concat chain.
12298 * typemanager.cs: Add lookups for more concat overloads.
12300 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12302 * expression.cs: Emit shorter il code for array init.
12319 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12321 * statement.cs: Before, two switch blocks would be merged if the
12322 total size of the blocks (end_item - begin_item + 1) was less than
12323 two times the combined sizes of the blocks.
12325 Now, it will only merge if after the merge at least half of the
12330 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12332 * class.cs : csc build fix for GetMethods(). See bug #52503.
12334 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12336 * expression.cs: Make sure fp comparisons work with NaN.
12337 This fixes bug #54303. Mig approved this patch a long
12338 time ago, but we were not able to test b/c the runtime
12341 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12343 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12345 2004-03-19 Martin Baulig <martin@ximian.com>
12347 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12348 two overloads may unify for some type parameter substitutions and
12349 report a CS0408 if appropriate.
12351 2004-03-19 Martin Baulig <martin@ximian.com>
12353 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12354 error here and not in our caller.
12356 2004-03-19 Martin Baulig <martin@ximian.com>
12358 * interface.cs: Completely killed this file.
12359 (Interface): We're now a TypeContainer and live in class.cs.
12361 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12362 argument; we're now also called for interfaces.
12363 (TypeContainer.DefineMembers): Allow this method being called
12365 (TypeContainer.GetMethods): New public method; formerly known as
12366 Interface.GetMethod(). This is used by PendingImplementation.
12367 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12368 it's now private and non-static.
12369 (Interface): Moved this here; it's now implemented similar to
12371 (Method, Property, Event, Indexer): Added `bool is_interface'
12372 argument to their .ctor's.
12373 (MemberBase.IsInterface): New public field.
12375 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12376 instances instead of InterfaceMethod, InterfaceProperty, etc.
12377 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12378 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12380 2004-03-19 Martin Baulig <martin@ximian.com>
12382 * class.cs (MethodCore.IsDuplicateImplementation): New private
12383 method which does the CS0111 checking.
12384 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12385 Use IsDuplicateImplementation().
12387 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12389 * decl.cs (FindMemberToOverride): New method to find the correct
12390 method or property to override in the base class.
12392 - Make Method/Property use the above method to find the
12393 version in the base class.
12394 - Remove the InheritableMemberSignatureCompare as it is now
12397 This patch makes large code bases much faster to compile, as it is
12398 O(n) rather than O(n^2) to do this validation.
12400 Also, it fixes bug 52458 which is that nested classes are not
12401 taken into account when finding the base class member.
12403 Reviewed/Approved by Martin.
12405 2004-03-17 Martin Baulig <martin@ximian.com>
12407 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12408 of type arguments into account; use the `real_num_type_args'
12409 approach like in DoResolveAsTypeStep().
12411 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12414 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12416 * interface.cs: In all interface classes removed redundant
12417 member initialization.
12419 2004-03-16 Martin Baulig <martin@ximian.com>
12421 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12423 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12425 * decl.cs (DefineTypeAndParents): New helper method to define a
12426 type's containers before the type itself is defined; This is a
12427 bug exposed by the recent changes to Windows.Forms when an
12428 implemented interface was defined inside a class that had not been
12431 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12433 (Check): Loop correctly to report errors modifiers
12434 (UNSAFE was not in the loop, since it was the same as TOP).
12436 * interface.cs: Every interface member now takes a ModFlags,
12437 instead of a "is_new" bool, which we set on the base MemberCore.
12439 Every place where we called "UnsafeOk" in the interface, now we
12440 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12441 the unsafe settings from the member declaration instead of the
12442 container interface.
12444 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12446 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12447 `set_indexer_name' to the pending bits (one per type).
12449 We fixed a bug today that was picking the wrong method to
12450 override, since for properties the existing InterfaceMethod code
12451 basically ignored the method name. Now we make sure that the
12452 method name is one of the valid indexer names.
12454 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12456 * support.cs (SeekableStreamReader): Keep track of stream byte
12457 positions and don't mix them with character offsets to the buffer.
12459 Patch from Gustavo Giráldez
12461 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12463 * interface.cs (InterfaceSetGetBase): Removed double member
12464 initialization, base class does it as well.
12466 2004-03-13 Martin Baulig <martin@ximian.com>
12468 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12469 when compiling corlib.
12471 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12473 * convert.cs (ExplicitConversion): We were reporting an error on
12474 certain conversions (object_type source to a value type, when the
12475 expression was `null') before we had a chance to pass it through
12476 the user defined conversions.
12478 * driver.cs: Replace / and \ in resource specifications to dots.
12481 * class.cs: Add check for duplicate operators. Fixes 52477
12483 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12485 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12486 that are in the middle of the statements, not only at the end.
12489 * class.cs (TypeContainer.AddField): No longer set the
12490 `HaveStaticConstructor' flag, now we call it
12491 `UserDefineStaticConstructor' to diferentiate the slightly
12492 semantic difference.
12494 The situation is that we were not adding BeforeFieldInit (from
12495 Modifiers.TypeAttr) to classes that could have it.
12496 BeforeFieldInit should be set to classes that have no static
12501 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12503 And most importantly Zoltan's comment:
12505 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12507 "I think beforefieldinit means 'it's ok to initialize the type sometime
12508 before its static fields are used', i.e. initialization does not need
12509 to be triggered by the first access to the type. Setting this flag
12510 helps the JIT to compile better code, since it can run the static
12511 constructor at JIT time, and does not need to generate code to call it
12512 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12513 this flag for lots of classes like String.
12515 csc sets this flag if the type does not have an explicit static
12516 constructor. The reasoning seems to be that if there are only static
12517 initalizers for a type, and no static constructor, then the programmer
12518 does not care when this initialization happens, so beforefieldinit
12521 This bug prevents the AOT compiler from being usable, since it
12522 generates so many calls to mono_runtime_class_init that the AOT code
12523 is much slower than the JITted code. The JITted code is faster,
12524 because it does not generate these calls if the vtable is type is
12525 already initialized, which is true in the majority of cases. But the
12526 AOT compiler can't do this."
12528 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12530 * class.cs (MethodData.Emit): Refactor the code so symbolic
12531 information is generated for destructors; For some reasons we
12532 were taking a code path that did not generate symbolic information
12535 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12537 * class.cs: Create a Constructor.CheckBase method that
12538 takes care of all validation type code. The method
12539 contains some code that was moved from Define.
12541 It also includes new code that checks for duplicate ctors.
12542 This fixes bug #55148.
12544 2004-03-09 Joshua Tauberer <tauberer@for.net>
12546 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12547 a { ... }-style array creation invokes EmitStaticInitializers
12548 which is not good for reference-type arrays. String, decimal
12549 and now null constants (NullCast) are not counted toward
12550 static initializers.
12552 2004-03-05 Martin Baulig <martin@ximian.com>
12554 * location.cs (SourceFile.HasLineDirective): New public field;
12555 specifies whether the file contains or is referenced by a "#line"
12557 (Location.DefineSymbolDocuments): Ignore source files which
12558 either contain or are referenced by a "#line" directive.
12560 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12562 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12563 direct access to our parent, so check the method inline there.
12565 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12567 * expression.cs (Invocation.EmitCall): Miguel's last commit
12568 caused a regression. If you had:
12573 In Foo the implict this would be null.
12575 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12577 * expression.cs (Invocation.EmitCall): If the method is not
12578 virtual, do not emit a CallVirt to it, use Call.
12580 * typemanager.cs (GetFullNameSignature): Improve the method to
12581 cope with ".ctor" and replace it with the type name.
12583 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12584 as an argument the ConstructorBuilder where it is being defined,
12585 to catch the recursive constructor invocations.
12587 2004-03-16 Martin Baulig <martin@ximian.com>
12589 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12590 ConstructedType, call ResolveType() on it to get the type rather
12591 than just using `expr.Type'.
12593 2004-03-16 Martin Baulig <martin@ximian.com>
12595 * generics.cs (ConstructedType.GetMemberAccess): Take the
12596 EmitContext instead on the TypeExpr and use
12597 ec.TypeContainer.CurrentType/ec.ContainerType.
12599 2004-03-16 Martin Baulig <martin@ximian.com>
12601 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12602 parameters before aliases.
12604 2004-03-16 Martin Baulig <martin@ximian.com>
12606 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12607 New oublic function; checks whether two generic instances may become
12608 equal under some instantiations (26.3.1).
12610 * class.cs (TypeContainer.Define): Call
12611 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12614 2004-03-16 Martin Baulig <martin@ximian.com>
12616 * class.cs (TypeContainer.GetClassBases): Moved
12617 Error_TypeParameterAsBase() here and also check whether the base
12618 class is not an attribute.
12620 2004-03-16 Martin Baulig <martin@ximian.com>
12622 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12624 2004-03-16 Martin Baulig <martin@ximian.com>
12626 * class.cs (Error_TypeParameterAsBase): Use correct error number
12629 2004-03-16 Martin Baulig <martin@ximian.com>
12631 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12634 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12637 2004-03-15 Martin Baulig <martin@ximian.com>
12639 * typemanager.cs (TypeManager.GetFullName): New public method.
12640 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12641 argument; only return members with the correct number of type
12643 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12644 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12645 whether the number of type arguments matches.
12647 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12648 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12650 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12651 field; it's set by the protected .ctor when we're actually a
12652 GenericMemberAccess.
12653 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12654 arguments and pass it to MemberLookupFinal ().
12656 * ecore.cs (Expression.MemberLookup): Added `int
12657 num_type_arguments' argument; only return members with the correct
12658 number of type arguments.
12659 (Expression.MemberLookupFailed): Check whether the MemberLookup
12660 failed because we did not have the correct number of type
12661 arguments; report CS0305 in this case.
12663 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12664 `e.ResolveAsTypeTerminal()' already did so.
12666 2004-03-15 Martin Baulig <martin@ximian.com>
12668 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12669 we're a ConstructedType; in this case, the caller must report an
12670 error (for instance CS0131).
12672 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12673 (TypeArguments.Resolve): Actually report errors here.
12675 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12677 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12678 `set_indexer_name' to the pending bits (one per type).
12680 We fixed a bug today that was picking the wrong method to
12681 override, since for properties the existing InterfaceMethod code
12682 basically ignored the method name. Now we make sure that the
12683 method name is one of the valid indexer names.
12685 2004-03-15 Martin Baulig <martin@ximian.com>
12687 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12688 for generic instances.
12690 2004-03-13 Martin Baulig <martin@ximian.com>
12692 * class.cs (TypeContainer.DefineType): Call
12693 TypeManager.AddUserType() immediately after creating the
12694 TypeBuilder; pass all type parameters when creating the
12697 * decl.cs (DeclSpace.FindNestedType): New public method.
12698 (DeclSpace.FindType): Added `int num_type_args' argument; only
12699 return types with the correct number of type parameters.
12700 (DeclSpace.CountTypeParams): New public property.
12702 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12703 the number of type parameters; defaults to zero.
12705 * generic.cs (TypeArguments.Count): New public property.
12706 (ConstructedType.DoResolveAsTypeStep): First call
12707 ds.FindNestedType() to find out whether we're nested in the
12708 current generic type; in this case, we inherit all type parameters
12709 from the current class.
12711 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12712 num_type_args' argument.
12713 (RootContext.LookupType): Added overloaded version which takes the
12714 number of type arguments; only return types with the correct
12715 number of type arguments.
12717 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12718 checks whether `Type t' has `int num_type_args'.
12720 2004-03-13 Martin Baulig <martin@ximian.com>
12722 * generic.cs (GenericMethod.DefineType): New method; calls
12723 DefineType() on all the type parameters.
12725 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12726 (MethodData.Define): If we're a generic method, call
12727 GenericMethod.DefineType() to define the type parameters.
12729 2004-03-10 Martin Baulig <martin@ximian.com>
12731 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12732 instead of IsAssignableFrom.
12734 2004-03-10 Martin Baulig <martin@ximian.com>
12736 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12738 * support.cs (ParameterData.HasArrayParameter): New property.
12739 (ReflectionParameters.ctor): Take a MethodBase instead of a
12740 ParameterInfo[]. If we have any type parameters, get the generic
12741 method definition and ask it whether we have variable arguments.
12743 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12745 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12746 routines to check if a type is an enumerable/enumerator allow
12747 classes that implement the IEnumerable or IEnumerator interfaces.
12749 * class.cs (Property, Operator): Implement IIteratorContainer, and
12750 implement SetYields.
12752 (Property.Define): Do the block swapping for get_methods in the
12753 context of iterators. We need to check if Properties also
12754 include indexers or not.
12756 (Operator): Assign the Block before invoking the
12757 OperatorMethod.Define, so we can trigger the Iterator code
12760 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12761 Property and Operator classes are not created when we parse the
12762 declarator but until we have the block completed, so we use a
12763 singleton SimpleIteratorContainer.Simple to flag whether the
12764 SetYields has been invoked.
12766 We propagate this setting then to the Property or the Operator to
12767 allow the `yield' to function.
12769 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12771 * codegen.cs: Implemented attribute support for modules.
12772 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12773 Assembly/Module functionality.
12775 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12776 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12777 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12779 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12781 * interface.cs (FindMembers): The operation is performed on all base
12782 interfaces and not only on the first. It is required for future CLS Compliance patch.
12784 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12786 * statement.cs, codegen.cs:
12787 This patch deals with patterns such as:
12789 public class List : IEnumerable {
12791 public MyEnumerator GetEnumerator () {
12792 return new MyEnumerator(this);
12795 IEnumerator IEnumerable.GetEnumerator () {
12799 public struct MyEnumerator : IEnumerator {
12804 Before, there were a few things we did wrong:
12805 1) we would emit callvirt on a struct, which is illegal
12806 2) we emited ldarg when we needed to emit ldarga
12807 3) we would mistakenly call the interface methods on an enumerator
12808 type that derived from IEnumerator and was in another assembly. For example:
12810 public class MyEnumerator : IEnumerator
12812 Would have the interface methods called, even if there were public impls of the
12813 method. In a struct, this lead to invalid IL code.
12815 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12817 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12820 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12822 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12824 * cs-parser.jay: Fix small regression: we were not testing V2
12825 compiler features correctly.
12827 * interface.cs: If the emit context is null, then create one
12829 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12831 * decl.cs (GetSignatureForError): New virtual method to get full name
12832 for error messages.
12834 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12835 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12837 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12838 Duplicated members and code in these classes has been removed.
12839 Better encapsulation in these classes.
12841 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12843 * assign.cs (Assign.DoResolve): When dealing with compound
12844 assignments, there is a new rule in ECMA C# 2.4 (might have been
12845 there before, but it is documented here) that states that in:
12849 If b is of type int, and the `op' is a shift-operator, then the
12850 above is evaluated as:
12854 * expression.cs (Binary.ResolveOperator): Instead of testing for
12855 int/uint/long/ulong, try to implicitly convert to any of those
12856 types and use that in pointer arithmetic.
12858 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12859 method to print information for from the type, not from the
12860 null-method we were given.
12862 2004-02-01 Duncan Mak <duncan@ximian.com>
12864 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12865 parsing for cmd, fixes bug #53694.
12867 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12869 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12870 in the member name duplication tests. Property and operator name duplication
12871 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12873 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12875 * interface.cs (PopulateMethod): Fixed crash when interface method
12876 returns not existing type (error test cs0246-3.cs).
12878 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12880 * cs-parser.jay (interface_accessors): Re-write actions to also
12881 store attributes attached to get and set methods. Fix spelling
12884 (inteface_property_declaration): Modify accordingly.
12886 (InterfaceAccessorInfo): New helper class to store information to pass
12887 around between rules that use interface_accessors.
12889 * interface.cs (Emit): Apply attributes on the get and set
12890 accessors of properties and indexers too.
12892 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12893 right MethodBuilder when applying attributes to the get and set accessors.
12895 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12897 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12899 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12901 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12903 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12905 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12906 changes that treat `yield' specially when present before `break'
12907 or `return' tokens.
12909 * cs-tokenizer.cs: yield is no longer a keyword.
12911 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12913 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12914 setting for default constructors.
12915 For default constructors are almost every time set wrong Modifier. The
12916 generated IL code has been alright. But inside mcs this values was
12917 wrong and this was reason why several of my CLS Compliance tests
12920 2004-02-27 Martin Baulig <martin@ximian.com>
12922 * generics.cs (ConstructedType.ResolveType): Make the nested type
12923 stuff actually work.
12925 2004-02-25 Martin Baulig <martin@ximian.com>
12927 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12928 property; returns the type parameters just from the current type,
12929 ie. with the ones from outer classes.
12930 (DeclSpace.LookupGeneric): First search in the current class, then
12932 (DeclSpace.initialize_type_params): When hiding a type parameter
12933 from an outer class, put it into the `type_param_list' anyways.
12935 * expression.cs (MemberAccess.expr): Made this field protected.
12937 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12938 the type parameters from the current class.
12940 * generic.cs (ConstructedType.ResolveType): Support nested generic
12941 types by taking the type parameters which we inherit from outer
12942 classes into account.
12943 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12944 support for nested generic types.
12946 2004-02-23 Martin Baulig <martin@ximian.com>
12948 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12949 field and check whether we're nested inside a generic type.
12950 (DeclSpace.ResolveType): If we're resolving to a generic type
12951 definition, create a ConstructedType and return its resolved type.
12952 (DeclSpace.initialize_type_params): New private method;
12953 initializes the `type_param_list' field from the type parameters
12954 from this and all enclosing classes.
12955 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12956 we're already initialized.
12958 2004-02-23 Martin Baulig <martin@ximian.com>
12960 * class.cs (Method.Define): Create the generic method before
12961 calling DoDefine().
12962 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12963 the TypeContainer one); we use this for generic methods.
12965 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12966 parent's TypeBuilder.
12968 2004-02-18 Martin Baulig <martin@ximian.com>
12970 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12971 to check for equality.
12973 2004-02-05 Martin Baulig <martin@ximian.com>
12975 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12976 `ec.TypeContainer.CurrentType', use it instead of
12977 `ec.ContainerType' to check whether we're in the type's ctor.
12979 2004-01-29 Martin Baulig <martin@ximian.com>
12981 * expression.cs (Invocation.DoResolve): If we're a
12982 `ConstructedType', then we're actually a generic method, so
12983 rewrite the expr as a GenericMemberAccess.
12985 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12986 here; manually parse it into a string.
12988 2004-01-28 Martin Baulig <martin@ximian.com>
12990 * typemanager.cs (TypeManager.IsEqual): New static method.
12991 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12992 check for equality instead of using `=='.
12994 2004-01-26 Martin Baulig <martin@ximian.com>
12996 * decl.cs (DeclSpace.CurrentType): New public field.
12998 * expression.cs (This.ResolveBase): If we have an
12999 `ec.TypeContainer.CurrentType', use it instead of
13000 `ec.ContainerType'.
13002 * class.cs (TypeContainer.DefineType): If we're a generic type,
13003 create the `CurrentType' (unresolved).
13004 (TypeContainer.GenericType): New private field.
13005 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13006 it and store it in `GenericType' before creating the MemberCache.
13007 (TypeContainer.GetMembers): If we have a `GenericType', call
13008 TypeManager.FindMembers() on it.
13010 * interface.cs (Interface.GenericType): New private field.
13011 (Interface.DefineType): If we're a generic type, create the
13012 `CurrentType' (unresolved).
13013 (Interface.DefineMembers): If we have a `CurrentType', resolve it
13014 and store it in `GenericType' before creating the MemberCache.
13015 (Interface.GetMembers): If we have a `GenericType', call
13016 TypeManager.FindMembers() on it.
13018 2004-01-22 Martin Baulig <martin@ximian.com>
13020 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13021 not a QualifiedIdentifier. This is what `type_name_expression'
13022 was previously doing.
13023 (type_name_expression): Removed; the code is now in
13024 `namespace_or_type_name'.
13025 (qualified_identifier): Removed, use `namespace_or_type_name'
13027 (QualifiedIdentifier): Removed this class.
13029 2004-01-22 Martin Baulig <martin@ximian.com>
13031 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13032 not a string as alias name.
13034 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13036 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13037 #52730 bug, and instead compute correctly the need to use a
13038 temporary variable when requesting an address based on the
13039 static/instace modified of the field and the constructor.
13041 2004-01-21 Martin Baulig <martin@ximian.com>
13043 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13044 class and namespace before looking up aliases. Fixes #52517.
13046 2004-01-21 Martin Baulig <martin@ximian.com>
13048 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13049 assinged in a 'try'; fixes exception4.cs.
13051 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13052 * class.cs : Implemented parameter-less constructor for TypeContainer
13054 * decl.cs: Attributes are now stored here. New property OptAttributes
13056 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13058 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13060 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13062 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13063 (CSharpSignature): New method for indexer and property signature.
13065 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13067 * pending.cs (IsVirtualFilter): Faster implementation.
13069 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13071 * typemanager.cs: Avoid inclusion of same assembly more than once.
13073 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13075 * cs-parser.jay: Fixed problem where the last assembly attribute
13076 has been applied also to following declaration (class, struct, etc.)
13078 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13080 * class.cs: Added error CS0538, CS0539 reporting.
13081 Fixed crash on Microsoft runtime when field type is void.
13083 * cs-parser.jay: Added error CS0537 reporting.
13085 * pending.cs: Added error CS0535 reporting.
13086 Improved error report for errors CS0536, CS0534.
13088 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13090 Merge a few bits from the Anonymous Method MCS tree.
13092 * statement.cs (ToplevelBlock): New class for toplevel methods,
13093 will hold anonymous methods, lifted variables.
13095 * cs-parser.jay: Create toplevel blocks for delegates and for
13096 regular blocks of code.
13098 2004-01-20 Martin Baulig <martin@ximian.com>
13100 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13101 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13102 and `NeedExplicitReturn'; added `IsLastStatement'.
13103 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13104 have a `ReturnLabel' or we're not unreachable.
13106 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13107 child's reachability; don't just override ours with it. Fixes
13108 #58058 (lluis's example).
13109 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13110 InFinally(), InLoop(), InSwitch() and
13111 BreakCrossesTryCatchBoundary() methods.
13113 * statement.cs (Return): Do all error checking in Resolve().
13114 Unless we are the last statement in a top-level block, always
13115 create a return label and jump to it.
13116 (Break, Continue): Do all error checking in Resolve(); also make
13117 sure we aren't leaving a `finally'.
13118 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13119 statement in a top-level block.
13120 (Block.Flags): Added `IsDestructor'.
13121 (Block.IsDestructor): New public property.
13123 2004-01-20 Martin Baulig <martin@ximian.com>
13125 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13127 2004-01-20 Martin Baulig <martin@ximian.com>
13129 * statement.cs (Statement.ResolveUnreachable): New public method.
13130 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13131 (Block.Resolve): Resolve unreachable statements.
13133 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13135 * expression.cs: We need to fix the case where we do
13136 not have a temp variable here.
13138 * assign.cs: Only expression compound assignments need
13139 temporary variables.
13141 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13143 * flowanalysis.cs: Reduce memory allocation in a few ways:
13144 - A block with no variables should not allocate a bit
13146 - A method with no out parameters does not need any tracking
13147 for assignment of the parameters, so we need not allocate
13150 public readonly Type[] VariableTypes;
13151 public readonly string[] VariableNames;
13152 Are redundant. The data is already stored in the variable
13153 map, so we need not allocate another array for it.
13154 - We need to add alot of checks for if (params | locals) == null
13155 due to the first two changes.
13157 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13159 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13160 implement IMemoryLocation, we store a copy on a local variable and
13161 take the address of it. Patch from Benjamin Jemlich
13163 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13164 to use a special "type_name_expression" rule which reduces the
13165 number of "QualifiedIdentifier" classes created, and instead
13166 directly creates MemberAccess expressions.
13168 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13170 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13171 that fixes #52853. Null literal assignment to ValueType
13173 * class.cs (MethodData.Emit): Instead of checking the name of the
13174 method to determine if its a destructor, create a new derived
13175 class from Method called Destructor, and test for that.
13177 * cs-parser.jay: Create a Destructor object instead of a Method.
13179 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13183 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13185 * expression.cs (Binary.ResolveOperator): Perform an implicit
13186 conversion from MethodGroups to their delegate types on the
13187 Addition operation.
13189 * delegate.cs: Introduce a new class DelegateCreation that is the
13190 base class for `NewDelegate' and `ImplicitDelegateCreation',
13191 factor some code in here.
13193 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13194 conversion from MethodGroups to compatible delegate types.
13196 * ecore.cs (Expression.Resolve): Do not flag error 654
13197 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13198 we allow conversions from MethodGroups to delegate types now.
13200 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13201 assignments in v2 either.
13203 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13205 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13206 static read-only fields in ctors.
13208 Applied patch from Benjamin Jemlich
13210 * expression.cs (UnaryMutator): Avoid leaking local variables.
13212 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13214 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13215 here to return true, as they can be used like this:
13217 (XXX) int.MEMBER ()
13219 Fixed 49836 and all the other dups
13221 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13223 * driver.cs: Implement /win32res and /win32icon.
13225 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13227 * cs-parser.jay: Add a rule to improve error handling for the
13228 common mistake of placing modifiers after the type.
13230 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13232 * cs-parser.jay (interface_event_declaration): Catch
13233 initialization of events on interfaces, and report cs0068
13235 * cs-parser.jay (interface_event_declaration): Catch
13236 initialization of events.
13238 * ecore.cs: Better report missing constructors.
13240 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13241 the error reporting done in the wrong place. Fix.
13243 * expression.cs (Binary.ResolveOperator): Catch the
13244 operator + (E x, E y) error earlier, and later allow for implicit
13245 conversions in operator +/- (E e, U x) from U to the underlying
13248 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13249 52596, if the container class is abstract, the default constructor
13250 is protected otherwise its public (before, we were always public).
13252 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13255 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13256 Jemlich that fixes bug #52597, MCS was generating invalid code for
13257 idisposable structs. Thanks to Ben for following up with this
13260 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13262 * driver.cs: Allow assemblies without code to be generated, fixes
13265 2004-01-07 Nick Drochak <ndrochak@gol.com>
13267 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13269 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13271 * cs-parser.jay: Add rules to improve error reporting if fields or
13272 methods are declared at the namespace level (error 116)
13274 * Add rules to catch event add/remove
13276 2004-01-04 David Sheldon <dave-mono@earth.li>
13278 * expression.cs: Added matching ")" to error message for
13281 2004-01-03 Todd Berman <tberman@gentoo.org>
13283 * ecore.cs, attribute.cs:
13284 Applying fix from #52429.
13286 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13288 * ecore.cs, expression.cs, statement.cs:
13289 Total rewrite of how we handle branching. We
13290 now handle complex boolean expressions with fewer
13291 jumps. As well if (x == 0) no longer emits a ceq.
13293 if (x is Foo) is much faster now, because we generate
13296 Overall, we get a pretty big improvement on our benchmark
13297 tests. The code we generate is smaller and more readable.
13299 I did a full two-stage bootstrap. The patch was reviewed
13300 by Martin and Miguel.
13302 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13304 * cs-parser.jay: Make primary_expression not take a QI.
13305 we dont need this because the member_access rule covers
13306 us here. So we replace the rule with just IDENTIFIER.
13308 This has two good effects. First, we remove a s/r conflict.
13309 Second, we allocate many fewer QualifiedIdentifier objects.
13311 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13313 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13314 set the correct information via SRE. This prevents
13315 hanging on the MS runtime. Fixes #29374.
13317 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13319 * convert.cs: correctly handle conversions to value types
13320 from Enum and ValueType as unboxing conversions.
13322 Fixes bug #52569. Patch by Benjamin Jemlich.
13324 2004-01-02 Ravi Pratap <ravi@ximian.com>
13326 * expression.cs (BetterConversion): Prefer int -> uint
13327 over int -> ulong (csc's behaviour). This fixed bug #52046.
13329 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13331 * decl.cs (MemberCache.FindMembers): now returns a
13334 * typemanager.cs: In general, go with with ^^.
13335 (CopyNewMethods): take an IList.
13336 (RealMemberLookup): Only allocate an arraylist
13337 if we copy from two sets of methods.
13339 This change basically does two things:
13340 1) Fewer array lists allocated due to CopyNewMethods.
13341 2) the explicit cast in MemberList costed ALOT.
13343 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13345 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13346 a hashtable to avoid needless string allocations when an identifier is
13347 used more than once (the common case).
13349 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13351 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13352 is broken, it will not return anything. So, we
13353 have to use the information we have in mcs to
13356 * typemanager.cs: Add a cache for GetInterfaces,
13357 since this will now be used more often (due to ^^)
13359 (GetExplicitInterfaces) New method that gets the
13360 declared, not effective, interfaces on a type
13361 builder (eg, if you have interface IFoo, interface
13362 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13365 This patch makes MCS able to bootstrap itself on
13368 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13370 * expression.cs: Remove the Nop's that Miguel put
13373 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13375 * report.cs, codegen.cs: Give the real stack trace to
13376 the error when an exception is thrown.
13378 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13380 * decl.cs: only allocate hashtables for ifaces if
13383 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13385 * expression.cs: fix the error from cs0121-2.cs
13386 (a parent interface has two child interfaces that
13387 have a function with the same name and 0 params
13388 and the function is called through the parent).
13390 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13392 * class.cs, rootcontext.cs, typmanager.cs: do not
13395 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13397 * codegen.cs: remove stack for the ec flow branching.
13398 It is already a linked list, so no need.
13400 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13402 * Makefile: Allow custom profiler here.
13404 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13406 * typemanager.cs (LookupType):
13407 - Use a static char [], because split takes
13408 a param array for args, so it was allocating
13410 - Do not store true in a hashtable, it boxes.
13412 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13414 * flowanalysis.cs: bytify common enums.
13416 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13418 * modifiers.cs: Add a new set of flags for the
13419 flags allowed on explicit interface impls.
13420 * cs-parser.jay: catch the use of modifiers in
13421 interfaces correctly.
13422 * class.cs: catch private void IFoo.Blah ().
13424 All related to bug #50572.
13426 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13428 * decl.cs: Rewrite the consistant accessability checking.
13429 Accessability is not linear, it must be implemented in
13430 a tableish way. Fixes #49704.
13432 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13434 * expression.cs: Handle negation in a checked context.
13435 We must use subtraction from zero. Fixes #38674.
13437 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13439 * class.cs: Ignore static void main in DLLs.
13440 * rootcontext.cs: Handle the target type here,
13441 since we are have to access it from class.cs
13442 * driver.cs: account for the above.
13444 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13446 * report.cs: Give line numbers and files if available.
13448 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13450 * driver.cs: Implement /addmodule.
13452 * typemanager.cs: Change 'modules' field so it now contains Modules not
13455 2003-12-20 Martin Baulig <martin@ximian.com>
13457 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13458 (FieldBase.IsAssigned): Removed this field.
13459 (FieldBase.SetAssigned): New public method.
13460 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13462 2003-12-20 Martin Baulig <martin@ximian.com>
13464 * expression.cs (LocalVariableReference.DoResolve): Don't set
13465 `vi.Used' if we're called from DoResolveLValue().
13467 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13468 returns the usage vector it just merged into the current one -
13469 pass this one to UsageWarning().
13470 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13471 of the `EmitContext', don't call this recursively on our children.
13473 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13475 * driver.cs: Implement /target:module.
13477 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13479 * support.cs (CharArrayHashtable): New helper class.
13481 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13482 char arrays, not strings, so we can avoid creating a string in
13483 consume_identifier if the identifier is a keyword.
13485 2003-12-16 Martin Baulig <martin@ximian.com>
13487 * statement.cs (LocalInfo.Assigned): Removed this property.
13488 (LocalInfo.Flags): Removed `Assigned'.
13489 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13490 and uses flow analysis.
13491 (Block.UsageWarning): Made this method private.
13492 (Block.Resolve): Call UsageWarning() if appropriate.
13494 * expression.cs (LocalVariableReference.DoResolve): Always set
13495 LocalInfo.Used here.
13497 2003-12-13 Martin Baulig <martin@ximian.com>
13499 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13500 any value here; we're now using flow analysis to figure out
13501 whether a statement/block returns a value.
13503 2003-12-13 Martin Baulig <martin@ximian.com>
13505 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13507 (FlowBranching.MergeFinally): Don't call
13508 `branching.CheckOutParameters()' here, this is called in
13510 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13511 when adding the `finally' vector.
13513 2003-12-13 Martin Baulig <martin@ximian.com>
13516 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13517 actually work and also fix #48962.
13519 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13521 * decl.cs: Do not check System.Object for nested types,
13522 since we know it does not have any. Big bang for buck:
13525 Run 1: 8.35 seconds
13526 Run 2: 8.32 seconds
13527 corlib: 17.99 seconds
13529 Run 1: 8.17 seconds
13530 Run 2: 8.17 seconds
13531 corlib: 17.39 seconds
13533 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13535 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13536 time we are returning 0 members, so we save alot here.
13538 2003-12-11 Martin Baulig <martin@ximian.com>
13540 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13541 `MergeChild()', also just take the `FlowBranching' as argument;
13542 call Merge() on it and return the result.
13543 (FlowBranching.Merge): We don't need to do anything if we just
13546 2003-12-11 Martin Baulig <martin@ximian.com>
13548 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13549 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13550 Maurer for this idea.
13552 2003-12-11 Martin Baulig <martin@ximian.com>
13554 * flowanalysis.cs (MergeResult): This class is now gone; we now
13555 use the `UsageVector' for this. The reason for this is that if a
13556 branching just has one sibling, we don't need to "merge" them at
13557 all - that's the next step to do.
13558 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13561 2003-12-11 Martin Baulig <martin@ximian.com>
13563 Reworked flow analyis and made it more precise and bug-free. The
13564 most important change is that we're now using a special `Reachability'
13565 class instead of having "magic" meanings of `FlowReturns'. I'll
13566 do some more cleanups and optimizations and also add some more
13567 documentation this week.
13569 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13570 largely reworked this class.
13571 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13572 the new `Reachability' class instead of having "magic" values here.
13573 (FlowBranching): We're now using an instance of `Reachability'
13574 instead of having separate `Returns', `Breaks' etc. fields.
13576 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13577 based on flow analysis; ignore the return value of block.Emit ().
13579 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13581 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13582 if they are private.
13584 2003-12-09 Martin Baulig <martin@ximian.com>
13586 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13587 call them directly on the UsageVector.
13589 2003-12-09 Martin Baulig <martin@ximian.com>
13591 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13592 Changed return type from `FlowReturns' to `Reachability'.
13594 2003-12-09 Martin Baulig <martin@ximian.com>
13596 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13597 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13598 `Reachable' fields with a single `Reachability' one.
13600 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13602 * class.cs (FindMembers): Remove foreach's.
13607 Run 1: 8.74 seconds
13608 Run 2: 8.71 seconds
13611 Run 1: 8.64 seconds
13612 Run 2: 8.58 seconds
13615 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13620 This patch does a few things:
13621 1. EmptyStatement is now a singleton, so it is never reallocated.
13622 2. All blah is EmptyStatement constructs have been changed to
13623 blah == EmptyStatement.Value, which is much faster and valid
13624 now that EmptyStatement is a singleton.
13625 3. When resolving a block, rather than allocating a new array for
13626 the non-empty statements, empty statements are replaced with
13627 EmptyStatement.Value
13628 4. Some recursive functions have been made non-recursive.
13629 Mainly the performance impact is from (3), however (1) and (2) are needed for
13630 this to work. (4) does not make a big difference in normal situations, however
13631 it makes the profile look saner.
13636 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13637 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13638 Total memory allocated: 56397 KB
13641 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13642 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13643 Total memory allocated: 55666 KB
13645 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13647 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13648 than the hashtable in a hashtable version
13650 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13651 we always end up concating a string. This results in a huge perf
13652 loss, because many strings have to be tracked by the GC. In this
13653 patch, we first use a hashtable that works with two keys, so that
13654 the strings do not need to be concat'ed.
13658 Run 1: 8.74 seconds
13659 Run 2: 8.71 seconds
13662 Run 1: 8.65 seconds
13663 Run 2: 8.56 seconds
13665 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13667 * Makefile: Add a new target `do-time' that does a quick and simple
13668 profile, leaving easy to parse output.
13670 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13672 * codegen.cs (Init): Create the dynamic assembly with
13673 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13675 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13677 * support.cs: Make the PtrHashtable use only one
13678 instance of its comparer.
13680 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13682 * typemanager.cs: Fix lookup of GetNamespaces.
13684 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13686 * expression.cs: Removed redundant line.
13688 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13689 ArrayLists, use for loops with bounds.
13691 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13694 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13695 arraylists, use for loop with bounds.
13697 The above three changes give us a 0.071 second performance
13698 improvement out of 3.294 seconds down to 3.223. On my machine
13699 the above changes reduced the memory usage by 1,387 KB during
13700 compiler bootstrap.
13702 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13703 QualifiedIdentifiers. Before we created a new string through
13704 concatenation, and mostly later on, the result would be
13705 manipulated by DecomposeQI through string manipulation.
13707 This reduced the compiler memory usage for bootstrapping from
13708 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13709 compile times in 0.05 seconds.
13711 2003-11-28 Dick Porter <dick@ximian.com>
13713 * support.cs: Do string compares with the Invariant culture.
13721 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13722 the comparison is done with the Invariant culture.
13724 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13726 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13727 GetEnumerator method.
13729 (ProbeCollectionType): Iterate starting at the most specific type
13730 upwards looking for a GetEnumerator
13732 * expression.cs: Shift count can be up to 31 for int/uint and 63
13735 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13737 * statement.cs (Block.LookupLabel): Also look for the label on the
13738 children blocks. Use a hash table to keep track of visited
13741 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13742 we actually did transform the other operand, otherwise fall back
13743 to the common codepath that casts to long.
13745 * cs-tokenizer.cs: Use the same code pattern as the int case.
13746 Maybe I should do the parsing myself, and avoid depending on the
13747 Parse routines to get this done.
13749 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13751 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13752 which fixes bug 51347. This time test it.
13754 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13755 attributes for example can not tell the difference between these.
13756 The difference was only a syntax feature of the language.
13758 * attribute.cs: Apply attributes to delegates.
13760 * delegate.cs: Call the apply attributes method.
13762 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13764 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13765 comparing 0 vs Byte.MinValue, not the value
13767 (ImplicitConversionRequired): When reporting a conversion error,
13768 use error 31 to print out the constant error instead of the
13771 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13772 which fixes bug 51347.
13774 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13776 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13777 which fixes the -warnaserror command line option.
13779 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13781 * cfold.cs (DoNumericPromotions): During constant folding of
13782 additions on UIntConstant, special case intconstants with
13783 IntConstants like we do on the expression binary operator.
13785 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13787 * convert.cs (ImplicitReferenceConversion): We were missing a case
13788 (System.Enum are not value types or class types, so we need to
13789 classify them separatedly).
13791 * driver.cs: We do not support error 2007.
13793 2003-11-12 Jackson Harper <jackson@ximian.com>
13795 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13796 system directory. Also use the full file name so users can
13797 libraries names mscorlib-o-tron.dll in a non system dir.
13799 2004-01-04 David Sheldon <dave-mono@earth.li>
13801 * expression.cs: Added matching ")" to error message for CS0077.
13803 2003-12-19 Martin Baulig <martin@ximian.com>
13805 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13806 static method; see documentation in the method.
13807 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13809 * convert.cs (Convert.ImplicitReferenceConversion,
13810 Convert.ImplicitReferenceConversionExists): Add support for
13811 generic type declarations; see gen-36.cs.
13813 2003-12-19 Martin Baulig <martin@ximian.com>
13815 * pending.cs (Pending.InterfaceMethod): Use
13816 `Type.IsAssignableFrom()' instead of `=='.
13818 2003-12-18 Martin Baulig <martin@ximian.com>
13820 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13823 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13824 `expr_type.Equals (target_type)' instead of `=='.
13826 2003-12-08 Martin Baulig <martin@ximian.com>
13828 * generics.cs (Constraints.Types): Removed.
13829 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13831 (Constraints.ResolveTypes): New public method; resolves the
13832 TypeExpr's to Type's.
13833 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13834 longer takes the constraints.
13835 (TypeParameter.DefineMethod): Likewise.
13836 (TypeParameter.DefineType): New public method. Calls
13837 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13840 2003-12-08 Martin Baulig <martin@ximian.com>
13842 * convert.cs (Convert.ImplicitConversionStandard): Use
13843 `expr_type.Equals (target_type)' instead of `=='.
13845 2003-12-08 Martin Baulig <martin@ximian.com>
13847 * typemanager.cs (TypeManager.GetReferenceType): Call
13848 `Type.MakeByRefType ()'.
13850 2003-12-08 Martin Baulig <martin@ximian.com>
13852 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13853 just has some special meaning in some situations. For instance,
13854 it is allowed to use `where' as the name of a variable etc.
13856 2003-12-04 Martin Baulig <martin@ximian.com>
13858 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13859 `Type.MakeArrayType()' for array types.
13861 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13863 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13866 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13869 2003-11-16 Martin Baulig <martin@ximian.com>
13871 * codegen.cs (EmitContext.IsGeneric): Removed.
13873 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13874 ResolveGeneric() on the DeclSpace.
13876 2003-11-16 Martin Baulig <martin@ximian.com>
13878 * generic.cs (TypeArguments.Resolve):
13879 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13880 `ResolveType()' on it to get the Type.
13882 2003-11-15 Martin Baulig <martin@ximian.com>
13884 * generic.cs (ConstructedType.GetInterfaces): Override this.
13886 2003-11-14 Martin Baulig <martin@ximian.com>
13888 * interface.cs (Interface.DefineType): Define all type parameters
13889 before adding the interfaces we inherit.
13891 2003-11-11 Martin Baulig <martin@ximian.com>
13893 * generic.cs (ConstructedType.ResolveType): Always call
13894 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13896 2003-11-10 Martin Baulig <martin@ximian.com>
13898 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13899 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13900 calling `ResolveType()' on them, directly assign their `Type'.
13902 2003-11-08 Martin Baulig <martin@ximian.com>
13904 * generic.cs (ConstructedType): Override `IsClass' etc.
13906 2003-11-08 Martin Baulig <martin@ximian.com>
13908 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13909 return value and the `out parent' parameter.
13910 (TypeContainer.DefineType): Moved the CS0644 check into
13911 GetClassBases(). Don't pass the interface types to the
13912 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13913 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13915 * ecore.cs (TypeExpr.IsAttribute): New property.
13916 (TypeExpr.GetInterfaces): New method.
13918 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13919 TypeExpr instead of a Type.
13920 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13921 (Interface.DefineType): Don't pass the interface types to the
13922 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13923 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13925 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13926 instead of a `Type[]'.
13927 (TypeManager.RegisterBuilder): Likewise.
13928 (TypeManager.AddUserInterface): Likewise.
13929 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13930 `Type[]' and also return a `TypeExpr[]'.
13931 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13933 2003-11-08 Martin Baulig <martin@ximian.com>
13935 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13938 2003-11-08 Martin Baulig <martin@ximian.com>
13940 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13941 TypeManager.ResolveExpressionTypes().
13943 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13944 instead of an Expression.
13945 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13946 (TypeExpression): New public class; formerly known as `TypeExpr'.
13948 * expression.cs (ComposedCast): Derive from TypeExpr.
13950 * typemanager.cs (TypeManager.system_*_expr): These are now
13951 TypExpr's instead of Expression's.
13952 (TypeManager.ResolveExpressionTypes): New public static function;
13953 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13956 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13958 * expression.cs (New.DoResolve): Do not dereference value that
13959 might be a null return.
13961 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13962 sure that the constant value has the right type. Fixes an
13963 unreported bug, similar to 50425.
13965 * const.cs (Const.LookupConstantValue): Call
13966 ImplicitStandardConversionExists before doing a conversion to
13967 avoid havng the TypeManager.ChangeType do conversions.
13969 Reduced the number of casts used
13971 (Const.ChangeType): New routine to enable reuse of the constant
13972 type changing code from statement.
13974 * typemanager.cs (ChangeType): Move common initialization to
13975 static global variables.
13979 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13980 every value type to go through, even if it was void. Fix that.
13982 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13983 character of the define, and the is_identifier_part_character for
13984 the rest of the string.
13986 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13988 * expression.cs (UnaryMutator.EmitCode): When I updated
13989 LocalVariableReference.DoResolve, I overdid it, and dropped an
13990 optimization done on local variable references.
13992 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13994 * ecore.cs: Convert the return from Ldlen into an int.
13996 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13998 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13999 the accessibility, this is a special case for toplevel non-public
14000 classes (internal for instance).
14002 2003-10-20 Nick Drochak <ndrochak@gol.com>
14004 * ecore.cs: Fix typo and build. Needed another right paren.
14006 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14008 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14009 `internal' case regular and protected, but not allowing protected
14010 to be evaluated later. Bug 49840
14012 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14014 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14015 to kb.Nlast, and not the kb.nFirst to isolate the switch
14018 Extract the underlying type, so enumerations of long/ulong are
14019 treated like long/ulong.
14021 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14023 * expression.cs (New): Overload the meaning of RequestedType to
14024 track the possible creation of the NewDelegate type, since
14025 DoResolve is invoked more than once for new constructors on field
14028 See bugs: #48800 and #37014
14030 * cs-parser.jay (declare_local_constants): Take an arraylist
14031 instead of a single constant.
14033 (local_constant_declaration): It should take a
14034 constant_declarators, not a constant_declarator. Fixes 49487
14036 * convert.cs: Fix error report.
14038 2003-10-13 Jackson Harper <jackson@ximian.com>
14040 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14043 2003-11-03 Martin Baulig <martin@ximian.com>
14045 * expression.cs (ArrayAccess.GetStoreOpcode): Added
14046 `out bool has_type_arg'; if set, we need to pass the type to
14048 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14049 Stelem_Any/Ldelem_Any for generic parameters.
14051 2003-11-02 Martin Baulig <martin@ximian.com>
14053 * expression.cs (Invocation.EmitCall): Use
14054 `TypeManager.IsValueType()' to check whether it's a value type.
14055 Don't set `struct_call' when calling a method on a type parameter.
14057 2003-11-02 Martin Baulig <martin@ximian.com>
14059 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14060 and removed the TypeBuilder argument.
14062 * typemanager.cs (TypeManager.IsValueType): Return
14063 `t.IsGenericParameter || t.IsValueType'.
14065 2003-10-25 Martin Baulig <martin@ximian.com>
14067 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14068 call ConstructedType.Resolve() on it.
14070 * generic.cs (ConstructedType.Resolve): Set `type' on success.
14072 2003-10-25 Martin Baulig <martin@ximian.com>
14074 * class.cs (TypeContainer.GetClassBases): Changed
14075 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
14076 CS8214 reporting here.
14077 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14078 instead of a `Type' for our parent. In case of a recursive
14079 declaration (see tests/gen-23.cs for an example), our parent is a
14080 ConstructedType and it doesn't have its type set. So, first
14081 create our own TypeBuilder, then call constructed.Resolve() to get
14082 the parent's type and finally TypeBuilder.SetParent() it.
14084 * ecore.cs (TypeExpr.Name): New public virtual property.
14087 (ConstructedType): We're now a TypeExpr and not just an Expression.
14088 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14089 arguments here; this is done later.
14090 (ConstructedType.Resolve): New public method to resolve the type
14091 arguments and bind them.
14093 2003-10-21 Martin Baulig <martin@ximian.com>
14095 * convert.cs: Use `TypeManager.IsValueType' instead of
14096 'type.IsValueType' everywhere.
14098 * typemanager.cs (TypeManager.IsValueType): Return true for type
14099 parameters. The reason for this is that we need to box a type
14100 parameter when converting it to a reference type.
14102 * cs-parser.jay: Added support for default value expressions.
14104 * generics.cs (DefaultValueExpression): New public class.
14106 2003-10-17 Martin Baulig <martin@ximian.com>
14108 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14109 TypeContainer so we can also use this for Interfaces.
14110 (TypeParameter.Resolve): Likewise.
14112 * interface.cs (Interface.DefineType): Added support for generic
14115 * cs-parser.jay: Added support for generic structs and interfaces.
14117 2003-10-17 Martin Baulig <martin@ximian.com>
14119 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14120 call generic methods :-)
14122 2003-10-16 Martin Baulig <martin@ximian.com>
14124 * cs-parser.jay (namespace_or_type_name): Only create a
14125 GenericMemberAccess if we actually have type arguments.
14127 2003-10-13 Martin Baulig <martin@ximian.com>
14129 * class.cs (Method.Define): If we're a generic method, call
14130 TypeBuilder.DefineGenericMethod () before resolving
14132 (MethodData): Added .ctor which takes an additional MethodBuilder
14133 argument; this is used for generic methods.
14134 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14135 we already have a MethodBuilder.
14137 2003-10-10 Martin Baulig <martin@ximian.com>
14139 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14140 instead of a `DeclSpace'. This is used for generic methods.
14142 * cs-parser.jay (method_header): Added support for generic
14143 methods; create a `GenericMethod' instance and pass it to the
14144 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14145 parameters and locals.
14147 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14148 since we already have the location. Check whether we're a generic
14149 type declaration or a generic method and create the correct type
14152 * generic.cs (TypeParameter.DefineMethod): New public method.
14153 (GenericMethod): New public class; derives from DeclSpace and is
14154 used for generic methods.
14156 2003-10-09 Martin Baulig <martin@ximian.com>
14158 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14160 (MethodCore.DoDefineParameters): Removed the TypeContainer
14161 argument; use the DeclSpace which was passed to the .ctor instead.
14162 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14163 TypeContainer; we only need a DeclSpace here.
14165 2003-10-09 Martin Baulig <martin@ximian.com>
14167 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14169 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14170 EmitContext's .ctor.
14172 2003-10-09 Martin Baulig <martin@ximian.com>
14174 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14175 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14176 AsAccessible(), moved them as well.
14178 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14180 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14182 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14183 generation for >=, as spotted by Paolo, bug 48679.
14184 Patch from David Waite.
14186 * cs-tokenizer.cs: Add handling for #pragma.
14188 * cs-parser.jay: Allow for both yield and yield return in the
14189 syntax. The anti-cobolization of C# fight will go on!
14191 * class.cs (TypeBuilder.DefineType): Catch error condition here
14192 (Parent.DefineType erroring out and returning null).
14194 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14195 coping with enumerations variables, we were mistakenly processing
14196 them as a regular value type instead of built-in types. Fixes the
14199 * typemanager.cs (IsBuiltinOrEnum): New method.
14201 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14203 * cs-parser.jay: Upgrade: yield now needs the return clause.
14205 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14207 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14209 2003-09-29 Martin Baulig <martin@ximian.com>
14211 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14212 inflated generic methods.
14214 * generics.cs (ConstructedType): Distinguish between open and
14215 closed constructed types; correctly resolve the arguments.
14217 2003-09-22 Martin Baulig <martin@ximian.com>
14219 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14220 all type arguments meet their constraints.
14222 2003-09-19 Martin Baulig <martin@ximian.com>
14224 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14225 `MemberCache parent' argument. Normally, an interface doesn't
14226 have a parent type except System.Object, but we use this in gmcs
14227 for generic type parameters.
14229 2003-09-18 Martin Baulig <martin@ximian.com>
14231 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14232 on `type.IsInterface'; don't check whether the type has a parent
14233 to determine whether it's an interface.
14235 2003-09-17 Martin Baulig <martin@ximian.com>
14237 * generic.cs (ConstructedType.ToString): Always use `name' as the
14240 2003-09-15 Martin Baulig <martin@ximian.com>
14242 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14244 * generic.cs (Constraints.Resolve): New public method; this is
14245 called to resolve the constraint types and to check whether all
14246 the constraints are correct.
14247 (Constraints.Types): New public property.
14248 (TypeParameter.Resolve): New public method; resolves all the
14249 type's constraints.
14251 * class.cs (TypeContainer.DefineType): Call
14252 TypeParameter.Resolve() before actually defining the type.
14254 2003-09-15 Martin Baulig <martin@ximian.com>
14256 * class.cs (TypeContainer.DefineType): Added an error flag to
14257 avoid reporting duplicate CS0146's ("class definition is
14260 * driver.cs (Driver.MainDriver): Abort if
14261 RootContext.ResolveTree() reported any errors.
14263 2003-09-07 Martin Baulig <martin@ximian.com>
14265 * report.cs (Error, Warning): Added overloaded versions which take
14266 a `params object[] args' and call String.Format().
14268 2003-09-07 Martin Baulig <martin@ximian.com>
14270 * decl.cs (DeclSpace..ctor): Don't call
14271 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14272 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14273 (DeclSpace.RecordDecl): New method.
14275 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14277 2003-09-02 Ravi Pratap <ravi@ximian.com>
14279 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14280 value attributes to be applied to ParameterBuilders.
14282 * class.cs (MethodCore.LabelParameters): Make static and more
14283 generic so that it can be used from other places - like interface
14284 methods, for instance.
14286 * interface.cs (Interface.Emit): Call LabelParameters before
14287 emitting attributes on the InterfaceMethod.
14289 2003-09-07 Martin Baulig <martin@ximian.com>
14291 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14292 if the number of type parameters doesn't match.
14294 2003-09-04 Martin Baulig <martin@ximian.com>
14296 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14297 for arrays of generic type params (ie. `!0[]').
14299 2003-09-04 Martin Baulig <martin@ximian.com>
14301 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14304 2003-09-04 Martin Baulig <martin@ximian.com>
14306 * decl.cs (DeclSpace.LookupGeneric): New method.
14307 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14310 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14311 argument, not just a string.
14312 (TypeParameter.Define): New public method; this is called to
14313 actually define the generic parameter; after this, you can use the
14314 new `Type' property to get the type.
14316 2003-09-04 Martin Baulig <martin@ximian.com>
14318 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14319 is now an ArrayList; initialize the result of the `TypeParameters'
14321 (DeclSpace.GetGenericData): Removed.
14322 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14323 implement this in a different way.
14324 (DeclSpace.GetTypeParameters): Removed; there's now a
14325 `TypeParameters' property.
14326 (DeclSpace.TypeParameters): New public property.
14328 * generic.cs (Constraints): Make this class public.
14329 (TypeParameter): New public class.
14331 2003-09-04 Martin Baulig <martin@ximian.com>
14333 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14334 generic parameters.
14336 * class.cs (TypeContainer.DefineType): Call
14337 TypeBuilder.DefineGenericParameter () on all generic parameters if
14338 this is a generic type.
14340 2003-08-28 Martin Baulig <martin@ximian.com>
14342 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14345 * sample-hello.cs: Compile this with gmcs: "gmcs
14346 /r:sample-stack.dll sample-hello.cs".
14348 2003-08-28 Martin Baulig <martin@ximian.com>
14350 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14351 the parameters to the generic type.
14353 2003-08-28 Martin Baulig <martin@ximian.com>
14355 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14357 2003-08-28 Martin Baulig <martin@ximian.com>
14359 * cs-parser.jay (opt_type_argument_list): Use
14360 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14361 (primary_expression): Replace `qualified_identifier' with `type_name'.
14362 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14364 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14365 parser to check whether it is syntactically a type parameter list;
14366 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14369 2003-08-26 Martin Baulig <martin@ximian.com>
14371 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14372 resolving aliases; fixes #47927.
14374 2003-08-26 Martin Baulig <martin@ximian.com>
14376 * statement.cs (Using.DoResolve): This is internally emitting a
14377 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14378 do not always return. Fixes #47681.
14380 2003-08-26 Martin Baulig <martin@ximian.com>
14382 * decl.cs (MemberCore): Moved WarningNotHiding(),
14383 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14385 (AdditionResult): Make this nested in DeclSpace.
14386 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14387 argument; call NamespaceEntry.Define() unless we're nested in a
14390 * namespace.cs (Namespace.DefineName): New public function. This
14391 is called from DeclSpace's .ctor to add
14392 (Namespace.Lookup): Include DeclSpaces in the lookup.
14394 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14396 * const.cs (Const): Derive from MemberBase, not MemberCore.
14398 2003-08-25 Martin Baulig <martin@ximian.com>
14400 * convert.cs (Convert.ExplicitReferenceConversion): When
14401 converting from an interface type to a class, unbox if the target
14402 type is a struct type. Fixes #47822.
14404 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14406 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14409 2003-08-22 Martin Baulig <martin@ximian.com>
14411 * class.cs (TypeManager.DefineType): When defining a nested type,
14412 call DefineType() on our parent; fixes #47801.
14414 2003-08-22 Martin Baulig <martin@ximian.com>
14416 * class.cs (MethodData.Define): While checking if a method is an
14417 interface implementation, improve the test a bit more to fix #47654.
14419 2003-08-22 Martin Baulig <martin@ximian.com>
14421 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14422 correctly; fixes #47722.
14424 2003-08-22 Martin Baulig <martin@ximian.com>
14426 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14427 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14429 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14431 2003-08-22 Martin Baulig <martin@ximian.com>
14433 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14434 can only be assigned in static constructors. Fixes #47161.
14436 2003-08-22 Martin Baulig <martin@ximian.com>
14438 Rewrote and improved the flow analysis code.
14440 * flowbranching.cs (FlowBranching): Make this class abstract.
14441 (FlowBranching.CreateBranching): New static function to create a
14442 new flow branching.
14443 (FlowBranchingBlock, FlowBranchingException): New classes.
14444 (FlowBranching.UsageVector.Type): New public readonly field.
14445 (FlowBranching.UsageVector.Breaks): Removed the setter.
14446 (FlowBranching.UsageVector.Returns): Removed the setter.
14447 (FlowBranching.UsageVector): Added Break(), Return(),
14448 NeverReachable() and Throw() methods to modify the reachability.
14449 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14450 done by FlowBranching.Merge().
14451 (FlowBranching.UsageVector.MergeChild): New method; merges the
14452 merge result into the current vector.
14453 (FlowBranching.Merge): New abstract method to merge a branching.
14455 2003-08-12 Martin Baulig <martin@ximian.com>
14457 * expression.cs (Indirection.CacheTemporaries): Create the
14458 LocalTemporary with the pointer type, not its element type.
14460 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14462 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14463 token was a keyword or not.
14465 Add `error' options where an IDENTIFIER was expected; Provide
14466 CheckToken and CheckIdentifierToken convenience error reporting
14469 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14471 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14472 NameSpaceEntry NameSpaceEntry.
14474 (LookupInterfaceOrClass): Avoid creating a full qualified name
14475 from namespace and name: avoid doing lookups when we know the
14476 namespace is non-existant. Use new Tree.LookupByNamespace which
14477 looks up DeclSpaces based on their namespace, name pair.
14479 * driver.cs: Provide a new `parser verbose' to display the
14480 exception thrown during parsing. This is turned off by default
14481 now, so the output of a failure from mcs is more graceful.
14483 * namespace.cs: Track all the namespaces defined in a hashtable
14486 (IsNamespace): New method
14488 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14490 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14491 we know that we need to concatenate (full typename can never be
14496 * statement.cs: Use a bitfield; Do not initialize to null things
14497 which are done by the constructor by default.
14499 * cs-parser.jay: bug fix, parameter was 4, not 3.
14501 * expression.cs: Just use the property;
14503 * statement.cs: No need for GetVariableInfo method.
14505 2003-08-08 Martin Baulig <martin@ximian.com>
14507 * flowanalysis.cs (FlowReturns): This is now nested in the
14508 `FlowBranching' class.
14509 (MyBitVector): Moved this here from statement.cs.
14510 (FlowBranching.SiblingType): New enum type.
14511 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14513 2003-08-07 Martin Baulig <martin@ximian.com>
14515 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14516 `FlowBranching' class and called `BranchingType'.
14518 2003-08-07 Martin Baulig <martin@ximian.com>
14520 * flowanalysis.cs: Moved all the control flow analysis code into
14523 2003-08-07 Martin Baulig <martin@ximian.com>
14525 * assign.cs (Assign.DoResolve): `target' must either be an
14526 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14529 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14531 * expression.cs (BinaryMethod): This kind of expression is created by the
14532 Binary class if it determines that the operator has to be handled
14535 (BinaryDelegate): This kind of expression is created if we are
14536 dealing with a + or - operator on delegates.
14538 (Binary): remove method, argumetns, and DelegateOperator: when
14539 dealing with methods,
14541 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14543 * statement.cs (Block): use bitfields for the three extra booleans
14544 we had in use. Remove unused topblock parameter.
14546 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14548 * assign.cs: Drop extra unneeded tests.
14550 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14552 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14554 * statement.cs (Foreach): Use VariableStorage instead of
14557 * codegen.cs (VariableStorage): New class used by clients that
14558 require a variable stored: locals or fields for variables that
14559 need to live across yield.
14561 Maybe provide a convenience api for EmitThis+EmitLoad?
14563 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14566 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14568 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14569 RemapParameterLValue): New methods that are used to turn a
14570 precomputed FieldInfo into an expression like this:
14574 The idea is to use this instead of making LocalVariableReference
14575 have more than one meaning.
14577 * cs-parser.jay: Add error production to BASE.
14579 * ecore.cs: Deal with TypeManager.GetField returning null, which
14580 is now a valid return value.
14582 (FieldExprNoAddress): New expression for Fields whose address can
14585 * expression.cs (LocalVariableReference): During the resolve
14586 phases, create new expressions if we are in a remapping context.
14587 Remove code that dealt with remapping here.
14589 (ParameterReference): same.
14591 (ProxyInstance): New expression, like the `This' expression, but
14592 it is born fully resolved. We know what we are doing, so remove
14593 the errors that are targeted to user-provided uses of `this'.
14595 * statement.cs (Foreach): our variable is now stored as an
14596 Expression; During resolution, follow the protocol, dont just
14597 assume it will return this.
14599 2003-08-06 Martin Baulig <martin@ximian.com>
14601 * support.cs (SeekableStreamReader.cs): New public class.
14603 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14604 SeekableStreamReader instead of the normal StreamReader.
14606 2003-08-04 Martin Baulig <martin@ximian.com>
14608 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14609 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14610 deambiguate casts and delegate invocations.
14611 (parenthesized_expression): Use the new tokens to ensure this is
14612 not a cast of method invocation.
14614 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14615 when reading a `)' and Deambiguate_CloseParens () was previously
14618 * expression.cs (ParenthesizedExpression): New class. This is
14619 just used for the CS0075 test.
14620 (Binary.DoResolve): Check for CS0075.
14622 2003-07-29 Ravi Pratap <ravi@ximian.com>
14624 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14625 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14626 reference comparison.
14628 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14629 examine the ReturnType for equality - this is necessary in the
14630 cases of implicit and explicit operators whose signature also
14631 includes the return type.
14633 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14635 * namespace.cs: Cache the result of the namespace computation,
14636 instead of computing it every time.
14638 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14640 * decl.cs: Use a global arraylist that we reuse over invocations
14641 to avoid excesive memory consumption. Reduces memory usage on an
14642 mcs compile by one meg (45 average).
14644 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14645 private, work around that.
14647 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14649 * literal.cs (IntLiteral): Define Zero and One static literals.
14651 * cs-parser.jay (integer_literal): use static literals to reduce
14652 memory usage for the most used literals (0, 1 and -1). 211kb
14653 reduced in memory usage.
14655 Replace all calls to `new ArrayList' with `new
14656 ArrayList(4)' which is a good average number for most allocations,
14657 and also requires only 16 bytes of memory for its buffer by
14660 This reduced MCS memory usage in seven megabytes for the RSS after
14663 2003-07-28 Ravi Pratap <ravi@ximian.com>
14665 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14666 handle params methods the correct way by forming only one
14667 applicable set with params and normal methods in them. Earlier we
14668 were looking at params methods only if we found no normal methods
14669 which was not the correct thing to do.
14671 (Invocation.BetterFunction): Take separate arguments indicating
14672 when candidate and the best method are params methods in their
14675 This fixes bugs #43367 and #46199.
14677 * attribute.cs: Documentation updates.
14679 (CheckAttribute): Rename to CheckAttributeTarget.
14680 (GetValidPlaces): Rename to GetValidTargets.
14682 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14683 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14687 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14689 * codegen.cs: Compute IsGeneric correctly.
14691 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14694 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14695 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14696 regressions, and I was chasing more bugs than I required.
14698 * interface.cs: Use expressions for base type names (like classes
14699 and structs have been doing for a while now), and resolve that.
14700 This patch should probably go into head as well.
14702 This makes it one less user of FindType.
14704 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14706 This compiler can not self host currently. Need to fix that.
14708 * Makefile: compile to `gmcs.exe'
14710 * driver.cs: Turn on v2 by default on gmcs.
14712 * generic.cs (ConstructedType): Does no longer take a container
14713 type argument; That will be taken care of later.
14715 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14716 Use SimpleName to resolve for now, so we can continue the work on
14717 the parser, until we get Type.GetType that understands generics.
14719 (ConstructedType.ToString): Implement
14721 (TypeArguments.Resolve): Resolve the child expressions as types.
14723 * cs-parser.jay: Rename interface_constraints to
14724 type_parameter_constraints
14726 (namespace_or_type_name): Only use constructed types for the basic
14727 construction, we will deal with identifier<...> later.
14729 (type/type_name): No longer call DecomposeQI, as
14730 namespace_or_type_name is always decoded now.
14732 2003-07-22 Ravi Pratap <ravi@ximian.com>
14734 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14735 closely: we eliminate methods in base types when we have an
14736 applicable method in a top-level type.
14738 Please see section 14.5.5.1 for an exact description of what goes
14741 This fixes bug #45127 and a host of other related to corlib compilation.
14743 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14744 array is the method corresponding to the top-level type (this is
14745 because of the changes made to icall.c) so we change this
14748 (MethodGroupExpr.Name): This too.
14750 * typemanager.cs (GetElementType): New method which does the right
14751 thing when compiling corlib.
14753 * everywhere: Make use of the above in the relevant places.
14755 2003-07-22 Martin Baulig <martin@ximian.com>
14757 * cs-parser.jay (invocation_expression): Moved
14758 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14759 `cast_expression', but create a InvocationOrCast which later
14760 resolves to either an Invocation or a Cast.
14762 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14763 method; call this before EmitStatement() to make sure that this
14764 expression can be used as a statement.
14766 * expression.cs (InvocationOrCast): New class; resolves to either
14767 an Invocation or a Cast.
14769 * statement.cs (StatementExpression): Call ResolveStatement() on
14770 the ExpressionStatement before emitting it.
14772 2003-07-21 Martin Baulig <martin@ximian.com>
14774 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14775 `ref' and `out' attributes match; fixes #46220.
14776 (MemberAccess.ResolveMemberAccess): You can't reference a type
14777 through an expression; fixes #33180.
14778 (Indexers.GetIndexersForType): Don't return the indexers from
14779 interfaces the class implements; fixes #46502.
14781 2003-07-21 Martin Baulig <martin@ximian.com>
14783 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14784 CS0661 checks; fixes bug #30442.
14786 2003-07-21 Martin Baulig <martin@ximian.com>
14788 * decl.cs (AdditionResult): Added `Error'.
14790 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14792 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14793 cs0031.cs actually work.
14795 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14797 * cs-parser.jay (namespace_name): do not use
14798 namespace_or_type_name, use qualified_identifier, because
14799 namespace_or_type_name will soon return a composed expression
14800 instead of a string.
14802 (namespace_or_type_name): Instead of returning a string, now this
14803 production returns an expression.
14805 * codegen.cs (EmitContext): Setup IsGeneric property based on
14806 whether our DeclSpace is generic, our the method is generic.
14808 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14809 the method is generic.
14811 * cs-parser.jay (type_arguments, opt_type_argument_list,
14812 type_parameters, type_parameter_list, opt_type_parameter_list,
14813 type_parameter,, opt_type_parameter_constraints_clauses,
14814 type_parameter_constraints_clauses,
14815 type_parameter_constraint_clause, type_parameter_constraint,
14816 interface_constraints): Add new production
14818 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14819 DeclSpace is generic or not.
14821 (DeclSpace.SetParameterInfo): New routine, used to set the
14822 parameter info for a type.
14824 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14825 returns a GenericTypeExpr
14827 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14828 generic, lookup the generic argument.
14830 * attribute.cs: Do not allow TypeParameterExpressions in
14833 * class.cs: Do not allow the Main method to be defined in a
14836 * expression.cs (SizeOf): Do not allow generic types to be used as
14837 arguments to sizeof.
14839 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14840 it: whether a type is generic or not. Only works for types we are
14841 currently building for now.
14843 2003-07-20 Martin Baulig <martin@ximian.com>
14845 * namespace.cs: Fixed that bug which caused a crash when compiling
14846 the debugger's GUI.
14848 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14850 * typemanager.cs (LookupTypeReflection): Never expose types which
14851 are NotPublic, NestedPrivate, NestedAssembly, or
14852 NestedFamANDAssem. We used to return these, and later do a check
14853 that would report a meaningful error, but the problem is that we
14854 would not get the real match, if there was a name override.
14856 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14858 * namespace.cs (Namespace, Name): Do not compute the namespace
14859 name dynamically, compute it in the constructor. This reduced
14860 memory usage by 1697 KB.
14862 * driver.cs: Use --pause to pause at the end.
14864 2003-07-17 Peter Williams <peter@newton.cx>
14866 * Makefile: Change the name of the test target so that it doesn't
14867 conflict with the recursive test target.
14869 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14871 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14872 AddressOf): Do not use EmitThis, that was wrong, use the actual
14875 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14877 * class.cs (MethodData.Define): While checking if a method is an
14878 interface implementation, improve the test: If we are not public
14879 (use new test here: use the computed MethodAttributes directly,
14880 instead of the parsed modifier flags) check if the `implementing'
14881 method comes from an interface or not.
14883 * pending.cs (VerifyPendingMethods): Slightly better error
14886 * makefile: add test target that does the mcs bootstrap.
14888 2003-07-16 Ravi Pratap <ravi@ximian.com>
14890 * interface.cs (Define): Do nothing here since there are no
14891 members to populate etc. Move the attribute emission out of here
14892 since this was just totally the wrong place to put it. Attribute
14893 application happens during the 'Emit' phase, not in the 'Define'
14896 (Emit): Add this method and move the attribute emission here
14898 * rootcontext.cs (EmitCode): Call the Emit method on interface
14901 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14903 * expression.cs (OverloadResolve): Report error only if Location
14904 is not 'Null' which means that there was a probe going on.
14906 2003-07-14 Martin Baulig <martin@ximian.com>
14908 * expression.cs (ConditionalLogicalOperator): New public class to
14909 implement user defined conditional logical operators.
14910 This is section 14.11.2 in the spec and bug #40505.
14912 2003-07-14 Martin Baulig <martin@ximian.com>
14914 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14916 2003-07-14 Martin Baulig <martin@ximian.com>
14918 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14920 * ecore.cs (IVariable.VerifyFixed): New interface method.
14922 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14923 operator, check whether the variable is actually fixed. Fixes bug
14924 #36055. Set a variable definitely assigned when taking its
14925 address as required by the spec.
14927 * statement.cs (LocalInfo.IsFixed): New field.
14928 (LocalInfo.MakePinned): Set `IsFixed' to true.
14930 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14932 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14933 for .ctors, ensure that we only ask for members declared in the
14934 attribute type (BindingFlags.DeclaredOnly).
14938 * expression.cs (Error_WrongNumArguments): Report error 1501
14939 correctly the way CSC does.
14941 2003-07-13 Martin Baulig <martin@ximian.com>
14943 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14944 lookup on the fully qualified name, to make things like "X.X" work
14945 where "X.X" is a fully qualified type name, but we also have a
14946 namespace "X" in the using list. Fixes #41975.
14948 2003-07-13 Martin Baulig <martin@ximian.com>
14950 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14951 function. If we're a CompoundAssign, we need to create an embedded
14952 CompoundAssign, not an embedded Assign.
14953 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14956 2003-07-13 Martin Baulig <martin@ximian.com>
14958 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14959 work to fix bug #46088.
14961 2003-07-13 Ravi Pratap <ravi@ximian.com>
14963 * class.cs (Operator.Emit): Do not emit attributes here - it is
14964 taken care of by the Method class that we delegate too. This takes
14965 care of bug #45876.
14967 2003-07-10 Martin Baulig <martin@ximian.com>
14969 * expression.cs (TypeOfVoid): New class.
14970 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14972 2003-07-10 Martin Baulig <martin@ximian.com>
14974 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14977 2003-07-10 Martin Baulig <martin@ximian.com>
14979 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14980 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14982 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14984 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14986 2003-07-10 Martin Baulig <martin@ximian.com>
14988 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14989 of decimal. Fixes #42850.
14991 NOTE: I also fixed the created byte blob, but this doesn't work on
14992 the MS runtime and csc never produces any byte blobs for decimal
14995 2003-07-10 Martin Baulig <martin@ximian.com>
14997 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14998 structs; fixes #32068.
14999 (Block.AddChildVariableNames): Fixed #44302.
15001 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15003 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15005 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15007 * attribute.cs: And this test is onger needed.
15009 2003-07-08 Martin Baulig <martin@ximian.com>
15011 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15012 inaccessible types. Fixes #36313.
15014 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15016 * namespace.cs (NamespaceEntry): Create implicit entries for all
15017 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15018 implicit entries for N1.N2 and N1.
15020 2003-07-08 Martin Baulig <martin@ximian.com>
15022 Rewrote the handling of namespaces to fix a lot of the issues
15023 wrt. `using' aliases etc.
15025 * namespace.cs (Namespace): Splitted this class into a
15026 per-assembly `Namespace' and a per-file `NamespaceEntry'.
15028 * typemanager.cs (TypeManager.IsNamespace): Removed.
15029 (TypeManager.ComputeNamespaces): Only compute namespaces from
15030 loaded assemblies here, not the namespaces from the assembly we're
15031 currently compiling.
15033 2003-07-08 Martin Baulig <martin@ximian.com>
15035 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15037 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15039 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15042 I thought about the memory savings here, but LookupTypeReflection
15043 is used under already very constrained scenarios. Compiling
15044 corlib or mcs only exposes one hit, so it would not really reduce
15045 any memory consumption.
15047 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15049 * typemanager.cs: fixes bug #45889 by only adding public types from
15050 other assemblies to the list of known types.
15052 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15054 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15055 on the type we resolved.
15057 2003-07-05 Martin Baulig <martin@ximian.com>
15059 * pending.cs (PendingImplementation.ParentImplements): Don't
15060 create the proxy if the parent is abstract.
15062 * class.cs (TypeContainer.DefineIndexers): Process explicit
15063 interface implementations first. Fixes #37714.
15065 2003-07-04 Miguel de Icaza <miguel@ximian.com>
15067 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15068 defined recursively; but since we modify the input parameters
15069 (left is set to `this' temporarily), we reset this value if the
15070 left_is_explicit is false, which gives the original semantics to
15073 * literal.cs (NullPointer): new class used to represent a null
15074 literal in a pointer context.
15076 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15077 type is a pointer, use a NullPointer object instead of a
15078 NullLiteral. Closes 43687
15080 (ExplicitConversion): Convert pointer values using
15081 the conv opcode to the proper type.
15083 * ecore.cs (New): change ValueTypeVariable property into a method,
15084 that returns whether the valuetype is suitable for being used.
15086 * expression.cs (Binary.DoNumericPromotions): Only return if we
15087 the int constant was a valid uint, and we can return both left and
15088 right as uints. If not, we continue processing, to trigger the
15089 type conversion. This fixes 39018.
15091 * statement.cs (Block.EmitMeta): During constant resolution, set
15092 the CurrentBlock property on the emitcontext, so that we resolve
15093 constants propertly.
15095 2003-07-02 Martin Baulig <martin@ximian.com>
15097 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15098 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15100 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15101 than emitting it here.
15103 * statement.cs: Fixed some more flow analysis bugs.
15105 2003-07-02 Martin Baulig <martin@ximian.com>
15107 * class.cs (MethodData.Define): When implementing interface
15108 methods, set Final unless we're Virtual.
15110 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15111 check work for interface methods.
15113 2003-07-01 Martin Baulig <martin@ximian.com>
15115 * ecore.cs (EmitContext.This): Replaced this property with a
15116 GetThis() method which takes a Location argument. This ensures
15117 that we get the correct error location for a CS0188.
15119 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15121 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15122 ImplicitStandardConversion.
15124 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15126 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15128 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15131 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15133 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15136 (MethodData.Define): Turn off initlocals for unsafe methods.
15138 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15140 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15141 complete; Fixes #37521.
15143 * delegate.cs: Use Modifiers.TypeAttr to compute the
15144 TypeAttributes, instead of rolling our own. This makes the flags
15145 correct for the delegates.
15147 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15149 * class.cs (Constructor.Define): Set the private flag for static
15150 constructors as well.
15152 * cs-parser.jay (statement_expression): Set the return value to
15153 null, to avoid a crash when we catch an error.
15155 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15157 * cs-parser.jay: Applied patch from Jackson that adds support for
15158 extern and unsafe modifiers to destructor declarations.
15160 * expression.cs: Report error 21 if the user is trying to index a
15163 * driver.cs: Add an error message, suggested by the bug report.
15165 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15166 if we do not have a ": this ()" constructor initializer. Fixes 45149
15168 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15170 * namespace.cs: Add some information to reduce FAQs.
15172 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15174 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15175 underlying enumeration types. Fixes #43915.
15177 * expression.cs: Treat ushort/short as legal values to be used in
15178 bitwise operations.
15180 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15182 * delegate.cs: transfer custom attributes for paramenters from
15183 the delegate declaration to Invoke and BeginInvoke.
15185 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15187 * attribute.cs: handle custom marshalers and emit marshal info
15190 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15192 * makefile.gnu: Added anonymous.cs to the compiler sources.
15194 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15196 * iterators.cs: Change the name of the proxy class to include two
15199 * cs-parser.jay: Update grammar to include anonymous methods.
15201 * anonymous.cs: new file.
15203 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15205 * class.cs (Field.Define): Add missing test for pointers and
15208 2003-05-27 Ravi Pratap <ravi@ximian.com>
15210 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15211 we use the stobj opcode.
15213 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15214 since it wasn't the correct fix.
15216 It still is puzzling that we are required to use stobj for IntPtr
15217 which seems to be a ValueType.
15219 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15221 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15222 during regular simple name resolution. Now, the trick is that
15223 instead of returning for processing the simplename, we do a
15224 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15225 contextual lookup type). If a match is found, return that, if
15226 not, return for further composition.
15228 This fixes long-standing 30485.
15230 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15231 using the address to initialize an object, do an Stobj instead of
15232 using the regular Stelem.
15234 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15235 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15236 Because if we are a BaseIndexerAccess that value will be true.
15239 * statement.cs (GotoCase.Resolve): Return after reporting an
15240 error, do not attempt to continue.
15242 * expression.cs (PointerArithmetic.Emit): If our operand is a
15243 long, convert our constants to match the operand before
15244 multiplying. Convert to I type before adding. Fixes 43670.
15246 2003-05-14 Ravi Pratap <ravi@ximian.com>
15248 * enum.cs (ImplicitConversionExists) : Rename to
15249 ImplicitEnumConversionExists to remove ambiguity.
15251 * ecore.cs (NullCast): New type of cast expression class which
15252 basically is very similar to EmptyCast with the difference being
15253 it still is a constant since it is used only to cast a null to
15255 (eg. (string) null)
15257 * convert.cs (ImplicitReferenceConversion): When casting a null
15258 literal, we return a NullCast.
15260 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15261 should be around anymore.
15263 The renaming (reported was slightly wrong). Corrections:
15265 ConvertImplicitStandard -> ImplicitConversionStandard
15266 ConvertExplicitStandard -> ExplicitConversionStandard
15268 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15269 before passing them in !
15271 * convert.cs (ImplicitConversionStandard): When comparing for
15272 equal expr and target types, ensure that expr is not a
15275 In general, we must not be checking (expr_type ==
15276 target_type) in the top level conversion methods
15277 (ImplicitConversion, ExplicitConversion etc). This checking is
15278 done in the methods that they delegate to.
15280 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15282 * convert.cs: Move Error_CannotConvertType,
15283 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15284 ImplicitNumericConversion, ImplicitConversionExists,
15285 ImplicitUserConversionExists, StandardConversionExists,
15286 FindMostEncompassedType, FindMostSpecificSource,
15287 FindMostSpecificTarget, ImplicitUserConversion,
15288 ExplicitUserConversion, GetConversionOperators,
15289 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15290 TryImplicitIntConversion, Error_CannotConvertImplicit,
15291 ConvertImplicitRequired, ConvertNumericExplicit,
15292 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15293 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15296 Perform the following renames:
15298 StandardConversionExists -> ImplicitStandardConversionExists
15299 ConvertImplicit -> ImplicitConversion
15300 ConvertImplicitStandard -> ImplicitStandardConversion
15301 TryImplicitIntConversion -> ImplicitIntConversion
15302 ConvertImplicitRequired -> ImplicitConversionRequired
15303 ConvertNumericExplicit -> ExplicitNumericConversion
15304 ConvertReferenceExplicit -> ExplicitReferenceConversion
15305 ConvertExplicit -> ExplicitConversion
15306 ConvertExplicitStandard -> ExplicitStandardConversion
15308 2003-05-19 Martin Baulig <martin@ximian.com>
15310 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15311 (TypeInfo): Added support for structs having structs as fields.
15313 * ecore.cs (FieldExpr): Implement IVariable.
15314 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15315 VariableInfo for the field.
15317 2003-05-18 Martin Baulig <martin@ximian.com>
15319 * expression.cs (This.DoResolve): Report a CS0027 if we're
15320 emitting a field initializer.
15322 2003-05-18 Martin Baulig <martin@ximian.com>
15324 * expression.cs (This.ResolveBase): New public function.
15325 (This.DoResolve): Check for CS0188.
15327 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15330 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15331 `instance_expression' to null if we don't have any non-static
15334 2003-05-18 Martin Baulig <martin@ximian.com>
15336 Reworked the way how local variables and parameters are handled by
15337 the flow analysis code.
15339 * statement.cs (TypeInfo, VariableMap): New public classes.
15340 (VariableInfo): New public class. This is now responsible for
15341 checking whether a variable has been assigned. It is used for
15342 parameters and local variables.
15343 (Block.EmitMeta): Take the InternalParameters as argument; compute
15344 the layout of the flow vectors here.
15345 (Block.LocalMap, Block.ParameterMap): New public properties.
15346 (FlowBranching): The .ctor doesn't get the InternalParameters
15347 anymore since Block.EmitMeta() now computes the layout of the flow
15349 (MyStructInfo): This class is now known as `StructInfo' and nested
15350 in `TypeInfo'; we don't access this directly anymore.
15352 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15353 property and removed IsAssigned(), IsFieldAssigned(),
15354 SetAssigned() and SetFieldAssigned(); we now call them on the
15355 VariableInfo so we don't need to duplicate this code everywhere.
15357 * expression.cs (ParameterReference): Added `Block block' argument
15359 (LocalVariableReference, ParameterReference, This): The new
15360 VariableInfo class is now responsible for all the definite
15363 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15364 IsParameterAssigned, SetParameterAssigned): Removed.
15366 2003-05-18 Martin Baulig <martin@ximian.com>
15368 * typemanager.cs (InitCoreTypes): Try calling
15369 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15370 the 3-args-version. Corlib now also needs our `void_type'.
15371 (GetMethod): Added overloaded version which takes an optional
15372 `bool report_errors' to allow lookups of optional methods.
15374 2003-05-12 Martin Baulig <martin@ximian.com>
15376 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15377 only used for locals and not for parameters.
15379 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15381 * support.cs (InternalParameters.ParameterType): Return the
15382 ExternalType of the parameter.
15384 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15387 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15389 * class.cs (MethodData.Define): Do not set the `newslot' on
15390 interface members, if they are also flagged as "override".
15392 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15393 better code for ++i and i++. This only works for static fields
15394 and local variables.
15396 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15397 want to pull the DeclSpace out of the builder_to_declspace instead
15398 of the TypeBuilder (like in TypeContainer.FindMembers).
15400 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15401 instead of LookupTypeContainer. Fixes the crash on .NET for
15402 looking up interface members.
15404 * const.cs: Create our own emit context during the Definition
15405 stage, so that constants are evaluated in the proper context, when
15406 a recursive definition happens.
15408 2003-05-11 Martin Baulig <martin@ximian.com>
15410 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15411 new block for a switch section.
15412 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15413 the adding/lookup in the switch block. Fixes #39828.
15415 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15417 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15418 functionality: I needed to convert the data after I had performed
15419 the add/sub operation into the operands type size.
15421 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15422 pass the type for the box operation, otherwise the resulting
15423 object would have been of type object.
15425 (BoxedCast): Add constructor to specify the type to box as.
15427 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15429 * iterators.cs: I was reusing the `count' variable inadvertently,
15430 take steps to not allow this to happen.
15432 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15434 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15435 by creating an array at the point where the params starts and
15436 putting all those arguments there, then adjusting the size of the
15439 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15441 * expression.cs (New.AddressOf): Implement interface
15442 IMemoryLocation. This is used when the `new' operator is used in
15443 the context of an invocation to a method on a value type.
15445 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15448 * namespace.cs: Also check the using aliases here.
15450 * driver.cs: Move the test for using validity after the types have
15451 been entered, so we do a single pass that also includes the using
15454 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15455 in the regular case. CreateSiblingForFinally is doing extra
15458 * attribute.cs (GetAttributeArgumentExpression): Store the result
15459 on an out value, and use the return value to indicate failure
15460 instead of using null (which is a valid return for Constant.GetValue).
15462 * statement.cs: Perform the analysis flow for the increment
15463 portion after the statement, because this will be the real flow of
15464 execution. Fixes #42385
15466 * codegen.cs (EmitContext.EmitArgument,
15467 EmitContext.EmitStoreArgument): New helper functions when the
15468 RemapToProxy flag is set.
15470 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15473 Add support for remapping parameters.
15475 * iterators.cs: Propagate parameter values; Store parameter
15476 values in the proxy classes.
15478 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15480 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15481 need a proxy reference; I do not know what I was thinking
15483 * cs-parser.jay (constructor_initializer): catch another error,
15484 and display nice message.
15486 (field_declaration): catch void field declaration
15487 to flag a better error.
15489 * class.cs (MemberBase.CheckBase): Report an error instead of a
15490 warning if a new protected member is declared in a struct.
15491 (Field.Define): catch the error of readonly/volatile.
15493 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15495 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15496 volatile variable is taken
15498 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15500 * statement.cs (Fixed.Resolve): Report an error if we are not in
15503 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15505 * typemanager.cs: reuse the code that handles type clashes for
15506 delegates and enumerations.
15508 * class.cs (Report28): Always report.
15510 * expression.cs (EncodeAsAttribute): Allow nulls here.
15512 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15514 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15515 the functionality for testing whether an expression is valid for
15516 an attribute here. Also handle the case of arrays of elements
15519 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15520 encoding a linear array into an array of objects that are suitable
15521 to be passed to an CustomAttributeBuilder.
15523 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15525 * ecore.cs: (FieldExpr): Handle field remapping here.
15527 * iteratators.cs: Pass the instance variable (if the method is an
15528 instance method) to the constructors, so we can access the field
15529 variables on the class.
15531 TODO: Test this with structs. I think the THIS variable on
15532 structs might have to be a pointer, and not a refenrece
15534 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15536 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15537 local variables to fields in a proxy class.
15539 * iterators.cs (PopulateProxy): Rename our internal fields to
15541 Create a <THIS> field if we are an instance method, so we can
15542 reference our parent container variables.
15543 (MapVariable): Called back from the EmitContext code to enter a
15544 new variable to field mapping into the proxy class (we just create
15548 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15549 for using the remapped locals to fields.
15551 I placed the code here, because that gives the same semantics to
15552 local variables, and only changes the Emit code.
15554 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15555 statements inside iterators.
15556 (VariableInfo): Add a FieldBuilder for the cases when we are
15557 remapping local variables to fields in a proxy class
15559 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15560 current_block != null.
15562 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15563 not cope with strings, as it has been moved to the
15564 TableSwitchEmit. Fixed bug in switch generation.
15566 * expression.cs (New.DoResolve): Provide more context for the user
15567 when reporting an error.
15569 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15572 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15573 check the permissions for it. Note than in a type-resolution
15574 context the check was already present in DeclSpace.ResolveType,
15575 but was missing from the MemberAccess.
15577 (ArrayCreation.CheckIndices): warn if the user has
15578 more nested levels of expressions, but there are no more
15579 dimensions specified. Avoids crash on bug 41906.
15581 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15583 * statement.cs (Block): replace Implicit bool, for a generic
15585 New flag: `Unchecked'. This is used during the EmitMeta phase
15586 (which is out-of-line with the regular Resolve/Emit process for a
15587 statement, as this is done ahead of time, but still gets a chance
15588 to call constant resolve).
15590 (Block.Flags): new enum for adding a new flag.
15592 (Block.EmitMeta): track the state of unchecked.
15594 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15595 to enable constant resolution to work there as well.
15597 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15599 * typemanager.cs (ienumerable_type): Also look up
15600 System.Collections.IEnumerable.
15602 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15604 TODO: Test more than one conditional per method.
15606 * class.cs (Indexer.Define): Report the location where the user is
15607 referencing the unsupported feature.
15609 (MethodData): Overload the use of `conditionals' to
15610 minimize the creation of needless ArrayLists. This saves roughly
15611 212kb on my machine.
15613 (Method): Implement the new IIteratorContainer interface.
15614 (Method.SetYields): Implement the method by setting the ModFlags
15615 to contain METHOD_YIELDS.
15617 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15618 which just got set to null.
15620 * iterators.cs: New file.
15622 (Yield, YieldBreak): New statements.
15624 * statement.cs (Return.Resolve): Flag an error if we are used in
15625 an iterator method.
15627 * codegen.cs (InIterator): New flag set if the code is being
15628 compiled in an iterator method.
15630 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15631 internal modifier, and we just use it to avoid adding extra
15632 fields, as this is seldom used.
15634 * cs-parser.jay: Add yield_statement (yield and yield break).
15636 * driver.cs: New flag -v2 to turn on version 2 features.
15638 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15639 hashtable when v2 is enabled.
15641 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15643 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15644 there is already a namespace defined with this name.
15646 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15647 people upgraded their corlibs.
15649 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15650 always use fully qualified types, no need to use the compiler
15653 (TypeManager.IsNamespace): Use binarysearch.
15655 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15656 AddDelegate): I did not quite use the new IsValid API properly: I
15657 have to pass the short-name and the fullname. I was passing only
15658 the basename instead of the fullname sometimes.
15660 (TypeContainer.DefineType): call NamespaceClash.
15662 * interface.cs (Interface.DefineType): use NamespaceClash before
15665 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15668 * enum.cs: (Enum.DefineType): use NamespaceClash before
15671 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15672 speed increase. First, use the negative_hits cache when we get a
15673 negative. Second, add the type with its full original name
15674 instead of the new . and + encoded name (reflection uses + to
15675 separate type from a nested type). Use LookupTypeReflection
15676 directly which bypasses the type->name hashtable (that we already
15677 know does not contain the type.
15679 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15680 location/container type.
15682 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15684 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15686 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15688 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15689 method is being referenced in the method group from a static
15690 context, and report error 120 if so.
15692 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15695 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15696 is created, we create the A namespace).
15698 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15701 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15703 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15704 invocation to ModuleBuilder.GetType with the same values will
15705 return a new type instance, so we need to cache its return
15708 * expression.cs (Binary.ResolveOperator): Only allow the compare
15709 operators on enums if they are of the same type.
15711 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15712 types of ValueType on their own case. Before we were giving them
15713 the same treatment as objects.
15715 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15716 fullname. Short name is used to compare against container name.
15717 Fullname is used to check against defined namespace names.
15719 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15720 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15722 (Method.CheckBase): Call parent.
15723 (MemberBase.CheckBase): Check for protected members on sealed
15725 (PropertyBase.CheckBase): Call parent.
15726 (Field.Define): Call parent.
15728 * report.cs: Negative error codes are now mapped to 8000 - code,
15729 so that the display is render more nicely.
15731 * typemanager.cs: Do not use try/catch, instead report a regular
15734 (GetPointerType, GetReferenceType): These methods provide
15735 mechanisms to obtain the T* and T& from a T. We had the code
15736 previously scattered around the code base, and it also used
15737 TypeManager.LookupType that would go through plenty of caches.
15738 This one goes directly to the type source.
15740 In some places we did the Type.GetType followed by
15741 ModuleBuilder.GetType, but not in others, so this unifies the
15742 processing as well.
15744 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15745 statements now that we have namespace information.
15747 * typemanager.cs (IsNamespace): New method, returns whether the
15748 string presented is a namespace or not.
15750 (ComputeNamespaces): New public entry point, computes the list of
15751 available namespaces, using the GetNamespaces API call in Mono, or
15752 the slower version in MS.NET.
15754 Now before we start the semantic analysis phase, we have a
15755 complete list of namespaces including everything that the user has
15758 Deleted old code to cache namespaces in .nsc files.
15760 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15762 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15763 class/struct location definition Location for the implicit
15764 constructor location.
15766 (Operator.Define): Use the location of the operator for the
15767 implicit Method definition.
15769 (Constructor.Emit): use the constructor location for the implicit
15770 base initializer constructor.
15772 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15773 and the Expression class now contains two new methods:
15775 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15776 isolate type lookup from the rest of the resolution process.
15778 Since we use Expressions to hold type definitions due to the way
15779 we parse the input we have historically overloaded Resolve to
15780 perform the Type lookups if a special flag is passed. Now this is
15781 eliminated and two methods take their place.
15783 The differences in the two methods between xStep and xTerminal is
15784 that xStep is involved in our current lookup system that uses
15785 SimpleNames to compose a name, while xTerminal is used just to
15786 catch the case where the simplename lookup failed.
15788 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15790 * expression.cs (ResolveMemberAccess): Remove redundant code.
15791 TypeExpr expressions are always born fully resolved.
15793 * interface.cs (PopulateMethod): Do not lookup the types twice.
15794 We were doing it once during SemanticAnalysis and once during
15797 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15798 in local variable type definitions, were being returned as a
15799 SimpleName (we decomposed everything into a string), that is
15800 because primary_expression was being used instead of a type in the
15801 grammar (reduce/reduce conflicts).
15803 The part that was wrong is that we converted the expression into a
15804 string (an oversimplification in one hand, compounded with primary
15805 expressions doing string concatenation).
15811 Would return "A.B.C[]" as a SimpleName. This stopped things like
15812 using clauses from working on this particular context. And a type
15813 was being matched directly against "A.B.C[]".
15815 We now use the correct approach, and allow for ComposedCast to be
15816 part of the unary expression. So the "A.B.C []" become a composed
15817 cast of "A.B.C" (as a nested group of MemberAccess with a
15818 SimpleName at the end) plus the rank composition "[]".
15822 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15824 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15825 for the access level checking.
15827 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15828 `TypeContainer container', because I kept getting confused when I
15829 was debugging this code.
15831 * expression.cs (Indexers): Instead of tracking getters/setters,
15832 we now track them in parallel. We create one arraylist less, but
15833 most importantly it is possible now for the LValue code to find a
15834 matching get for a set.
15836 (IndexerAccess.DoResolveLValue): Update the code.
15837 GetIndexersForType has been modified already to extract all the
15838 indexers from a type. The code assumed it did not.
15840 Also make the code set the correct return type for the indexer.
15841 This was fixed a long time ago for properties, but was missing for
15842 indexers. It used to be void_type.
15844 (Binary.Emit): Test first for doubles instead of
15845 floats, as they are more common.
15847 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15848 when dealing with floats and the <=, >= operators. This fixes bug
15851 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15852 to load the array value by emitting a load on the foreach variable
15853 type. This was incorrect.
15855 We now emit the code to load an element using the the array
15856 variable type, and then we emit the conversion operator.
15860 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15862 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15864 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15866 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15867 test for protection before we test for signatures.
15869 (MethodSignature.ToString): implement.
15871 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15872 to the case where we reduced into a LongConstant.
15874 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15875 depend on whether the information is acurrate, because the
15876 Microsoft runtime will always claim that the array type is public,
15877 regardless of the real state.
15879 If the type is a pointer, another problem happens: the type is
15880 reported as non-public in Microsoft.
15882 In both cases we have to call CheckAccessLevel recursively with
15883 the underlying type as the argument to be tested.
15885 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15887 * assign.cs (Assign.Emit): If we are dealing with a compound
15888 assignment expression, we should use the code path that stores the
15889 intermediate result in a temporary value. This fixes #40903.
15891 *expression.cs (Indirection.ToString): Provide ToString method for
15894 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15896 * class.cs: Null out fields holding references to Block objects so
15897 they can be garbage collected.
15899 * expression.cs (OverloadResolve): Remove unused local.
15901 2003-04-07 Martin Baulig <martin@ximian.com>
15903 * codegen.cs (EmitContext.CurrentFile): New public field.
15904 (EmitContext.Mark): Use the CurrentFile to check whether the
15905 location is in the correct file.
15906 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15908 2003-04-07 Martin Baulig <martin@ximian.com>
15910 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15912 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15913 location. [FIXME: The location argument which gets passed to this
15914 method is sometimes wrong!]
15916 2003-04-07 Nick Drochak <ndrochak@gol.com>
15918 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15920 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15922 * expression.cs (Indirection.EmitAssign): We were using the
15923 temporary, but returning immediately instead of continuing the
15926 2003-04-06 Martin Baulig <martin@ximian.com>
15928 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15929 if it's a nested child, but also deriving from the outer class.
15932 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15933 nested child, but also deriving from the outer class. See
15935 (FilterWithClosure): We may access private members of the outer
15936 class if we're a nested child and deriving from the outer class.
15937 (RealMemberLookup): Only set `closure_private_ok' if the
15938 `original_bf' contained BindingFlags.NonPublic.
15940 2003-04-05 Martin Baulig <martin@ximian.com>
15942 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15943 probe if its a type parameter, and if so, flag an error.
15945 * decl.cs: Move here the SetParameterInfo code from class.cs.
15946 Handle IsGeneric here.
15948 Handle a variety of errors in the parameter info definition.
15950 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15951 type parameters here.
15953 * cs-parser.jay (class_declaration): report errors for parameters
15956 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15958 * generic.cs: New file, contains support code for generics.
15960 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15961 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15963 Update parser for the above removals.
15965 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15966 now taken care of in the parser.
15968 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15970 * class.cs (Event.Define): Do not allow abstract events to have
15973 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15975 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15976 block in event declarations.
15978 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15979 value type, get its address.
15981 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15982 leaving a class on the stack instead of a boolean value (int
15983 0/1). Change the code so we compare against null, and then the
15984 result against zero.
15986 * class.cs (TypeContainer.GetClassBases): We were checking for the
15987 parent class being sealed too late.
15989 * expression.cs (Binary.Emit): For <= and >= when dealing with
15990 floating point values, use cgt.un and clt.un instead of cgt and
15993 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15995 * statement.cs: Apply the same optimization as MS: skip the
15996 GetEnumerator returning an IEnumerator, and use the one returning a
15997 CharEnumerator instead. This allows us to avoid the try-finally block
16000 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
16002 * cs-parser.jay: Attributes cannot be applied to
16003 namespaces. Fixes #40473
16005 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16008 (Add*): check if the name is valid using the full name for constants,
16009 fields, properties and events.
16011 2003-03-28 Miguel de Icaza <miguel@ximian.com>
16013 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16014 char constants to be part of the enumeration.
16016 * expression.cs (Conditional.DoResolve): Add support for operator
16017 true. Implements the missing functionality from 14.12
16019 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16020 operator true/false as required by the spec.
16022 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16023 implicit conversion to boolean.
16025 * statement.cs (Statement.ResolveBoolean): A boolean expression is
16026 also one where the type implements `operator true'.
16028 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16029 get an expression that will invoke operator true based on an
16032 (GetConversionOperators): Removed the hack that called op_True
16035 (Expression.ResolveBoolean): Move this from Statement.
16037 2003-03-17 Miguel de Icaza <miguel@ximian.com>
16039 * ecore.cs (FieldExpr): do not allow initialization of initonly
16040 fields on derived classes
16042 2003-03-13 Martin Baulig <martin@ximian.com>
16044 * statement.cs (Block.Emit): Call ig.BeginScope() and
16045 ig.EndScope() when compiling with debugging info; call
16046 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16048 2003-03-08 Miguel de Icaza <miguel@ximian.com>
16050 * expression.cs (Indexers): Do not construct immediately, allow
16051 for new members to be appended as we go. Fixes 38143
16053 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16055 * expression.cs: save/restore context when resolving an unchecked
16058 2003-03-05 Miguel de Icaza <miguel@ximian.com>
16060 * cfold.cs: Catch division by zero in modulus operator during
16063 2003-03-03 Miguel de Icaza <miguel@ximian.com>
16065 * interface.cs (Interface.DefineMembers): Avoid defining members
16068 2003-02-27 Miguel de Icaza <miguel@ximian.com>
16070 * driver.cs: handle the +/- options for -noconfig
16072 * statement.cs (Unckeched.Resolve): Also track the state of
16073 unchecked in the Resolve phase.
16075 2003-02-27 Martin Baulig <martin@ximian.com>
16077 * ecore.cs (Expression.MemberLookup): Don't create a
16078 MethodGroupExpr for something which is not a method. Fixes #38291.
16080 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16082 * class.cs (MemberBase.CheckParameters): Also check that the type
16083 is unmanaged if it is a pointer.
16085 * expression.cs (SizeOf.Resolve): Add location information.
16087 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16088 a managed type is declared.
16090 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16091 parameter modifiers as well. Fixes bug 38606
16093 * class.cs: Very sad. Am backing out the speed up changes
16094 introduced by the ArrayList -> Array in the TypeContainer, as they
16095 were not actually that much faster, and introduced a bug (no error
16096 reports on duplicated methods).
16098 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16099 source first, this will guarantee that we have a valid expression
16100 before calling in lower levels functions that will require a
16101 resolved object. Then use this original_source in the
16102 target.ResolveLValue instead of the original source that was
16105 Another change. Use target.Resolve instead of LValueResolve.
16106 Although we are resolving for LValues, we will let the Assign code
16107 take care of that (it will be called again from Resolve). This
16108 basically allows code like this:
16110 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16111 class Y { void A (X x) { x [0] += o; }
16113 The problem was that the indexer was trying to resolve for
16114 set_Item (idx, object o) and never finding one. The real set_Item
16115 was set_Item (idx, X). By delaying the process we get the right
16120 2003-02-23 Martin Baulig <martin@ximian.com>
16122 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16123 while calling DoEmit ().
16125 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16126 source files; if you use the #line directive inside a method, the
16127 compiler stops emitting line numbers for the debugger until it
16128 reaches the end of the method or another #line directive which
16129 restores the original file.
16131 2003-02-23 Martin Baulig <martin@ximian.com>
16133 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16135 2003-02-23 Martin Baulig <martin@ximian.com>
16137 * statement.cs (Block.AddChildVariableNames): We need to call this
16138 recursively, not just for our immediate children.
16140 2003-02-23 Martin Baulig <martin@ximian.com>
16142 * class.cs (Event.Define): Always make the field private, like csc does.
16144 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16145 actually work, fixes bug #37521.
16147 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16149 * delegate.cs: When creating the various temporary "Parameters"
16150 classes, make sure that we call the ComputeAndDefineParameterTypes
16151 on those new parameters (just like we do with the formal ones), to
16152 allow them to be resolved in the context of the DeclSpace.
16154 This fixes the bug that Dick observed in Bugzilla #38530.
16156 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16158 * expression.cs (ResolveMemberAccess): When resolving a constant,
16159 do not attempt to pull a constant if the value was not able to
16160 generate a valid constant.
16162 * const.cs (LookupConstantValue): Do not report more errors than required.
16164 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16166 * expression.cs: fixes bug #38328.
16168 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16170 * class.cs: Changed all the various members that can be part of a
16171 class from being an ArrayList to be an Array of the right type.
16172 During the DefineType type_list, interface_list, delegate_list and
16173 enum_list are turned into types, interfaces, delegates and enums
16176 And during the member population, indexer_list, event_list,
16177 constant_list, field_list, instance_constructor_list, method_list,
16178 operator_list and property_list are turned into their real arrays.
16180 Although we could probably perform this operation earlier, for
16181 good error reporting we need to keep the lists and remove the
16182 lists for longer than required.
16184 This optimization was triggered by Paolo profiling the compiler
16185 speed on the output of `gen-sample-program.pl' perl script.
16187 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16188 not crash in methods like MemberLookupFailed that use this field.
16190 This problem arises when the compiler fails to resolve a type
16191 during interface type definition for example.
16193 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16195 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16196 inherit from System.Object, so we have to stop at null, not only
16197 when reaching System.Object.
16199 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16201 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16202 DeclaredOnly because the parent indexer might have had a different
16203 name, but did not loop until the top of the hierarchy was reached.
16205 The problem this one fixes is 35492: when a class implemented an
16206 indexer from an interface, we were getting the interface method
16207 (which was abstract) and we were flagging an error (can not invoke
16210 This also keeps bug 33089 functioning, and test-148 functioning.
16212 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16213 out if a method is special is to see if it is declared in a
16214 property or event, or whether it is one of the predefined operator
16215 names. This should fix correctly #36804.
16217 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16219 The goal here is to remove the dependency on EmptyCast.Peel ().
16220 Killing it completely.
16222 The problem is that currently in a number of places where
16223 constants are expected, we have to "probe" for an EmptyCast, and
16224 Peel, which is not the correct thing to do, as this will be
16225 repetitive and will likely lead to errors.
16227 The idea is to remove any EmptyCasts that are used in casts that
16228 can be reduced to constants, so we only have to cope with
16231 This bug hunt was triggered by Bug 37363 and the desire to remove
16232 the duplicate pattern where we were "peeling" emptycasts to check
16233 whether they were constants. Now constants will always be
16236 * ecore.cs: Use an enumconstant here instead of wrapping with
16239 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16240 throwing me off. By handling this we can get rid of a few hacks.
16242 * statement.cs (Switch): Removed Peel() code.
16244 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16246 * class.cs: Location information for error 508
16248 * expression.cs (New.DoResolve): Add a guard against double
16249 resolution of an expression.
16251 The New DoResolve might be called twice when initializing field
16252 expressions (see EmitFieldInitializers, the call to
16253 GetInitializerExpression will perform a resolve on the expression,
16254 and later the assign will trigger another resolution
16256 This leads to bugs (#37014)
16258 * delegate.cs: The signature for EndInvoke should contain any ref
16259 or out parameters as well. We were not doing this in the past.
16261 * class.cs (Field.Define): Do not overwrite the type definition
16262 inside the `volatile' group. Turns out that volatile enumerations
16263 were changing the type here to perform a validity test, which
16266 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16268 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16269 and structs, we do not want to load the instance variable
16271 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16272 enum_type has to be handled like an object reference (implicit
16273 conversions exists from this to object), but the regular IsClass
16274 and IsValueType tests will never return true for this one.
16276 Also we use TypeManager.IsValueType instead of type.IsValueType,
16277 just for consistency with the rest of the code (this is only
16278 needed if we ever use the construct exposed by test-180.cs inside
16279 corlib, which we dont today).
16281 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16283 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16286 2003-02-09 Martin Baulig <martin@ximian.com>
16288 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16289 (Namespace.DefineNamespaces): New static public method; this is
16290 called when we're compiling with debugging to add all namespaces
16291 to the symbol file.
16293 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16294 pass it to the Namespace's .ctor.
16296 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16297 and MethodBase arguments; pass the namespace ID to the symwriter;
16298 pass the MethodBase instead of the token to the symwriter.
16299 (SymbolWriter.DefineNamespace): New method to add a namespace to
16302 2003-02-09 Martin Baulig <martin@ximian.com>
16304 * symbolwriter.cs: New file. This is a wrapper around
16305 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16306 methods here in near future.
16308 2003-02-09 Martin Baulig <martin@ximian.com>
16310 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16311 ILGenerator.MarkSequencePoint() which are actually used by the
16314 2003-02-09 Martin Baulig <martin@ximian.com>
16316 * location.cs (SourceFile): New public sealed class. This
16317 contains the name and an index which is used in the location's token.
16318 (Location): Reserve an appropriate number of bits in the token for
16319 the source file instead of walking over that list, this gives us a
16320 really huge performance improvement when compiling with debugging.
16322 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16323 `SourceFile' argument instead of a string.
16324 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16325 but don't parse/tokenize here, we need to generate the list of all
16326 source files before we do that.
16327 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16330 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16331 instead of a string.
16333 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16336 2003-02-09 Martin Baulig <martin@ximian.com>
16338 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16339 filename on `#line default'.
16341 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16343 * statement.cs: don't clear the pinned var when the fixed statement
16344 returns from the method (fixes bug#37752).
16346 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16348 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16351 2003-02-07 Martin Baulig <martin@ximian.com>
16353 * driver.cs: Removed the `--debug-args' command line argument.
16355 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16356 automatically by the AsssemblyBuilder.
16357 (CodeGen.InitializeSymbolWriter): We don't need to call any
16358 initialization function on the symbol writer anymore. This method
16359 doesn't take any arguments.
16361 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16363 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16364 from referenced assemblies as well.
16366 2003-02-02 Martin Baulig <martin@ximian.com>
16368 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16370 2003-02-02 Martin Baulig <martin@ximian.com>
16372 * class.cs (Constructor.Emit): Open the symbol writer before
16373 emitting the constructor initializer.
16374 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16375 single-stepping through constructor initializers.
16377 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16379 * class.cs: Handle error 549: do not allow virtual methods in
16382 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16384 * decl.cs: Check access levels when resolving types
16386 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16388 * statement.cs: Add parameters and locals set in catch blocks that might
16389 return to set vector
16391 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16393 * class.cs (Operator): Set the SpecialName flags for operators.
16395 * expression.cs (Invocation.DoResolve): Only block calls to
16396 accessors and operators on SpecialName methods.
16398 (Cast.TryReduce): Handle conversions from char constants.
16401 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16403 * statement.cs: small memory and time optimization in FlowBranching.
16405 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16407 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16408 problem that the last fix but in the other sid (Set).
16410 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16411 access when there is no indexer in the hierarchy.
16413 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16415 * class.cs: Combine some if statements.
16417 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16419 * driver.cs: fixed bug #37187.
16421 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16423 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16424 any indexer, it's needed to build a list with all the indexers in the
16425 hierarchy (AllGetters), else we have problems. Fixes #35653.
16427 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16429 * class.cs (MethodData.Define): It is wrong for an interface
16430 implementation to be static in both cases: explicit and implicit.
16431 We were only handling this in one case.
16433 Improve the if situation there to not have negations.
16435 * class.cs (Field.Define): Turns out that we do not need to check
16436 the unsafe bit on field definition, only on usage. Remove the test.
16438 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16440 * driver.cs: use assembly.Location instead of Codebase (the latest
16441 patch made mcs fail when using MS assemblies).
16443 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16445 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16446 get the path to *corlib.dll.
16448 2003-01-21 Nick Drochak <ndrochak@gol.com>
16452 * typemanager.cs: Remove compiler warnings
16454 2003-01-20 Duncan Mak <duncan@ximian.com>
16456 * AssemblyInfo.cs: Bump the version number to 0.19.
16458 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16460 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16462 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16464 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16466 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16468 * cs-parser.jay: Small fix: we were not comparing the constructor
16469 name correctly. Thanks to Zoltan for the initial pointer.
16471 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16473 * cs-tokenizer.cs: Set file name when specified with #line
16475 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16477 * cs-parser.jay: Only perform the constructor checks here if we
16478 are named like the class; This will help provider a better
16479 error. The constructor path is taken when a type definition is
16480 not found, but most likely the user forgot to add the type, so
16481 report that rather than the constructor error.
16483 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16485 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16488 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16490 * cs-parser.jay: Add cleanup call.
16492 2003-01-13 Duncan Mak <duncan@ximian.com>
16494 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16495 consistent with other methods.
16497 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16499 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16501 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16503 * attribute.cs: only set GuidAttr to true when we have a
16506 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16510 * typemanager.cs: fixes to allow mcs compile corlib with the new
16511 Type.IsSubclassOf fix.
16513 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16515 * expression.cs (LocalVariableReference.DoResolve): Classify a
16516 constant as a value, not as a variable. Also, set the type for
16519 * cs-parser.jay (fixed_statement): take a type instead of a
16520 pointer_type, so we can produce a better error message later.
16522 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16525 (For.DoEmit): Make inifinite loops have a
16526 non-conditional branch back.
16528 (Fixed.DoEmit): First populate the pinned variables, then emit the
16529 statement, then clear the variables. Before I was emitting the
16530 code once for each fixed piece.
16533 2003-01-08 Martin Baulig <martin@ximian.com>
16535 * statement.cs (FlowBranching.MergeChild): A break in a
16536 SWITCH_SECTION does not leave a loop. Fixes #36155.
16538 2003-01-08 Martin Baulig <martin@ximian.com>
16540 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16541 lives in the same number space than `param_map'. Fixes #36154.
16543 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16545 * cs-parser.jay (constructor_declaration): Set the
16546 Constructor.ModFlags before probing for it. This makes the
16547 compiler report 514, 515 and 132 (the code was there, but got
16550 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16551 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16552 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16554 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16556 * enum.cs: create the enum static fields using the enum type.
16558 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16560 * class.cs: don't try to create the ParamBuilder for the return
16561 type if it's not needed (and handle it breaking for the ms runtime
16564 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16566 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16568 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16570 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16571 the command. This showed up while compiling the JANET source
16572 code, which used \r as its only newline separator.
16574 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16576 * class.cs (Method.Define): If we are an operator (because it
16577 reuses our code), then set the SpecialName and HideBySig. #36128
16579 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16581 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16582 exception, report error 120 `object reference required'.
16584 * driver.cs: Add --pause option, used during to measure the size
16585 of the process as it goes with --timestamp.
16587 * expression.cs (Invocation.DoResolve): Do not allow methods with
16588 SpecialName to be invoked.
16590 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16592 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16593 number before adding it.
16595 2002-12-21 Ravi Pratap <ravi@ximian.com>
16597 * ecore.cs (StandardImplicitConversion): When in an unsafe
16598 context, we allow conversion between void * to any other pointer
16599 type. This fixes bug #35973.
16601 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16603 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16604 is not thrown when extensionless outputs are used
16606 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16608 * rootcontext.cs: fixed compilation of corlib.
16610 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16612 * attribute.cs (Attributes.Contains): Add new method.
16614 * class.cs (MethodCore.LabelParameters): if the parameter is an
16615 `out' parameter, check that no attribute `[In]' has been passed.
16617 * enum.cs: Handle the `value__' name in an enumeration.
16619 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16621 * decl.cs: Added special case to allow overrides on "protected
16624 2002-12-18 Ravi Pratap <ravi@ximian.com>
16626 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16627 since it makes much more sense.
16629 (Attributes.ctor): Don't require a Location parameter.
16631 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16633 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16634 since we already have that information per attribute.
16636 * everywhere : make appropriate changes.
16638 * class.cs (LabelParameters): Write the code which actually
16639 applies attributes to the return type. We can't do this on the MS
16640 .NET runtime so we flag a warning in the case an exception is
16643 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16645 * const.cs: Handle implicit null conversions here too.
16647 2002-12-17 Ravi Pratap <ravi@ximian.com>
16649 * class.cs (MethodCore.LabelParameters): Remove the extra
16650 Type [] parameter since it is completely unnecessary. Instead
16651 pass in the method's attributes so that we can extract
16652 the "return" attribute.
16654 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16656 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16657 of ignoring it and letting the compile continue.
16659 * typemanager.cs (ChangeType): use an extra argument to return an
16660 error condition instead of throwing an exception.
16662 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16664 * expression.cs (Unary.TryReduce): mimic the code for the regular
16665 code path. Perform an implicit cast in the cases where we can
16666 implicitly convert to one of the integral types, and then reduce
16667 based on that constant. This fixes bug #35483.
16669 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16671 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16673 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16675 * namespace.cs: fixed bug #35489.
16677 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16679 * class.cs: Remove some dead code.
16681 * cs-parser.jay: Estimate the number of methods needed
16682 (RootContext.MethodCount);
16684 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16685 numbers instead of StringBuilders.
16687 * support.cs (PtrHashtable): Add constructor with initial size;
16688 We can now reduce reallocations of the method table.
16690 2002-12-10 Ravi Pratap <ravi@ximian.com>
16692 * attribute.cs (ApplyAttributes): Keep track of the emitted
16693 attributes on a per-target basis. This fixes bug #35413.
16695 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16697 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16698 default to the Windows 1252 encoding.
16700 (UnixParseOption): Support version, thanks to Alp for the missing
16703 * AssemblyInfo.cs: Add nice assembly information.
16705 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16708 * cs-parser.jay: Allow a trailing comma before the close bracked
16709 in the attribute_section production.
16711 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16712 address of the instance was being taken, I will take this out,
16713 because we take the address of the object immediately here.
16715 2002-12-09 Ravi Pratap <ravi@ximian.com>
16717 * typemanager.cs (AreMultipleAllowed): Take care of the most
16718 obvious case where attribute type is not in the current assembly -
16721 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16723 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16724 definitions, instead of doing that afterwards.
16726 Also we use a nice little hack, depending on the constructor, we
16727 know if we are a "composed" name or a simple name. Hence, we
16728 avoid the IndexOf test, and we avoid
16730 * codegen.cs: Add code to assist in a bug reporter to track down
16731 the source of a compiler crash.
16733 2002-12-07 Ravi Pratap <ravi@ximian.com>
16735 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16736 types have been emitted for a given element and flag an error
16737 if something which does not have AllowMultiple set is used more
16740 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16741 attribute types and their corresponding AllowMultiple properties
16743 (AreMultipleAllowed): Check the property for a given type.
16745 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16746 property in the case we have a TypeContainer.
16748 (Attributes.AddAttribute): Detect duplicates and just skip on
16749 adding them. This trivial fix catches a pretty gross error in our
16750 attribute emission - global attributes were being emitted twice!
16752 Bugzilla bug #33187 is now fixed.
16754 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16756 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16757 instead of pp_and).
16759 * expression.cs (Binary.ResolveOperator): I can only use the
16760 Concat (string, string, string) and Concat (string, string,
16761 string, string) if the child is actually a concatenation of
16764 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16766 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16767 context where we need a 2-character lookahead.
16769 * pending.cs (PendingImplementation): Rework so we can keep track
16770 of interface types all the time, and flag those which were
16771 implemented by parents as optional.
16773 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16775 * expression.cs (Binary.ResolveOperator): Use
16776 String.Concat(string,string,string) or
16777 String.Concat(string,string,string,string) when possible.
16779 * typemanager: More helper methods.
16782 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16784 * pending.cs: remove the bogus return from GetMissingInterfaces()
16785 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16787 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16789 * namespace.cs: avoid duplicated 'using xxx' being added to
16790 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16791 when we get more than one 'using' statement for the same namespace.
16792 Report a CS0105 warning for it.
16794 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16796 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16797 of calling getChar/putback, uses internal knowledge of it.
16799 (xtoken): Reorder tokenizer so most common patterns are checked
16800 first. This reduces the compilation time in another 5% (from 8.11s
16801 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16803 The parsing time is 22% of the compilation in mcs, and from that
16804 64% is spent on the tokenization process.
16806 I tried using a binary search for keywords, but this is slower
16807 than the hashtable. Another option would be to do a couple of
16810 * Not use a StringBuilder, instead use an array of chars,
16811 with a set value. Notice that this way we could catch
16812 the 645 error without having to do it *afterwards*.
16814 * We could write a hand-parser to avoid the hashtable
16815 compares altogether.
16817 The identifier consumption process takes 37% of the tokenization
16818 time. Another 15% is spent on is_number. 56% of the time spent
16819 on is_number is spent on Int64.Parse:
16821 * We could probably choose based on the string length to
16822 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16825 Another 3% is spend on wrapping `xtoken' in the `token' function.
16827 Handle 0xa0 as whitespace (#34752)
16829 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16831 * typemanager.cs (IsCLRType): New routine to tell whether a type
16832 is one of the builtin types.
16834 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16835 typecode in more places instead of doing pointer comparissions.
16836 We could leverage some knowledge about the way the typecodes are
16839 New code to cache namespaces in assemblies, it is currently not
16840 invoked, to be used soon.
16842 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16844 * expression.cs (Binary.ResolveOperator): specially handle
16845 strings, and do not perform user-defined operator overloading for
16848 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16850 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16851 internalcall as it is a pretty simple operation; Avoid whenever
16852 possible to call Char.IsLetter.
16854 (consume_identifier): Cut by half the number of
16855 hashtable calls by merging the is_keyword and GetKeyword behavior.
16857 Do not short-circuit, because if we do, we
16858 report errors (ie, #if false && true would produce an invalid
16862 2002-11-24 Martin Baulig <martin@ximian.com>
16864 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16865 check constant ranges and report a CS0221. Fixes #33186.
16867 2002-11-24 Martin Baulig <martin@ximian.com>
16869 * cs-parser.jay: Make this work for uninitialized variable
16870 declarations in the `for' initializer. Fixes #32416.
16872 2002-11-24 Martin Baulig <martin@ximian.com>
16874 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16875 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16877 2002-11-24 Martin Baulig <martin@ximian.com>
16879 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16880 argument; if true, we also check for user-defined conversions.
16881 This is only needed if both arguments are of a user-defined type.
16882 Fixes #30443, added test-175.cs.
16883 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16885 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16887 2002-11-24 Martin Baulig <martin@ximian.com>
16889 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16890 function to get the store opcode.
16891 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16892 only emit the Ldelema if the store opcode is Stobj. You must run
16893 both test-34 and test-167 to test this. Fixes #34529.
16895 2002-11-23 Martin Baulig <martin@ximian.com>
16897 * ecore.cs (Expression.MemberLookup): Added additional
16898 `qualifier_type' argument which is used when we're being called
16899 from MemberAccess.DoResolve() and null if we're called from a
16901 (Expression.MemberLookupFailed): New method to report errors; this
16902 does the CS1540 check and reports the correct error message.
16904 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16905 argument for the CS1540 check and redone the way how we're dealing
16906 with private members. See the comment in the source code for details.
16907 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16908 `closure_start_type' to `closure_qualifier_type' and check whether
16909 it's not null. It was not this filter being broken, it was just
16910 being called with the wrong arguments.
16912 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16913 and pass it the correct `qualifier_type'; this also does the error
16916 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16918 * expression.cs (Invocation.EmitParams): If the we are dealing
16919 with a non-built-in value type, load its address as well.
16921 (ArrayCreation): Use a a pretty constant instead
16922 of the hardcoded value 2. Use 6 instead of 2 for the number of
16923 static initializers.
16925 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16926 because they are not really value types, just glorified integers.
16928 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16930 * ecore.cs: Remove redundant code for enumerations, make them use
16931 the same code path as everything else, fixes the casting issue
16932 with enumerations in Windows.Forms.
16934 * attribute.cs: Do only cast to string if it is a string, the
16935 validation happens later.
16937 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16938 people upgrade their corlibs.
16940 * ecore.cs: Oops, enumerations were not following the entire code path
16942 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16944 * typemanager.cs (FilterWithClosure): Commented out the test for
16945 1540 in typemanager.cs, as it has problems when accessing
16946 protected methods from a parent class (see test-174.cs).
16948 * attribute.cs (Attribute.ValidateGuid): new method.
16949 (Attribute.Resolve): Use above.
16951 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16953 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16955 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16956 handling for enumerations, as we only needed the TypeContainer
16957 functionality to begin with (this is required for the fix below to
16958 work for enums that reference constants in a container class for
16961 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16963 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16964 a valid TypeBuilder to perform lookups on.o
16966 * class.cs (InheritableMemberSignatureCompare): Use true in the
16967 call to GetGetMethod and GetSetMethod, because we are comparing
16968 the signature, and we need to get the methods *even* if they are
16971 (PropertyBase.CheckBase): ditto.
16973 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16974 GotoCase.Resolve): Use Peel on EmpytCasts.
16976 * ecore.cs (EmptyCast): drop child, add Peel method.
16978 2002-11-17 Martin Baulig <martin@ximian.com>
16980 * ecore.cs (EmptyCast.Child): New public property.
16982 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16983 label resolved to an EmptyCast. Fixes #34162.
16984 (GotoCase.Resolve): Likewise.
16985 (Block.EmitMeta): Likewise.
16987 2002-11-17 Martin Baulig <martin@ximian.com>
16989 * expression.cs (Invocation.BetterConversion): Prefer int over
16990 uint; short over ushort; long over ulong for integer literals.
16991 Use ImplicitConversionExists instead of StandardConversionExists
16992 since we also need to check for user-defined implicit conversions.
16993 Fixes #34165. Added test-173.cs.
16995 2002-11-16 Martin Baulig <martin@ximian.com>
16997 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16998 with the `true' and `false' literals. Fixes #33151.
17000 2002-11-16 Martin Baulig <martin@ximian.com>
17002 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17003 October 22nd; don't do the cs1540 check for static members.
17005 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17006 now using our own filter here and doing the cs1540 check again.
17008 2002-11-16 Martin Baulig <martin@ximian.com>
17010 * support.cs (InternalParameters): Don't crash if we don't have
17011 any fixed parameters. Fixes #33532.
17013 2002-11-16 Martin Baulig <martin@ximian.com>
17015 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17016 when looking up static methods to make this work on Windows.
17019 2002-11-16 Martin Baulig <martin@ximian.com>
17021 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17022 a setter rather than using PropertyInfo.CanWrite.
17024 2002-11-15 Nick Drochak <ndrochak@gol.com>
17026 * class.cs: Allow acces to block member by subclasses. Fixes build
17029 2002-11-14 Martin Baulig <martin@ximian.com>
17031 * class.cs (Constructor.Emit): Added the extern/block check.
17034 2002-11-14 Martin Baulig <martin@ximian.com>
17036 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17037 iteration while looking for indexers, this is needed because the
17038 indexer may have a different name in our base classes. Fixed the
17039 error reporting (no indexers at all, not get accessor, no
17040 overloaded match). Fixes bug #33089.
17041 (IndexerAccess.DoResolveLValue): Likewise.
17043 2002-11-14 Martin Baulig <martin@ximian.com>
17045 * class.cs (PropertyBase.CheckBase): Make this work for multiple
17046 indexers. Fixes the first part of bug #33089.
17047 (MethodSignature.InheritableMemberSignatureCompare): Added support
17050 2002-11-13 Ravi Pratap <ravi@ximian.com>
17052 * attribute.cs (Attribute.Resolve): Catch the
17053 NullReferenceException and report it since it isn't supposed to
17056 2002-11-12 Miguel de Icaza <miguel@ximian.com>
17058 * expression.cs (Binary.EmitBranchable): Also handle the cases for
17059 LogicalOr and LogicalAnd that can benefit from recursively
17060 handling EmitBranchable. The code now should be nice for Paolo.
17062 2002-11-08 Miguel de Icaza <miguel@ximian.com>
17064 * typemanager.cs (LookupType): Added a negative-hit hashtable for
17065 the Type lookups, as we perform quite a number of lookups on
17066 non-Types. This can be removed once we can deterministically tell
17067 whether we have a type or a namespace in advance.
17069 But this might require special hacks from our corlib.
17073 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17074 and double which avoids a conversion from an integer to a double.
17076 * expression.cs: tiny optimization, avoid calling IsConstant,
17077 because it effectively performs the lookup twice.
17079 2002-11-06 Miguel de Icaza <miguel@ximian.com>
17081 But a bogus return here to keep the semantics of the old code
17082 until the Mono runtime is fixed.
17084 * pending.cs (GetMissingInterfaces): New method used to remove all
17085 the interfaces that are already implemented by our parent
17086 classes from the list of pending methods.
17088 * interface.cs: Add checks for calls after ResolveTypeExpr.
17090 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17092 * class.cs (Class.Emit): Report warning 67: event not used if the
17093 warning level is beyond 3.
17095 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17096 being a NullLiteral.
17098 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17101 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17102 path that might fail if a type can not be resolved.
17104 * expression.cs (Binary.Emit): Emit unsigned versions of the
17107 * driver.cs: use error 5.
17109 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17111 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17113 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17115 * cs-parser.jay (switch_section): A beautiful patch from Martin
17116 Baulig that fixed 33094.
17118 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17120 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17121 Check whether the base is abstract and report an error if so.
17123 * expression.cs (IndexerAccess.DoResolveLValue,
17124 IndexerAccess.DoResolve): ditto.
17126 (Invocation.DoResolve): ditto.
17128 (Invocation.FullMethodDesc): Improve the report string.
17130 * statement.cs (Block): Eliminate IsVariableDefined as it is
17131 basically just a wrapper for GetVariableInfo.
17133 * ecore.cs (SimpleName): Use new
17135 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17136 type, as we return the actual parameter ref/unref state on a
17139 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17141 * support.cs: Return proper flags REF/OUT fixing the previous
17144 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17145 not used to mean `ref' but `ref or out' in ParameterReference
17147 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17148 full type signature instead of calling TypeManger.CSharpName
17151 * support.cs (InternalParameters.ParameterDesc): Do not compare
17152 directly to the modflags, because REF/OUT will actually be bitsets
17155 * delegate.cs (VerifyMethod): Check also the modifiers.
17157 * cs-tokenizer.cs: Fix bug where floating point values with an
17158 exponent where a sign was missing was ignored.
17160 * driver.cs: Allow multiple assemblies to be specified in a single
17163 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17165 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17166 because identifiers after a parenthesis would end up in this kind
17167 of production, and we needed to desamiguate it for having casts
17170 (UserDefinedType *) xxx
17172 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17174 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17175 we should set on the Bindingflags.NonPublic, but not turn on
17176 private_ok. private_ok controls whether a Private member is
17177 returned (this is chekced on the filter routine), while the
17178 BindingFlags.NonPublic just controls whether private/protected
17179 will be allowed. This fixes the problem part of the problem of
17180 private properties being allowed to be used in derived classes.
17182 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17183 so we can call the children DoResolveLValue method (this will
17184 properly signal errors on lvalue assignments to base properties)
17186 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17187 getter are null, and we have a property info, we know that this
17188 happened because the lookup failed, so we report an error 122 for
17189 protection level violation.
17191 We also silently return if setter and getter are null in the
17192 resolve functions, this condition only happens if we have flagged
17193 the error before. This is the other half of the problem.
17195 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17196 not have accessibility information, that is why we were returning
17197 true in the filter function in typemanager.cs.
17199 To properly report 122 (property is inaccessible because of its
17200 protection level) correctly, we report this error in ResolveAccess
17201 by failing if both the setter and the getter are lacking (ie, the
17204 DoResolve and DoLResolve have been modified to check for both
17205 setter/getter being null and returning silently, the reason being
17206 that I did not want to put the knowledge about this error in upper
17209 int old = Report.Errors;
17210 x = new PropertyExpr (...);
17211 if (old != Report.Errors)
17216 So the property expr is returned, but it is invalid, so the error
17217 will be flagged during the resolve process.
17219 * class.cs: Remove InheritablePropertySignatureCompare from the
17220 class, as we no longer depend on the property signature to compute
17221 whether it is possible to implement a method or not.
17223 The reason is that calling PropertyInfo.GetGetMethod will return
17224 null (in .NET, in Mono it works, and we should change this), in
17225 cases where the Get Method does not exist in that particular
17230 class X { public virtual int A { get { return 1; } } }
17232 class Z : Y { public override int A { get { return 2; } } }
17234 Would fail in Z because the parent (Y) would not have the property
17235 defined. So we avoid this completely now (because the alternative
17236 fix was ugly and slow), and we now depend exclusively on the
17239 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17240 reference method, instead of using the property.
17242 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17243 routines are gone now.
17245 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17246 names, they were incorrectly named.
17248 * cs-tokenizer.cs: Return are more gentle token on failure.
17250 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17251 had an out-of-sync index variable, which caused it to remove from
17252 the list of pending methods the wrong method sometimes.
17254 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17256 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17257 CanWrite, because those refer to this particular instance of the
17258 property, and do not take into account the fact that we can
17259 override single members of a property.
17261 Constructor requires an EmitContext. The resolution process does
17262 not happen here, but we need to compute the accessors before,
17263 because the resolution does not always happen for properties.
17265 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17266 subclass, before we did not update this flag, but we did update
17269 (GetAccessors): Drop this routine, as it did not work in the
17270 presence of partially overwritten set/get methods.
17272 Notice that this broke the cs1540 detection, but that will require
17275 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17279 * driver.cs: issue a warning instead of an error if we don't support
17280 debugging for the platform. Also ignore a couple of errors that may
17281 arise when trying to write the symbols. Undo my previous patch.
17283 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17285 * driver.cs: ignore /debug switch except for Unix platforms.
17287 2002-10-23 Nick Drochak <ndrochak@gol.com>
17289 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17291 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17293 * driver.cs: Do not make mcs-debug conditional, so we do not break
17294 builds that use it.
17296 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17297 review this patch. But basically after all the children variables
17298 have been merged, the value of "Breaks" was not being set to
17299 new_breaks for Switch blocks. I think that it should be set after
17300 it has executed. Currently I set this to the value of new_breaks,
17301 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17302 conservative, but I do not understand this code very well.
17304 I did not break anything in the build, so that is good ;-)
17306 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17308 2002-10-20 Mark Crichton <crichton@gimp.org>
17310 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17312 2002-10-20 Nick Drochak <ndrochak@gol.com>
17314 * cfold.cs: Fixed compile blocker.
17316 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17318 * driver.cs: I was chekcing the key, not the file.
17320 2002-10-19 Ravi Pratap <ravi@ximian.com>
17322 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17323 message that we were generating - we just need to silently return
17326 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17328 * class.cs (Event.Define): Change my previous commit, as this
17329 breaks the debugger. This is a temporary hack, as it seems like
17330 the compiler is generating events incorrectly to begin with.
17332 * expression.cs (Binary.ResolveOperator): Added support for
17333 "U operator - (E x, E y)"
17335 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17338 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17339 init-only variables, but this path did not take into account that
17340 there might be also instance readonly variables. Correct this
17343 This fixes bug 32253
17345 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17348 * driver.cs: Change the extension for modules to `netmodule'
17350 * cs-parser.jay: Improved slightly the location tracking for
17351 the debugger symbols.
17353 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17354 modifiers that were specified instead of the hardcoded value
17355 (FamAndAssem). This was basically ignoring the static modifier,
17356 and others. Fixes 32429.
17358 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17359 fixed a bug in the process (32476)
17361 * expression.cs (ArrayAccess.EmitAssign): Patch from
17362 hwang_rob@yahoo.ca that fixes bug 31834.3
17364 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17366 * driver.cs: Make the module extension .netmodule.
17368 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17370 * driver.cs: Report an error if the resource file is not found
17371 instead of crashing.
17373 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17374 false, like Emit does.
17376 2002-10-16 Nick Drochak <ndrochak@gol.com>
17378 * typemanager.cs: Remove unused private member. Also reported mcs
17379 bug to report this as a warning like csc.
17381 2002-10-15 Martin Baulig <martin@gnome.org>
17383 * statement.cs (Statement.Emit): Made this a virtual method; emits
17384 the line number info and calls DoEmit().
17385 (Statement.DoEmit): New protected abstract method, formerly knows
17386 as Statement.Emit().
17388 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17390 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17392 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17393 have fixed a remaining problem: not every AddXXXX was adding a
17394 fully qualified name.
17396 Now everyone registers a fully qualified name in the DeclSpace as
17397 being defined instead of the partial name.
17399 Downsides: we are slower than we need to be due to the excess
17400 copies and the names being registered this way.
17402 The reason for this is that we currently depend (on the corlib
17403 bootstrap for instance) that types are fully qualified, because
17404 we dump all the types in the namespace, and we should really have
17405 types inserted into the proper namespace, so we can only store the
17406 basenames in the defined_names array.
17408 2002-10-10 Martin Baulig <martin@gnome.org>
17410 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17411 from bug #31834, see the bug report for a testcase which is
17414 2002-10-10 Martin Baulig <martin@gnome.org>
17416 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17417 flow analysis code for this.
17419 * statement.cs (Do, While, For): Tell the flow analysis code about
17421 (FlowBranching.UsageVector): Added support for infinite loops.
17422 (Block.Resolve): Moved the dead code elimination here and use flow
17425 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17427 * class.cs (Field.Define): Catch cycles on struct type
17430 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17431 fields if the fields are static. We only need to check instance
17434 * expression.cs (As.DoResolve): Test for reference type.
17436 * statement.cs (Using.ResolveExpression): Use
17437 ConvertImplicitRequired, not ConvertImplicit which reports an
17439 (Using.ResolveLocalVariableDecls): ditto.
17441 * expression.cs (Binary.ResolveOperator): Report errors in a few
17442 places where we had to.
17444 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17446 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17448 * expression.cs: Use StoreFromPtr instead of extracting the type
17449 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17451 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17452 an enumeration value to a System.Enum, but System.Enum is not a
17453 value type, but an class type, so we need to box.
17455 (Expression.ConvertExplicit): One codepath could return
17456 errors but not flag them. Fix this. Fixes #31853
17458 * parameter.cs (Resolve): Do not allow void as a parameter type.
17460 2002-10-06 Martin Baulig <martin@gnome.org>
17462 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17463 if it's a class type and not a struct. Fixes #31815.
17465 2002-10-06 Martin Baulig <martin@gnome.org>
17467 * statement.cs: Reworked the flow analysis code a bit to make it
17468 usable for dead code elimination.
17470 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17472 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17474 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17476 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17477 to fix the test 165, will investigate deeper.
17479 2002-10-04 Martin Baulig <martin@gnome.org>
17481 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17482 finally blocks actually work.
17483 (Try.Resolve): We don't need to create a sibling for `finally' if
17484 there is no finally block.
17486 2002-10-04 Martin Baulig <martin@gnome.org>
17488 * class.cs (Constructor.Define): The default accessibility for a
17489 non-default constructor is private, not public.
17491 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17493 * class.cs (Constructor): Make AllowedModifiers public, add
17496 * cs-parser.jay: Perform the modifiers test here, as the
17497 constructor for the Constructor class usually receives a zero
17498 because of the way we create it (first we create, later we
17499 customize, and we were never checking the modifiers).
17501 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17502 is a version of LookupTypeReflection that includes the type-name
17503 cache. This can be used as a fast path for functions that know
17504 the fully qualified name and are only calling into *.GetType() to
17505 obtain a composed type.
17507 This is also used by TypeManager.LookupType during its type
17510 (LookupType): We now also track the real type name, as sometimes
17511 we can get a quey for the real type name from things like
17512 ComposedCast. This fixes bug 31422.
17514 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17515 complete type fullname, it does not have to go through the type
17516 resolution system to obtain the composed version of the type (for
17517 obtaining arrays or pointers).
17519 (Conditional.Emit): Use the EmitBoolExpression to
17520 generate nicer code, as requested by Paolo.
17522 (ArrayCreation.CheckIndices): Use the patch from
17523 hwang_rob@yahoo.ca to validate the array initializers.
17525 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17527 * class.cs (ConstructorInitializer.Emit): simplify code by using
17528 Invocation.EmitCall, and at the same time, fix the bugs in calling
17529 parent constructors that took variable arguments.
17531 * ecore.cs (Expression.ConvertNumericExplicit,
17532 Expression.ImplicitNumericConversion): Remove the code that
17533 manually wrapped decimal (InternalTypeConstructor call is now gone
17536 * expression.cs (Cast.TryReduce): Also handle decimal types when
17537 trying to perform a constant fold on the type.
17539 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17541 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17542 that only turned off an error report, and did nothing else.
17544 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17546 * driver.cs: Handle and ignore /fullpaths
17548 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17550 * expression.cs (Binary.ResolveOperator): Catch the case where
17551 DoNumericPromotions returns true,
17553 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17555 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17557 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17560 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17562 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17563 conversion exists, but it is also required that the conversion be
17564 performed. This manifested in "(Type64Enum) 2".
17566 * class.cs (TypeManager.AddMethod): The fix is not to change
17567 AddEnum, because that one was using a fully qualified name (every
17568 DeclSpace derivative does), but to change the AddMethod routine
17569 that was using an un-namespaced name. This now correctly reports
17570 the duplicated name.
17572 Revert patch until I can properly fix it. The issue
17573 is that we have a shared Type space across all namespaces
17574 currently, which is wrong.
17576 Options include making the Namespace a DeclSpace, and merge
17577 current_namespace/current_container in the parser.
17579 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17581 * cs-parser.jay: Improve error reporting when we get a different
17582 kind of expression in local_variable_type and
17583 local_variable_pointer_type.
17585 Propagate this to avoid missleading errors being reported.
17587 * ecore.cs (ImplicitReferenceConversion): treat
17588 TypeManager.value_type as a target just like object_type. As
17593 Is valid, and needs to result in the int 1 being boxed before it
17594 is assigned to the value type v.
17596 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17597 to validate the enumeration name.
17599 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17600 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17601 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17603 * ecore.cs (TryImplicitIntConversion): When doing an
17604 implicit-enumeration-conversion, check if the type is 64-bits and
17605 perform a conversion before passing to EnumConstant.
17607 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17609 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17610 report ambiguous type references. Unlike the MS version, we
17611 report what the ambiguity is. Innovation at work ;-)
17613 (DeclSpace.FindType): Require a location argument to
17614 display when we display an ambiguous error.
17616 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17618 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17620 * expression.cs (EmitDynamicInitializers): Apply patch from
17621 hwang_rob@yahoo.ca that fixes the order in which we emit our
17624 2002-09-21 Martin Baulig <martin@gnome.org>
17626 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17627 delegate takes no arguments.
17629 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17631 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17634 * expression.cs: Extract the underlying type.
17636 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17638 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17640 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17642 * class.cs (TypeContainer.DefineType): We can not use the nice
17643 PackingSize with the size set to 1 DefineType method, because it
17644 will not allow us to define the interfaces that the struct
17647 This completes the fixing of bug 27287
17649 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17650 means also structs. This fixes part of the problem.
17651 (Expresion.ImplicitReferenceConversionExists): ditto.
17653 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17654 error if there were no errors reported during the type lookup
17655 process, to avoid duplicates or redundant errors. Without this
17656 you would get an ambiguous errors plus a type not found. We have
17657 beaten the user enough with the first error.
17659 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17662 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17663 during the resolution process, stop the lookup, this avoids
17664 repeated error reports (same error twice).
17666 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17668 * typemanager.cs (LookupType): Redo the type lookup code to match
17669 the needs of System.Reflection.
17671 The issue is that System.Reflection requires references to nested
17672 types to begin with a "+" sign instead of a dot. So toplevel
17673 types look like: "NameSpace.TopLevelClass", and nested ones look
17674 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17677 2002-09-19 Martin Baulig <martin@gnome.org>
17679 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17680 says that a method always returns or always throws an exception,
17681 don't report the CS0161.
17683 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17684 set `Returns = new_returns'.
17686 2002-09-19 Martin Baulig <martin@gnome.org>
17688 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17689 to an enum constant, check for a CS0176.
17691 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17693 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17694 for operators that must be in pairs and report errors.
17696 * ecore.cs (SimpleName.DoResolveType): During the initial type
17697 resolution process, when we define types recursively, we must
17698 check first for types in our current scope before we perform
17699 lookups in the enclosing scopes.
17701 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17703 (Invocation.VerifyArgumentsCompat): Call
17704 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17705 I thought we were supposed to always call this, but there are a
17706 few places in the code where we dont do it.
17708 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17710 * driver.cs: Add support in -linkres and -resource to specify the
17711 name of the identifier.
17713 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17715 * ecore.cs (StandardConversionExists): Sync with the conversion
17716 code: allow anything-* to void* conversions.
17718 (FindMostSpecificSource): Use an Expression argument
17719 instead of a Type, because we might be handed over a Literal which
17720 gets a few more implicit conversions that plain types do not. So
17721 this information was being lost.
17723 Also, we drop the temporary type-holder expression when not
17726 2002-09-17 Martin Baulig <martin@gnome.org>
17728 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17729 this is an explicit interface implementation.
17731 2002-09-17 Martin Baulig <martin@gnome.org>
17733 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17734 different `IndexerName' attributes.
17736 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17737 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17738 virtual CommonResolve().
17740 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17742 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17743 and convert that to the UnderlyingType.
17745 * statement.cs (Foreach.Resolve): Indexers are just like variables
17746 or PropertyAccesses.
17748 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17749 inside quoted strings, we were not doing this before.
17751 2002-09-16 Martin Baulig <martin@gnome.org>
17753 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17754 resolve it. This is needed for the definite assignment check of the
17755 instance expression, fixes bug #29846.
17756 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17758 2002-09-16 Nick Drochak <ndrochak@gol.com>
17760 * parameter.cs: Fix compile error. Cannot reference static member
17761 from an instance object. Is this an mcs bug?
17763 2002-09-14 Martin Baulig <martin@gnome.org>
17765 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17766 multiple times. Fixes bug #30295, added test-166.cs.
17768 2002-09-14 Martin Baulig <martin@gnome.org>
17770 * statement.cs (Block.Emit): Don't emit unreachable code.
17771 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17772 `break' statements.
17773 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17775 2002-09-14 Martin Baulig <martin@gnome.org>
17777 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17780 2002-09-14 Martin Baulig <martin@gnome.org>
17782 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17783 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17784 be false on the ms runtime.
17786 2002-09-13 Martin Baulig <martin@gnome.org>
17788 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17789 the CS0038 error message.
17791 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17793 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17794 constant inside, return it.
17796 2002-09-12 Martin Baulig <martin@gnome.org>
17798 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17799 implicit conversion can be done between enum types.
17801 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17802 check whether an implicit conversion to the current enum's UnderlyingType
17803 exists and report an error if not.
17805 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17806 without debugging support.
17808 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17809 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17811 2002-09-12 Martin Baulig <martin@gnome.org>
17813 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17815 * ecore.cs (IMemberExpr.DeclaringType): New property.
17816 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17817 nonstatic member of an outer type (CS0038).
17819 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17821 * driver.cs: Activate the using-error detector at warning level
17822 4 (at least for MS-compatible APIs).
17824 * namespace.cs (VerifyUsing): Small buglett fix.
17826 * pending.cs (PendingImplementation): pass the container pointer.
17828 * interface.cs (GetMethods): Allow for recursive definition. Long
17829 term, I would like to move every type to support recursive
17830 definitions, not the current ordering mechanism that we have right
17833 The situation is this: Attributes are handled before interfaces,
17834 so we can apply attributes to interfaces. But some attributes
17835 implement interfaces, we will now handle the simple cases
17836 (recursive definitions will just get an error).
17838 * parameter.cs: Only invalidate types at the end if we fail to
17841 2002-09-09 Martin Baulig <martin@gnome.org>
17843 * ecore.cs (PropertyExpr.Emit): Also check for
17844 TypeManager.system_int_array_get_length so this'll also work when
17845 compiling corlib. Fixes #30003.
17847 2002-09-09 Martin Baulig <martin@gnome.org>
17849 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17850 and throw an exception if we can't get the type's size. Fixed #30040,
17853 2002-09-09 Martin Baulig <martin@gnome.org>
17855 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17857 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17858 context. Fixes bug #30027.
17860 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17861 virtual functions. Fixes bug #30043, added test-164.cs.
17863 2002-09-08 Ravi Pratap <ravi@ximian.com>
17865 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17867 2002-09-08 Nick Drochak <ndrochak@gol.com>
17869 * driver.cs: Use an object to get the windows codepage since it's not a
17872 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17874 * statement.cs (For.Emit): for infinite loops (test == null)
17875 return whether there is a break inside, not always "true".
17877 * namespace.cs (UsingEntry): New struct to hold the name of the
17878 using definition, the location where it is defined, and whether it
17879 has been used in a successful type lookup.
17881 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17886 2002-09-06 Ravi Pratap <ravi@ximian.com>
17888 * attribute.cs : Fix incorrect code which relied on catching
17889 a NullReferenceException to detect a null being passed in
17890 where an object was expected.
17892 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17894 * statement.cs (Try): flag the catch variable as assigned
17896 * expression.cs (Cast): Simplified by using ResolveType instead of
17897 manually resolving.
17899 * statement.cs (Catch): Fix bug by using ResolveType.
17901 2002-09-06 Ravi Pratap <ravi@ximian.com>
17903 * expression.cs (BetterConversion): Special case for when we have
17904 a NullLiteral as the argument and we have to choose between string
17905 and object types - we choose string the way csc does.
17907 * attribute.cs (Attribute.Resolve): Catch the
17908 NullReferenceException and report error #182 since the Mono
17909 runtime no more has the bug and having this exception raised means
17910 we tried to select a constructor which takes an object and is
17913 2002-09-05 Ravi Pratap <ravi@ximian.com>
17915 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17916 message (1502, 1503) when we can't locate a method after overload
17917 resolution. This is much more informative and closes the bug
17920 * interface.cs (PopulateMethod): Return if there are no argument
17921 types. Fixes a NullReferenceException bug.
17923 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17924 expressions too. Previously we were checking only in one place for
17925 positional arguments leaving out named arguments.
17927 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17928 type to the enum type is not allowed. Remove code corresponding to
17931 (ConvertNumericExplicit): Allow explicit conversions from
17932 the underlying type to enum type. This precisely follows the spec
17933 and closes a bug filed by Gonzalo.
17935 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17938 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17940 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17942 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17943 it was important that we stored the right value after the
17944 reduction in `converted'.
17946 2002-09-04 Martin Baulig <martin@gnome.org>
17948 * location.cs (Location.SymbolDocument): Use full pathnames for the
17951 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17953 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17954 of the expression resolve mechanism, because that will catch the
17955 SimpleName error failures.
17957 (Conditional): If we can not resolve the
17958 expression, return, do not crash.
17960 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17963 (location): display token name instead of its number.
17965 2002-08-28 Martin Baulig <martin@gnome.org>
17967 * expression.cs (Binary.ResolveOperator): Don't silently return
17968 but return an error if an operator cannot be applied between two
17971 2002-08-28 Martin Baulig <martin@gnome.org>
17973 * class.cs (Constructor.Define): Set the permission attributes
17974 correctly instead of making all constructors public.
17976 2002-08-28 Martin Baulig <martin@gnome.org>
17978 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17979 for private members before reporting a CS0103; if we find anything,
17982 2002-08-28 Martin Baulig <martin@gnome.org>
17984 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17985 to check whether `closure_start_type == closure_invocation_type',
17986 we also need to check whether `m.DeclaringType == closure_invocation_type'
17987 before bypassing the permission checks. We might be accessing
17988 protected/private members from the base class.
17989 (TypeManager.RealMemberLookup): Only set private_ok if private
17990 members were requested via BindingFlags.NonPublic.
17992 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17994 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17995 MethodGroupExpr.IsExplicitImpl if appropriate.
17996 (Invocation.DoResolve): Don't report the CS0120 for explicit
17997 interface implementations.
17999 2002-08-27 Martin Baulig <martin@gnome.org>
18001 * expression.cs (Invocation.DoResolve): If this is a static
18002 method and we don't have an InstanceExpression, we must report
18005 2002-08-25 Martin Baulig <martin@gnome.org>
18007 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18008 `==' between a valuetype and an object.
18010 2002-08-25 Miguel de Icaza <miguel@ximian.com>
18012 * ecore.cs (TypeExpr): Provide a ToString method.
18014 2002-08-24 Martin Baulig <martin@gnome.org>
18016 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18017 now called proggie.dbg and it's a binary file.
18019 2002-08-23 Martin Baulig <martin@gnome.org>
18021 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18023 2002-08-23 Martin Baulig <martin@gnome.org>
18025 * struct.cs (MyStructInfo.ctor): Make this work with empty
18026 structs; it's not allowed to use foreach() on null.
18028 2002-08-23 Martin Baulig <martin@gnome.org>
18030 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18031 writer the full pathname of the generated assembly.
18033 2002-08-23 Martin Baulig <martin@gnome.org>
18035 * statements.cs (FlowBranching.UsageVector.MergeChildren):
18036 A `finally' block never returns or breaks; improved handling of
18039 2002-08-23 Martin Baulig <martin@gnome.org>
18041 * statement.cs (Throw.Resolve): Allow `throw null'.
18043 2002-08-23 Martin Baulig <martin@gnome.org>
18045 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18046 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18047 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
18048 MemberLookup would return a wrong event if this is an explicit
18049 interface implementation and the class has an event with the same
18052 2002-08-23 Martin Baulig <martin@gnome.org>
18054 * statement.cs (Block.AddChildVariableNames): New public method.
18055 (Block.AddChildVariableName): Likewise.
18056 (Block.IsVariableNameUsedInChildBlock): Likewise.
18057 (Block.AddVariable): Check whether a variable name has already
18058 been used in a child block.
18060 * cs-parser.jay (declare_local_variables): Mark all variable names
18061 from the current block as being used in a child block in the
18064 2002-08-23 Martin Baulig <martin@gnome.org>
18066 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18067 find the symbol writer.
18069 * driver.cs: csc also allows the arguments to /define being
18070 separated by commas, not only by semicolons.
18072 2002-08-23 Martin Baulig <martin@gnome.org>
18074 * interface.cs (Interface.GetMembers): Added static check for events.
18076 2002-08-15 Martin Baulig <martin@gnome.org>
18078 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18079 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18081 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18082 why the MethodData.EmitDestructor() change was necessary.
18084 2002-08-20 Martin Baulig <martin@gnome.org>
18086 * class.cs (TypeContainer.FindMembers): Added static check for events.
18088 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18090 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18091 use Type.GetEvents(), not Type.FindMembers().
18093 2002-08-20 Martin Baulig <martin@gnome.org>
18095 * decl.cs (MemberCache): Added a special method cache which will
18096 be used for method-only searched. This ensures that a method
18097 search will return a MethodInfo with the correct ReflectedType for
18100 2002-08-20 Martin Baulig <martin@gnome.org>
18102 * decl.cs (DeclSpace.FindMembers): Made this public.
18104 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18106 * delegate.cs: fixed build on windows.
18107 [FIXME: Filed as bug #29150: MCS must report these errors.]
18109 2002-08-19 Ravi Pratap <ravi@ximian.com>
18111 * ecore.cs (StandardConversionExists): Return a false
18112 if we are trying to convert the void type to anything else
18113 since that is not allowed.
18115 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18116 we flag error 70 in the event an event is trying to be accessed
18117 directly from outside the declaring type.
18119 2002-08-20 Martin Baulig <martin@gnome.org>
18121 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18122 MemberCache from typemanager.cs to decl.cs.
18124 2002-08-19 Martin Baulig <martin@gnome.org>
18126 * class.cs (TypeContainer): Implement IMemberContainer.
18127 (TypeContainer.DefineMembers): Create the MemberCache.
18128 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18129 return public members if BindingFlags.Public was given, check
18130 whether members are static.
18132 2002-08-16 Martin Baulig <martin@gnome.org>
18134 * decl.cs (DeclSpace.Define): Splitted this in Define and
18135 DefineMembers. DefineMembers is called first and initializes the
18138 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18139 DefineMembers() on all our DeclSpaces.
18141 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18142 but call DefineMembers() on all nested interfaces. We call their
18143 Define() in our new Define() function.
18145 * interface.cs (Interface): Implement IMemberContainer.
18146 (Interface.Define): Moved all code except the attribute stuf to
18148 (Interface.DefineMembers): Initialize the member cache.
18150 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18151 need this anymore since we can use MemberCache.FindMembers directly.
18153 2002-08-19 Martin Baulig <martin@gnome.org>
18155 * typemanager.cs (MemberCache): When creating the cache for an
18156 interface type, add all inherited members.
18157 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18158 to `out bool used_cache' and documented it.
18159 (TypeManager.MemberLookup): If we already used the cache in the first
18160 iteration, we don't need to do the interfaces check.
18162 2002-08-19 Martin Baulig <martin@gnome.org>
18164 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18165 here from IMemberFinder and don't implement this interface anymore.
18166 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18168 * typemanager.cs (IMemberFinder): This interface is now only used by
18169 classes which actually support the member cache.
18170 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18171 since we only put DeclSpaces into this Hashtable.
18172 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18173 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18175 2002-08-16 Martin Baulig <martin@gnome.org>
18177 * typemanager.cs (ICachingMemberFinder): Removed.
18178 (IMemberFinder.MemberCache): New property.
18179 (TypeManager.FindMembers): Merged this with RealFindMembers().
18180 This function will never be called from TypeManager.MemberLookup()
18181 so we can't use the cache here, just the IMemberFinder.
18182 (TypeManager.MemberLookup_FindMembers): Check whether the
18183 IMemberFinder has a MemberCache and call the cache's FindMembers
18185 (MemberCache): Rewrote larger parts of this yet another time and
18186 cleaned it up a bit.
18188 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18190 * driver.cs (LoadArgs): Support quoting.
18192 (Usage): Show the CSC-like command line arguments.
18194 Improved a few error messages.
18196 2002-08-15 Martin Baulig <martin@gnome.org>
18198 * typemanager.cs (IMemberContainer.Type): New property.
18199 (IMemberContainer.IsInterface): New property.
18201 The following changes are conditional to BROKEN_RUNTIME, which is
18202 defined at the top of the file.
18204 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18205 class'es members, but add all members from TypeHandle.ObjectType
18206 if we're an interface.
18207 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18208 is the current type.
18209 (MemberCache.CacheEntry.Container): Removed this field.
18210 (TypeHandle.GetMembers): Include inherited members.
18212 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18214 * typemanager.cs: fixed compilation and added a comment on a field that
18217 2002-08-15 Martin Baulig <martin@gnome.org>
18219 * class.cs (ConstructorInitializer.Resolve): In the
18220 Expression.MemberLookup call, use the queried_type as
18223 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18224 declared' attribute, it's always true.
18225 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18226 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18227 temporary wrapper for FindMembers which tells MemberLookup whether
18228 members from the base classes are included in the return value.
18229 This will go away soon.
18230 (TypeManager.MemberLookup): Use this temporary hack here; once the
18231 new MemberCache is completed, we don't need to do the DeclaredOnly
18232 looping here anymore since the MemberCache will take care of this.
18233 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18234 (MemberCache): When creating the MemberCache for a class, get
18235 members from the current class and all its base classes.
18236 (MemberCache.CacheEntry.Container): New field. This is a
18237 temporary hack until the Mono runtime is fixed to distinguish
18238 between ReflectedType and DeclaringType. It allows us to use MCS
18239 with both the MS runtime and the unfixed Mono runtime without
18240 problems and without accecting performance.
18241 (MemberCache.SearchMembers): The DeclaredOnly looping from
18242 TypeManager.MemberLookup is now done here.
18244 2002-08-14 Martin Baulig <martin@gnome.org>
18246 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18247 Type.GetFields on dynamic types but get the fields from the
18248 corresponding TypeContainer.
18249 (MyStructInfo.GetStructInfo): Added check for enum types.
18251 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18252 (MemberList.SyncRoot): Implemented.
18253 (TypeManager.FilterWithClosure): No need to check permissions if
18254 closure_start_type == closure_invocation_type, don't crash if
18255 closure_invocation_type is null.
18257 2002-08-13 Martin Baulig <martin@gnome.org>
18259 Rewrote TypeContainer.FindMembers to use a member cache. This
18260 gives us a speed increase of about 35% for the self-hosting MCS
18261 build and of about 15-20% for the class libs (both on GNU/Linux).
18263 * report.cs (Timer): New class to get enhanced profiling. This
18264 whole class is "TIMER" conditional since it remarkably slows down
18267 * class.cs (MemberList): New class. This is an IList wrapper
18268 which we're now using instead of passing MemberInfo[]'s around to
18269 avoid copying this array unnecessarily.
18270 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18271 (ICachingMemberFinder, IMemberContainer): New interface.
18272 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18273 has already been checked, otherwise use it for the name comparision.
18274 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18275 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18276 if possible. Returns a MemberList, not a MemberInfo [].
18277 (TypeHandle): New class, implements IMemberContainer. We create
18278 one instance of this class per type, it contains a MemberCache
18279 which is used to do the member lookups.
18280 (MemberCache): New class. Each instance of this class contains
18281 all members of a type and a name-based hash table.
18282 (MemberCache.FindMembers): This is our new member lookup
18283 function. First, it looks up all members of the requested name in
18284 the hash table. Then, it walks this list and sorts out all
18285 applicable members and returns them.
18287 2002-08-13 Martin Baulig <martin@gnome.org>
18289 In addition to a nice code cleanup, this gives us a performance
18290 increase of about 1.4% on GNU/Linux - not much, but it's already
18291 half a second for the self-hosting MCS compilation.
18293 * typemanager.cs (IMemberFinder): New interface. It is used by
18294 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18295 Enum, Delegate or Interface.
18296 (TypeManager.finder_to_member_finder): New PtrHashtable.
18297 (TypeManager.finder_to_container): Removed.
18298 (TypeManager.finder_to_delegate): Removed.
18299 (TypeManager.finder_to_interface): Removed.
18300 (TypeManager.finder_to_enum): Removed.
18302 * interface.cs (Interface): Implement IMemberFinder.
18304 * delegate.cs (Delegate): Implement IMemberFinder.
18306 * enum.cs (Enum): Implement IMemberFinder.
18308 * class.cs (TypeContainer): Implement IMemberFinder.
18310 2002-08-12 Martin Baulig <martin@gnome.org>
18312 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18314 2002-08-12 Martin Baulig <martin@gnome.org>
18316 * ecore.cs (ITypeExpression): New interface for expressions which
18318 (TypeExpression): Renamed to TypeLookupExpression.
18319 (Expression.DoResolve): If we're doing a types-only lookup, the
18320 expression must implement the ITypeExpression interface and we
18321 call DoResolveType() on it.
18322 (SimpleName): Implement the new ITypeExpression interface.
18323 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18324 hack, the situation that we're only looking up types can't happen
18325 anymore when this method is called. Moved the type lookup code to
18326 DoResolveType() and call it.
18327 (SimpleName.DoResolveType): This ITypeExpression interface method
18328 is now doing the types-only lookup.
18329 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18330 (ResolveFlags): Added MaskExprClass.
18332 * expression.cs (MemberAccess): Implement the ITypeExpression
18334 (MemberAccess.DoResolve): Added support for a types-only lookup
18335 when we're called via ITypeExpression.DoResolveType().
18336 (ComposedCast): Implement the ITypeExpression interface.
18338 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18339 Expression.Resolve() with ResolveFlags.Type instead.
18341 2002-08-12 Martin Baulig <martin@gnome.org>
18343 * interface.cs (Interface.Define): Apply attributes.
18345 * attribute.cs (Attribute.ApplyAttributes): Added support for
18346 interface attributes.
18348 2002-08-11 Martin Baulig <martin@gnome.org>
18350 * statement.cs (Block.Emit): Only check the "this" variable if we
18351 do not always throw an exception.
18353 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18354 whether the property has a set accessor.
18356 2002-08-11 Martin Baulig <martin@gnome.org>
18358 Added control flow analysis support for structs.
18360 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18361 with control flow analysis turned off.
18362 (IVariable): New interface.
18363 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18364 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18365 (FieldExpr.DoResolve): Resolve the instance expression with flow
18366 analysis turned off and do the definite assignment check after the
18367 resolving when we know what the expression will resolve to.
18369 * expression.cs (LocalVariableReference, ParameterReference):
18370 Implement the new IVariable interface, only call the flow analysis
18371 code if ec.DoFlowAnalysis is true.
18372 (This): Added constructor which takes a Block argument. Implement
18373 the new IVariable interface.
18374 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18375 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18376 This does the definite assignment checks for struct members.
18378 * class.cs (Constructor.Emit): If this is a non-static `struct'
18379 constructor which doesn't have any initializer, call
18380 Block.AddThisVariable() to tell the flow analysis code that all
18381 struct elements must be initialized before control returns from
18384 * statement.cs (MyStructInfo): New public class.
18385 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18386 argument to this indexer. If non-zero, check an individual struct
18387 member, not the whole struct.
18388 (FlowBranching.CheckOutParameters): Check struct members.
18389 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18390 overloaded versions of these methods which take an additional
18391 `int field_idx' argument to check struct members.
18392 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18393 overloaded versions of these methods which take an additional
18394 `string field_name' argument to check struct member.s
18395 (VariableInfo): Implement the IVariable interface.
18396 (VariableInfo.StructInfo): New public property. Returns the
18397 MyStructInfo instance of the variable if it's a struct or null.
18398 (Block.AddThisVariable): New public method. This is called from
18399 Constructor.Emit() for non-static `struct' constructor which do
18400 not have any initializer. It creates a special variable for the
18401 "this" instance variable which will be checked by the flow
18402 analysis code to ensure that all of the struct's fields are
18403 initialized before control returns from the constructor.
18404 (UsageVector): Added support for struct members. If a
18405 variable/parameter is a struct with N members, we reserve a slot
18406 in the usage vector for each member. A struct is considered fully
18407 initialized if either the struct itself (slot 0) or all its
18408 members are initialized.
18410 2002-08-08 Martin Baulig <martin@gnome.org>
18412 * driver.cs (Driver.MainDriver): Only report an error CS5001
18413 if there were no compilation errors.
18415 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18416 `UnsafeContext' property to determine whether the parent is in
18417 unsafe context rather than checking the parent's ModFlags:
18418 classes nested in an unsafe class are unsafe as well.
18420 2002-08-08 Martin Baulig <martin@gnome.org>
18422 * statement.cs (UsageVector.MergeChildren): Distinguish between
18423 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18424 we return. Added test17() and test18() to test-154.cs.
18426 2002-08-08 Martin Baulig <martin@gnome.org>
18428 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18429 Family access, make sure the invoking type isn't a subclass of the
18430 queried type (that'd be a CS1540).
18432 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18433 this method which takes an additional `Type invocation_type'.
18435 * expression.cs (BaseAccess.DoResolve): Use the base type as
18436 invocation and query type.
18437 (MemberAccess.DoResolve): If the lookup failed and we're about to
18438 report a CS0122, try a lookup with the ec.ContainerType - if this
18439 succeeds, we must report a CS1540.
18441 2002-08-08 Martin Baulig <martin@gnome.org>
18443 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18444 (MethodGroupExpr): Implement the IMemberExpr interface.
18446 * expression (MemberAccess.ResolveMemberAccess): No need to have
18447 any special code for MethodGroupExprs anymore, they're now
18450 2002-08-08 Martin Baulig <martin@gnome.org>
18452 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18453 Family, FamANDAssem and FamORAssem permissions.
18454 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18456 2002-08-08 Martin Baulig <martin@gnome.org>
18458 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18459 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18462 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18464 * driver.cs: implemented /resource option to embed managed resources.
18466 2002-08-07 Martin Baulig <martin@gnome.org>
18468 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18469 (FieldBase.HasFieldInitializer): New public property.
18470 (FieldBase.GetInitializerExpression): New public method. Resolves and
18471 returns the field initializer and makes sure it is only resolved once.
18472 (TypeContainer.EmitFieldInitializers): Call
18473 FieldBase.GetInitializerExpression to get the initializer, this ensures
18474 that it isn't resolved multiple times.
18476 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18477 the resolving process (SimpleName/MemberLookup) that we're currently
18478 emitting a field initializer (which must not access any instance members,
18479 this is an error CS0236).
18481 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18482 argument, if the `IsFieldInitializer' flag is set, we must report and
18483 error CS0236 and not an error CS0120.
18485 2002-08-07 Martin Baulig <martin@gnome.org>
18487 * ecore.cs (IMemberExpr): New public interface.
18488 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18489 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18490 if the expression is an IMemberExpr.
18492 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18493 to be null, implicitly default to `this' if we're non-static in
18494 this case. Simplified the code a lot by using the new IMemberExpr
18495 interface. Also fixed bug #28176 here.
18497 2002-08-06 Martin Baulig <martin@gnome.org>
18499 * cs-parser.jay (SimpleLookup): Removed. We need to create
18500 ParameterReferences during semantic analysis so that we can do a
18501 type-only search when resolving Cast, TypeOf and SizeOf.
18502 (block): Pass the `current_local_parameters' to the Block's
18505 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18506 argument to the constructor.
18507 (ConstructorInitializer.Resolve): Create a temporary implicit
18508 block with the parameters.
18510 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18511 references here if we aren't doing a type-only search.
18513 * statement.cs (Block): Added constructor which takes a
18514 `Parameters parameters' argument.
18515 (Block.Parameters): New public property.
18517 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18518 to `Parameters' and made it public readonly.
18520 2002-08-06 Martin Baulig <martin@gnome.org>
18522 * ecore.cs (Expression.Warning): Made this public as well.
18524 * report.cs (Report.Debug): Print the contents of collections.
18526 2002-08-06 Martin Baulig <martin@gnome.org>
18528 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18529 used to tell Resolve() which kinds of expressions it may return.
18530 (Expression.Resolve): Added overloaded version of this method which
18531 takes a `ResolveFlags flags' argument. This can be used to tell
18532 Resolve() which kinds of expressions it may return. Reports a
18534 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18535 ResolveFlags.SimpleName.
18536 (Expression.Error118): Added overloaded version of this method which
18537 takes a `ResolveFlags flags' argument. It uses the flags to determine
18538 which kinds of expressions are allowed.
18540 * expression.cs (Argument.ResolveMethodGroup): New public method.
18541 Resolves an argument, but allows a MethodGroup to be returned.
18542 This is used when invoking a delegate.
18544 * TODO: Updated a bit.
18546 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18548 Fixed compilation with csc.
18550 * ecore.cs: Expression.Error made public. Is this correct? Should
18551 Warning be made public too?
18553 * expression.cs: use ea.Location instead of ea.loc.
18554 [FIXME: Filed as bug #28607: MCS must report these errors.]
18556 2002-08-06 Martin Baulig <martin@gnome.org>
18558 * ecore.cs (Expression.loc): Moved the location here instead of
18559 duplicating it in all derived classes.
18560 (Expression.Location): New public property.
18561 (Expression.Error, Expression.Warning): Made them non-static and
18562 removed the location argument.
18563 (Expression.Warning): Added overloaded version which takes an
18564 `int level' argument.
18565 (Expression.Error118): Make this non-static and removed the
18566 expression and location arguments.
18567 (TypeExpr): Added location argument to the constructor.
18569 * expression.cs (StaticCallExpr): Added location argument to
18571 (Indirection, PointerArithmetic): Likewise.
18572 (CheckedExpr, UnCheckedExpr): Likewise.
18573 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18574 (StringPtr): Likewise.
18577 2002-08-05 Martin Baulig <martin@gnome.org>
18579 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18581 * assign.cs (Assign.DoResolve): Check whether the source
18582 expression is a value or variable.
18584 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18585 while resolving the corresponding blocks.
18587 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18588 an error, don't silently return null.
18590 * statement.cs (Block.AddVariable): Do the error reporting here
18591 and distinguish between CS0128 and CS0136.
18592 (Block.DoResolve): Report all unused labels (warning CS0164).
18593 (LabeledStatement): Pass the location to the constructor.
18594 (LabeledStatement.HasBeenReferenced): New property.
18595 (LabeledStatement.Resolve): Set it to true here.
18597 * statement.cs (Return.Emit): Return success even after reporting
18598 a type mismatch error (CS0126 or CS0127), this is what csc does and
18599 it avoids confusing the users with any consecutive errors.
18601 2002-08-05 Martin Baulig <martin@gnome.org>
18603 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18605 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18607 * expression.cs (MemberAccess.DoResolve): Silently return if an
18608 error has already been reported.
18610 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18611 error has already been reported.
18613 2002-08-05 Martin Baulig <martin@gnome.org>
18615 * statement.cs (UsageVector): Only initialize the `parameters'
18616 vector if we actually have any "out" parameters.
18618 2002-08-05 Martin Baulig <martin@gnome.org>
18620 * expression.cs (Binary.ResolveOperator): When combining delegates,
18621 they must have the same type.
18623 2002-08-05 Martin Baulig <martin@gnome.org>
18625 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18626 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18627 work with the ms runtime and we also don't need it: if we're a
18628 PropertyBuilder and not in the `indexer_arguments' hash, then we
18629 are a property and not an indexer.
18631 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18632 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18633 since the latter one doesn't work with the ms runtime.
18635 2002-08-03 Martin Baulig <martin@gnome.org>
18637 Fixed bugs #27998 and #22735.
18639 * class.cs (Method.IsOperator): New public field.
18640 (Method.CheckBase): Report CS0111 if there's already a method
18641 with the same parameters in the current class. Report CS0508 when
18642 attempting to change the return type of an inherited method.
18643 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18644 and it's not marked abstract or extern.
18645 (PropertyBase): New abstract base class for Property and Indexer.
18646 (PropertyBase.CheckBase): Moved here from Property and made it work
18648 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18649 the same so we can reuse it there.
18650 (Property, Indexer): Derive from PropertyBase.
18651 (MethodSignature.inheritable_property_signature_filter): New delegate
18652 to find properties and indexers.
18654 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18655 argument and improved error reporting.
18657 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18658 EmptyReadOnlyParameters and made it a property.
18660 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18661 version of this method which takes a `PropertyInfo indexer'.
18662 (TypeManager.RegisterIndexer): New method.
18664 * class.cs: Added myself as author of this file :-)
18666 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18668 * class.cs: fixed compilation on windoze.
18670 2002-08-03 Martin Baulig <martin@gnome.org>
18672 * interface.cs (Interface.GetInterfaceBases): Check whether all
18673 base interfaces are at least as accessible than the current one.
18675 * class.cs (TypeContainer.GetClassBases): Check whether base types
18676 are at least as accessible than the current type.
18677 (TypeContainer.AsAccessible): Implemented and made non-static.
18678 (MemberBase.CheckParameters): Report errors if the accessibility
18681 * delegate.cs (Delegate.Delegate): The default visibility is
18682 internal for top-level types and private for nested types.
18683 (Delegate.Define): Report errors if the accessibility checks fail.
18685 * enum.cs (Enum.Enum): The default visibility is internal for
18686 top-level types and private for nested types.
18687 (Enum.DefineType): Compute the correct visibility.
18689 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18690 function which takes a `bool is_toplevel' instead of a TypeContainer.
18692 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18695 2002-08-02 Martin Baulig <martin@gnome.org>
18697 * expression.cs (LocalVariableReferenc): Added constructor which
18698 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18699 (LocalVariableReference.IsReadOnly): New property.
18700 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18701 variable is readonly, use our own readonly flag to do this; you can
18702 use the new constructor to get a writable reference to a read-only
18705 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18706 reference to the local variable.
18708 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18710 * rootcontext.cs (ResolveCore): Also include System.Exception
18712 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18713 we reach an EmptyStatement.
18715 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18718 * expression.cs (Binary.ResolveOperator): Check error result in
18721 use brtrue/brfalse directly and avoid compares to null.
18723 2002-08-02 Martin Baulig <martin@gnome.org>
18725 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18726 Fixes bug #28407, added test-155.cs.
18728 2002-08-01 Martin Baulig <martin@gnome.org>
18730 * class.cs (Event.EmitDefaultMethod): Make this work with static
18731 events. Fixes #28311, added verify-3.cs.
18733 2002-08-01 Martin Baulig <martin@gnome.org>
18735 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18736 `is_disposable' fields.
18737 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18738 `hm.is_disposable' if we're using the collection pattern.
18739 (Foreach.EmitCollectionForeach): Use the correct type for the
18740 enumerator's local variable, only emit the try/finally block if
18741 necessary (fixes #27713).
18743 2002-08-01 Martin Baulig <martin@gnome.org>
18745 * ecore.cs (Expression.report118): Renamed to Error118 and made
18748 * statement.cs (Throw.Resolve): Check whether the expression is of
18749 the correct type (CS0118) and whether the type derives from
18750 System.Exception (CS0155).
18751 (Catch.Resolve): New method. Do the type lookup here and check
18752 whether it derives from System.Exception (CS0155).
18753 (Catch.CatchType, Catch.IsGeneral): New public properties.
18755 * typemanager.cs (TypeManager.exception_type): Added.
18757 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18759 * driver.cs: Updated About function.
18761 2002-07-31 Martin Baulig <martin@gnome.org>
18763 Implemented Control Flow Analysis.
18765 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18766 (EmitContext.CurrentBranching): Added.
18767 (EmitContext.StartFlowBranching): Added.
18768 (EmitContext.EndFlowBranching): Added.
18769 (EmitContext.KillFlowBranching): Added.
18770 (EmitContext.IsVariableAssigned): Added.
18771 (EmitContext.SetVariableAssigned): Added.
18772 (EmitContext.IsParameterAssigned): Added.
18773 (EmitContext.SetParameterAssigned): Added.
18774 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18775 Added control flow analysis stuff here.
18777 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18778 resolve the expression as lvalue.
18779 (LocalVariableReference.DoResolve): Check whether the variable has
18780 already been assigned.
18781 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18782 the parameter as assigned here.
18783 (ParameterReference.DoResolve): Check whether the parameter has already
18785 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18786 expression as lvalue.
18788 * statement.cs (FlowBranching): New class for the flow analysis code.
18789 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18790 (LabeledStatement.IsDefined): New public property.
18791 (LabeledStatement.AddUsageVector): New public method to tell flow
18792 analyis that the label may be reached via a forward jump.
18793 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18795 (VariableInfo.Number): New public field. This is used by flow analysis
18796 to number all locals of a block.
18797 (Block.CountVariables): New public property. This is the number of
18798 local variables in this block (including the locals from all parent
18800 (Block.EmitMeta): Number all the variables.
18802 * statement.cs: Added flow analysis support to all classes.
18804 2002-07-31 Martin Baulig <martin@gnome.org>
18806 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18807 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18808 then use this argument.
18810 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18812 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18813 use this to specify /define options.
18815 2002-07-29 Martin Baulig <martin@gnome.org>
18817 * statement.cs (Fixed): Moved all code that does variable lookups
18818 and resolvings from Emit to Resolve.
18820 * statement.cs (For): Moved all code that does variable lookups
18821 and resolvings from Emit to Resolve.
18823 * statement.cs (Using): Moved all code that does variable lookups
18824 and resolvings from Emit to Resolve.
18826 2002-07-29 Martin Baulig <martin@gnome.org>
18828 * attribute.cs (Attribute.Resolve): Explicitly catch a
18829 System.NullReferenceException when creating the
18830 CustromAttributeBuilder and report a different warning message.
18832 2002-07-29 Martin Baulig <martin@gnome.org>
18834 * support.cs (ParameterData.ParameterName): Added method to
18835 get the name of a parameter.
18837 * typemanager.cs (TypeManager.IsValueType): New public method.
18839 2002-07-29 Martin Baulig <martin@gnome.org>
18841 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18842 is a flag which specifies that it's either ref or out.
18843 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18844 the out parameter to `out Parameter.Modifier mod', also set the
18845 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18847 * support.cs (InternalParameters.ParameterModifier): Distinguish
18848 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18849 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18851 * expression.cs (Argument.GetParameterModifier): Distinguish
18852 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18853 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18855 2002-07-29 Martin Baulig <martin@gnome.org>
18857 * expression.cs (ParameterReference.ParameterReference): Added
18858 `Location loc' argument to the constructor.
18860 * cs-parser.jay: Pass location to ParameterReference.
18862 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18864 * statement.cs (Try): Initialize the location.
18866 * cs-parser.jay: pass location to Try.
18868 * expression.cs (Unary.Reduce): Change the prototype to return
18869 whether a constant fold could be performed or not. The result is
18870 returned in an out parameters. In the case of Indirection and
18871 AddressOf, we want to perform the full tests.
18873 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18875 * statement.cs (Statement.Emit): Flag dead code.
18877 2002-07-27 Andrew Birkett <andy@nobugs.org>
18879 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18881 2002-07-27 Martin Baulig <martin@gnome.org>
18883 * class.cs (MethodData.Define): Put back call to
18884 TypeManager.AddMethod(), accidentally commented this out.
18886 * report.cs (Debug): New public method to print debugging information,
18887 this is `[Conditional ("DEBUG")]'.
18889 2002-07-26 Martin Baulig <martin@gnome.org>
18891 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18892 (switch_statement): Push the current_block to the switch_stack and
18893 pop it again when we're done with the switch.
18894 (switch_section): The new block is a child of the current_block.
18895 Fixes bug #24007, added test-152.cs.
18897 2002-07-27 Martin Baulig <martin@gnome.org>
18899 * expression.cs (Invocation.EmitArguments): When calling a varargs
18900 function with only its fixed arguments, we need to pass an empty
18903 2002-07-27 Martin Baulig <martin@gnome.org>
18905 Mono 0.13 has been released.
18907 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18909 * driver.cs: Rename --resource to --linkres, because that is what
18910 we do currently, we dont support --resource yet.
18912 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18914 2002-07-25 Martin Baulig <martin@gnome.org>
18916 * class.cs (MethodData): New public class. This is a `method builder'
18917 class for a method or one accessor of a Property/Indexer/Event.
18918 (MethodData.GetMethodFlags): Moved here from MemberBase.
18919 (MethodData.ApplyAttributes): Likewise.
18920 (MethodData.ApplyObsoleteAttribute): Likewise.
18921 (MethodData.ApplyConditionalAttribute): Likewise.
18922 (MethodData.ApplyDllImportAttribute): Likewise.
18923 (MethodData.CheckAbstractAndExternal): Likewise.
18924 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18925 (MethodData.Emit): Formerly known as Method.Emit().
18926 (MemberBase): Moved everything which was specific to a single
18927 accessor/method to MethodData.
18928 (Method): Create a new MethodData and call Define() and Emit() on it.
18929 (Property, Indexer, Event): Create a new MethodData objects for each
18930 accessor and call Define() and Emit() on them.
18932 2002-07-25 Martin Baulig <martin@gnome.org>
18934 Made MethodCore derive from MemberBase to reuse the code from there.
18935 MemberBase now also checks for attributes.
18937 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18938 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18940 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18941 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18942 (MemberBase.ApplyAttributes): New virtual method; applies the
18943 attributes to a method or accessor.
18944 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18945 (MemberBase.ApplyConditionalAttribute): Likewise.
18946 (MemberBase.ApplyDllImportAttribute): Likewise.
18947 (MemberBase.CheckAbstractAndExternal): Likewise.
18948 (MethodCore.ParameterTypes): This is now a property instead of a
18949 method, it's initialized from DoDefineParameters().
18950 (MethodCore.ParameterInfo): Removed the set accessor.
18951 (MethodCore.DoDefineParameters): New protected virtual method to
18952 initialize ParameterTypes and ParameterInfo.
18953 (Method.GetReturnType): We can now simply return the MemberType.
18954 (Method.GetMethodFlags): Override the MemberBase version and add
18955 the conditional flags.
18956 (Method.CheckBase): Moved some code from Define() here, call
18957 DoDefineParameters() here.
18958 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18959 here to avoid some larger code duplication.
18960 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18961 ensure that abstract and external accessors don't declare a body.
18963 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18964 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18965 lookup in the attribute's parent classes, so we need to abort as soon
18966 as we found the first match.
18967 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18968 the attribute has no arguments.
18970 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18973 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18975 * cs-parser.jay: reverted previous patch.
18977 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18979 * cs-parser.jay: fixed bug #22119.
18981 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18983 * attribute.cs: fixed compilation. The error was:
18984 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18985 be assigned to before control leaves the current method."
18986 [FIXME: Filed as bug #28186: MCS must report this error.]
18988 2002-07-25 Martin Baulig <martin@gnome.org>
18990 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18991 method to pull the condition name ouf of a Conditional attribute.
18992 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18993 the obsolete message and error flag out of an Obsolete attribute.
18995 * class.cs (Method.GetMethodFlags): New public method to get the
18996 TypeManager.MethodFlags for this method.
18997 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18999 (Method.Define): Get and apply the Obsolete and Conditional attributes;
19000 if we're overriding a virtual function, set the new private variable
19001 `parent_method'; call the new TypeManager.AddMethod().
19003 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
19004 the MethodBuilder and the Method in a PtrHashtable.
19005 (TypeManager.builder_to_method): Added for this purpose.
19006 (TypeManager.MethodFlags): Added IsObsoleteError.
19007 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
19008 Obsolete and Conditional arguments in MethodBuilders. If we discover
19009 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19010 the message from the attribute.
19012 2002-07-24 Martin Baulig <martin@gnome.org>
19014 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19015 preprocessor directives, ensure that the argument to #define/#undef is
19016 exactly one identifier and that it's actually an identifier.
19018 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19021 2002-07-24 Martin Baulig <martin@gnome.org>
19023 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19024 initialize it to TypeManager.object_type in the constructor.
19025 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19026 of the `hm.get_current' method if we're using the collection pattern.
19027 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19028 for the explicit conversion to make it work when we're using the collection
19029 pattern and the `Current' property has a different return type than `object'.
19032 2002-07-24 Martin Baulig <martin@gnome.org>
19034 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19035 does not match, but don't report any errors. This method is called in
19036 order for all methods in a MethodGroupExpr until a matching method is
19037 found, so we don't want to bail out if the first method doesn't match.
19038 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19039 matches, report the 123. Fixes #28070.
19041 2002-07-24 Martin Baulig <martin@gnome.org>
19043 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19044 TypeManager.TypeToCoreType() to the top of the method so the
19045 following equality checks will work. Fixes #28107.
19047 2002-07-24 Martin Baulig <martin@gnome.org>
19049 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19050 operand is of type uint, and the other operand is of type sbyte,
19051 short or int, the operands are converted to type long." -
19052 Actually do what this comment already told us. Fixes bug #28106,
19055 2002-07-24 Martin Baulig <martin@gnome.org>
19057 * class.cs (MethodBase): New abstract class. This is now a base
19058 class for Property, Indexer and Event to avoid some code duplication
19059 in their Define() and DefineMethods() methods.
19060 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19061 generic methods for Define() and DefineMethods().
19062 (FieldBase): Derive from MemberBase, not MemberCore.
19063 (Property): Derive from MemberBase, not MemberCore.
19064 (Property.DefineMethod): Moved all the code from this method to the
19065 new MethodBase.DefineAccessor(), just call it with appropriate
19067 (Property.Define): Call the new Property.DoDefine(), this does some
19068 sanity checks and we don't need to duplicate the code everywhere.
19069 (Event): Derive from MemberBase, not MemberCore.
19070 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19071 accessors, this will also make them work with interface events.
19072 (Indexer): Derive from MemberBase, not MemberCore.
19073 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19074 (Indexer.Define): Use the new MethodBase functions.
19076 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19077 argument to the constructor.
19078 (Interface.FindMembers): Added support for interface events.
19079 (Interface.PopluateEvent): Implemented.
19081 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19083 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19085 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19086 but this is required to check for a method name being the same as
19087 the containing class.
19091 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19093 * interface.cs: initialize variable.
19095 2002-07-23 Martin Baulig <martin@gnome.org>
19097 Implemented the IndexerName attribute in interfaces.
19099 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19100 name if this is an explicit interface implementation.
19101 (Indexer.InterfaceIndexerName): New public variable. If we're
19102 implementing an interface indexer, this is the IndexerName in that
19103 interface. Otherwise, it's the IndexerName.
19104 (Indexer.DefineMethod): If we're implementing interface indexer,
19105 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19106 and Pending.ImplementIndexer methods.
19107 (Indexer.Define): Also define the PropertyBuilder if we're
19108 implementing an interface indexer and this is neither an explicit
19109 interface implementation nor do the IndexerName match the one in
19112 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19113 If a method is defined here, then we always need to create a proxy
19114 for it. This is used when implementing interface indexers.
19115 (Pending.IsInterfaceIndexer): New public method.
19116 (Pending.ImplementIndexer): New public method.
19117 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19118 This is used when implementing interface indexers to define a proxy
19120 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19121 define a proxy if necessary.
19123 * interface.cs (Interface.IndexerName): New public variable.
19124 (Interface.PopulateIndexer): Set the IndexerName.
19125 (Interface.DefineIndexers): New private method. Populate all the
19126 indexers and make sure their IndexerNames match.
19128 * typemanager.cs (IndexerPropertyName): Added support for interface
19131 2002-07-22 Martin Baulig <martin@gnome.org>
19133 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19134 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19135 ret if HasReturnLabel.
19136 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19139 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19140 and set the ec.LoopBeginTryCatchLevel.
19141 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19142 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19143 the current ec.TryCatchLevel, the branch goes out of an exception
19144 block. In this case, we need to use Leave and not Br.
19146 2002-07-22 Martin Baulig <martin@gnome.org>
19148 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19149 block unless the block does not always return or it is contained in
19150 another try { ... } catch { ... } block. Fixes bug #26506.
19151 Added verify-1.cs to the test suite.
19153 2002-07-22 Martin Baulig <martin@gnome.org>
19155 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19156 then we do not always return. Fixes bug #24985.
19158 2002-07-22 Martin Baulig <martin@gnome.org>
19160 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19161 lookup on a per-class level; ie. walk up the class hierarchy until we
19162 found at least one applicable method, then choose the best among them.
19163 Fixes bug #24463 and test-29.cs.
19165 2002-07-22 Martin Baulig <martin@gnome.org>
19167 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19168 return types of the methods. The return type is not part of the
19169 signature and we must not check it to make the `new' modifier work.
19170 Fixes bug #27999, also added test-147.cs.
19171 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19173 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19174 on the method's return type.
19176 2002-07-21 Martin Baulig <martin@gnome.org>
19178 * assign.cs: Make this work if the rightmost source is a constant and
19179 we need to do an implicit type conversion. Also adding a few more tests
19180 to test-38.cs which should have caught this.
19182 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19183 target in the makefile for this. The makefile.gnu is primarily intended
19184 for end-users who don't want to debug the compiler.
19186 2002-07-21 Martin Baulig <martin@gnome.org>
19188 * assign.cs: Improved the Assign class so it can now handle embedded
19189 assignments (X = Y = Z = something). As a side-effect this'll now also
19190 consume less local variables. test-38.cs now passes with MCS, added
19191 a few new test cases to that test.
19193 2002-07-20 Martin Baulig <martin@gnome.org>
19195 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19196 instructions. Fixes bug #27977, also added test-146.cs.
19198 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19200 * cs-tokenizer.cs: fixed getHex ().
19202 2002-07-19 Martin Baulig <martin@gnome.org>
19204 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19205 not Type.GetType() to lookup the array type. This is needed when
19206 we're constructing an array of a user-defined type.
19207 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19208 single-dimensional arrays, but also for single-dimensial arrays of
19211 2002-07-19 Martin Baulig <martin@gnome.org>
19213 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19214 this function is called, it's not allowed to share LocalBuilders
19215 among ILGenerators.
19217 2002-07-19 Martin Baulig <martin@gnome.org>
19219 * expression.cs (Argument.Resolve): Report an error 118 when trying
19220 to pass a type as argument.
19222 2002-07-18 Martin Baulig <martin@gnome.org>
19224 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19225 Conv_R_Un for the signed `long' type.
19227 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19229 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19230 `expr' for the temporary result, as that will fail if we do
19231 multiple resolves on the same expression.
19233 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19235 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19236 ec.TypeContainer for looking up aliases.
19238 * class.cs (TypeContainer): Remove LookupAlias from here.
19240 * decl.cs (DeclSpace); Move here.
19242 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19244 * class.cs (FindMembers): Only call filter if the constructor
19245 bulider is not null.
19247 Also handle delegates in `NestedTypes' now. Now we will perform
19248 type lookups using the standard resolution process. This also
19251 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19252 This uses Expressions (the limited kind that can be parsed by the
19253 tree) instead of strings.
19255 * expression.cs (ComposedCast.ToString): Implement, used to flag
19256 errors since now we have to render expressions.
19258 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19261 * ecore.cs (SimpleName.ToString): ditto.
19263 * cs-parser.jay: Instead of using strings to assemble types, use
19264 Expressions to assemble the type (using SimpleName, ComposedCast,
19265 MemberAccess). This should fix the type lookups in declarations,
19266 because we were using a different code path for this.
19268 * statement.cs (Block.Resolve): Continue processing statements
19269 even when there is an error.
19271 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19273 * class.cs (Event.Define): Also remove the `remove' method from
19274 the list of pending items.
19276 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19277 generate more compact code.
19279 2002-07-17 Martin Baulig <martin@gnome.org>
19281 * const.cs (Const.LookupConstantValue): Add support for constant
19282 `unchecked' and `checked' expressions.
19283 Also adding test case test-140.cs for this.
19285 2002-07-17 Martin Baulig <martin@gnome.org>
19287 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19288 check whether mi.ReturnType implements the IEnumerator interface; the
19289 `==' and the IsAssignableFrom() will fail in this situation.
19291 2002-07-16 Ravi Pratap <ravi@ximian.com>
19293 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19296 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19298 * expression.cs: fixed bug #27811.
19300 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19302 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19303 Molaro: when we are a ref, the value already contains a pointer
19304 value, do not take the address of it.
19306 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19307 * removed mb-parser.jay and mb-tokenizer.cs
19309 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19311 * expression.cs: check against the building corlib void type.
19313 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19315 * ecore.cs: fix for valuetype static readonly fields: when
19316 initializing them, we need their address, not the address of a copy.
19318 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19320 * typemanager.cs: register also enum_type in corlib.
19322 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19324 * class.cs: allow calling this (but not base) initializers in structs.
19326 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19328 * ecore.cs: make sure we compare against the building base types
19331 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19333 * typemanager.cs: fix TypeToCoreType() to handle void and object
19334 (corlib gets no more typerefs after this change).
19336 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19338 * expression.cs (ArrayCreation.EmitArrayArguments): use
19339 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19341 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19342 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19343 array indexes, the runtime actually forbids them.
19345 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19346 for array arguments here.
19348 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19349 instead of the default for ValueTypes.
19351 (New.DoEmit): Use IsValueType instead of
19352 IsSubclassOf (value_type)
19353 (New.DoResolve): ditto.
19354 (Invocation.EmitCall): ditto.
19356 * assign.cs (Assign): ditto.
19358 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19359 Statements *are* currently doing part of their resolution during
19362 Expressions do always resolve during resolve, but statements are
19363 only required to propagate resolution to their children.
19365 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19367 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19369 (LoadAssembly): Do not add the dll if it is already specified
19371 (MainDriver): Add the System directory to the link path at the end,
19372 after all the other -L arguments.
19374 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19375 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19376 ldelem.u1) and using the opposite for sbytes.
19378 This fixes Digger, and we can finally run it.
19380 * driver.cs (UnixParseOption): Move the option parsing here.
19381 (CSCParseOption): Implement CSC-like parsing of options.
19383 We now support both modes of operation, the old Unix way, and the
19384 new CSC-like way. This should help those who wanted to make cross
19385 platform makefiles.
19387 The only thing broken is that /r:, /reference: and /lib: are not
19388 implemented, because I want to make those have the same semantics
19389 as the CSC compiler has, and kill once and for all the confussion
19390 around this. Will be doing this tomorrow.
19392 * statement.cs (Unsafe.Resolve): The state is checked during
19393 resolve, not emit, so we have to set the flags for IsUnsfe here.
19395 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19397 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19398 not catch the Error_ObjectRefRequired in SimpleName (as it is
19399 possible to have a class/instance variable name that later gets
19400 deambiguated), we have to check this here.
19402 2002-07-10 Ravi Pratap <ravi@ximian.com>
19404 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19405 make static and put into Expression.
19407 (Event.Define): Register the private field of the event with the
19408 TypeManager so that GetFieldFromEvent can get at it.
19410 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19411 keep track of the private field associated with an event which
19414 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19417 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19419 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19421 * expression.cs (Binary.EmitBranchable): this routine emits the
19422 Binary expression in a branchable context. This basically means:
19423 we need to branch somewhere, not just get the value on the stack.
19425 This works together with Statement.EmitBoolExpression.
19427 * statement.cs (Statement.EmitBoolExpression): Use
19430 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19432 * statement.cs (For): Reduce the number of jumps in loops.
19434 (For): Implement loop inversion for the For statement.
19436 (Break): We can be breaking out of a Try/Catch controlled section
19437 (foreach might have an implicit try/catch clause), so we need to
19438 use Leave instead of Br.
19440 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19441 now). If the instace expression supports IMemoryLocation, we use
19442 the AddressOf method from the IMemoryLocation to extract the
19443 address instead of emitting the instance.
19445 This showed up with `This', as we were emitting the instance
19446 always (Emit) instead of the Address of This. Particularly
19447 interesting when This is a value type, as we dont want the Emit
19448 effect (which was to load the object).
19450 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19452 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19454 * statement.cs (Checked): Set the CheckedState during the resolve
19455 process too, as the ConvCast operations track the checked state on
19456 the resolve process, and not emit.
19458 * cs-parser.jay (namespace_member_declaration): Flag that we have
19459 found a declaration when we do. This is used to flag error 1529
19461 * driver.cs: Report ok when we display the help only.
19463 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19465 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19467 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19469 * cs-tokenizer.cs (define): We also have to track locally the
19470 defines. AllDefines is just used for the Conditional Attribute,
19471 but we also need the local defines for the current source code.
19473 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19475 * statement.cs (While, For, Do): These loops can exit through a
19476 Break statement, use this information to tell whether the
19477 statement is the last piece of code.
19479 (Break): Flag that we break.
19481 * codegen.cs (EmitContexts): New `Breaks' state variable.
19483 2002-07-03 Martin Baulig <martin@gnome.org>
19485 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19486 modifiers in method declarations in structs. Otherwise, you won't
19487 be able to override things like Object.Equals().
19489 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19491 * class.cs (Method, Property, Indexer): Do not allow the public
19492 modifier to be used in explicit interface implementations.
19494 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19495 override modifiers in method declarations in structs
19497 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19499 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19500 integer or real overflow, report an error
19502 2002-07-02 Martin Baulig <martin@gnome.org>
19504 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19505 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19506 to tell the runtime about our newly created System.Object and
19507 System.ValueType types.
19509 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19511 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19512 struct instead of Ldarg/Starg.
19514 2002-07-02 Martin Baulig <martin@gnome.org>
19516 * expression.cs (Indirection.Indirection): Call
19517 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19519 2002-07-02 Martin Baulig <martin@gnome.org>
19521 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19522 ValueType, call TypeManager.TypeToCoreType() on it.
19523 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19524 the OpCodes.Newarr argument.
19526 2002-07-02 Martin Baulig <martin@gnome.org>
19528 * expression.cs (Invocation.EmitCall): When compiling corlib,
19529 replace all calls to the system's System.Array type to calls to
19530 the newly created one.
19532 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19533 System.Array methods.
19534 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19535 from the system's System.Array type which must be replaced.
19537 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19539 * typemanager.cs: load unverifiable_code_ctor so we can build
19540 corlib using the correct type. Avoid using GetTypeCode() with
19542 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19543 TypeManager.object_type to allow building corlib.
19545 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19547 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19549 2002-07-01 Martin Baulig <martin@gnome.org>
19551 * class.cs: Make the last change actually work, we need to check
19552 whether `ifaces != null' to avoid a crash.
19554 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19556 * class.cs: when we build structs without fields that implement
19557 interfaces, we need to add the interfaces separately, since there is
19558 no API to both set the size and add the interfaces at type creation
19561 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19563 * expression.cs: the dimension arguments to the array constructors
19564 need to be converted if they are a long.
19566 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19568 * class.cs: don't emit ldarg.0 if there is no parent constructor
19569 (fixes showstopper for corlib).
19571 2002-06-29 Martin Baulig <martin@gnome.org>
19573 MCS now compiles corlib on GNU/Linux :-)
19575 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19576 ie. check for MethodImplOptions.InternalCall.
19578 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19579 and TypeManager.attribute_type are null, so we must explicitly check
19580 whether parent is not null to find out whether it's an attribute type.
19581 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19582 and SetBuilder, not only if the property is neither abstract nor external.
19583 This is necessary to set the MethodImplOptions on the accessor methods.
19584 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19585 SetBuilder, see Property.Emit().
19587 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19588 populate "System.Object", "System.ValueType" and "System.Attribute" since
19589 they've already been populated from BootCorlib_PopulateCoreTypes().
19591 2002-06-29 Martin Baulig <martin@gnome.org>
19593 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19594 is the NullLiteral, we also need to make sure that target_type is not
19597 2002-06-29 Martin Baulig <martin@gnome.org>
19599 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19600 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19601 before calling BootstrapCorlib_ResolveDelegate ().
19603 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19605 * statement.cs: fixed build-breaker. All tests passed ok.
19607 2002-06-27 Martin Baulig <martin@gnome.org>
19609 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19610 for System.Decimal when compiling corlib.
19612 2002-06-27 Martin Baulig <martin@gnome.org>
19614 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19615 switch blocks which contain nothing but a default clause.
19617 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19619 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19621 2002-06-27 Martin Baulig <martin@gnome.org>
19623 * ecore.cs (PropertyExpr.PropertyExpr): Call
19624 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19626 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19627 is already a TypeBuilder.
19629 2002-06-27 Martin Baulig <martin@gnome.org>
19631 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19632 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19633 the "from an array-type to System.Array" case. This makes it work
19634 when compiling corlib.
19636 2002-06-27 Martin Baulig <martin@gnome.org>
19638 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19639 non-static PropertyExpr, set its InstanceExpression. This makes
19640 the `ICollection.Count' property work in System/Array.cs.
19642 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19644 * driver.cs: Made error handling more consistent. Errors now
19645 tracked by Report class, so many methods which used to return int
19646 now return void. Main() now prints success/failure and
19647 errors/warnings message.
19649 Renamed '--probe' compiler argument to '--expect-error'. Removed
19650 the magic number return values (123 and 124). Now, if the
19651 expected error occurs, the compiler exits with success (exit value
19652 0). If the compilation completes without seeing that particular
19653 error, the compiler exits with failure (exit value 1). The
19654 makefile in mcs/errors has been changed to handle the new behaviour.
19656 * report.cs: Made 'expected error' number a property and renamed
19657 it from 'Probe' to 'ExpectedError'.
19659 * genericparser.cs: Removed error handling support, since it is
19660 now all done by Report class.
19662 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19663 class, so parse() no longer returns an int.
19665 * namespace.cs: Use Report.Error instead of GenericParser.error
19667 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19669 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19670 TypeContainer.AddOperator): At the front of the list put the
19671 explicit implementations, so they get resolved/defined first.
19673 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19675 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19676 interface type is implemented by this TypeContainer. Used during
19677 explicit interface implementation.
19679 (Property.Define, Indexer.Define, Method.Define): Validate that
19680 the given interface in the explicit implementation is one of the
19681 base classes for the containing type.
19683 Also if we are explicitly implementing an interface, but there is
19684 no match in the pending implementation table, report an error.
19686 (Property.Define): Only define the property if we are
19687 not explicitly implementing a property from an interface. Use the
19688 correct name also for those properties (the same CSC uses,
19689 although that is really not needed).
19691 (Property.Emit): Do not emit attributes for explicitly implemented
19692 properties, as there is no TypeBuilder.
19694 (Indexer.Emit): ditto.
19696 Hiding then means that we do not really *implement* a pending
19697 implementation, which makes code fail.
19699 2002-06-22 Martin Baulig <martin@gnome.org>
19701 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19702 the return value of Object.GetType(). [FIXME: we need to do this whenever
19703 we get a type back from the reflection library].
19705 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19707 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19709 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19711 * attribute.cs: Return null if we can not look up the type.
19713 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19714 the interface types found.
19716 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19717 interface types found.
19719 * typemanager.cs (GetInterfaces): Make this routine returns alll
19720 the interfaces and work around the lame differences between
19721 System.Type and System.Reflection.Emit.TypeBuilder in the results
19722 result for GetInterfaces.
19724 (ExpandInterfaces): Given an array of interface types, expand and
19725 eliminate repeated ocurrences of an interface. This expands in
19726 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19729 2002-06-21 Martin Baulig <martin@gnome.org>
19731 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19734 2002-06-21 Martin Baulig <martin@gnome.org>
19736 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19737 and called with one of the core types, return the corresponding typebuilder for
19740 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19743 2002-06-21 Martin Baulig <martin@gnome.org>
19745 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19746 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19747 (Expression.ConvertReferenceExplicit): Likewise.
19749 * expression.cs (ElementAccess.DoResolve): Likewise.
19750 (ElementAccess.DoResolveLValue): Likewise.
19752 2002-06-10 Martin Baulig <martin@gnome.org>
19754 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19755 add the "value" parameter to the parameter list.
19757 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19760 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19762 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19763 the argument to an int, uint, long or ulong, per the spec. Also
19764 catch negative constants in array creation.
19766 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19768 * class.cs: do not allow the same interface to appear twice in
19769 the definition list.
19771 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19773 * ecore.cs: don't use ldlen with System.Array.
19775 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19777 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19779 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19781 * modifiers.cs: produce correct field attributes for protected
19782 internal. Easy fix so miguel can work on ther harder stuff:-)
19784 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19786 * pending.cs: New file. Move the code from class.cs here.
19787 Support clearning the pending flag for all methods (when not doing
19788 explicit interface implementation).
19790 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19792 * rootcontext.cs: added a couple more types needed to bootstrap.
19794 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19796 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19797 constructor in the type, instead of any constructor in the type
19798 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19799 a bug in the Mono runtime when applying the params attribute).
19801 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19802 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19804 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19806 * expression.cs (Unary.ResolveOperator): Use TypeManager
19807 to resolve the type.
19809 2002-06-13 Ravi Pratap <ravi@ximian.com>
19811 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19814 * enum.cs (AddEnumMember): Add support to store the attributes associated
19815 with each member too.
19817 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19818 field builders too - this takes care of the enum member case.
19820 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19822 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19823 address-of operator on both value types and pointers.
19825 2002-06-10 Martin Baulig <martin@gnome.org>
19827 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19828 PropertyBuilder to the `property_builders' list.
19830 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19831 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19832 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19833 find any indexers which are inherited from an interface.
19835 2002-06-09 Martin Baulig <martin@gnome.org>
19837 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19838 the same type as the constant if necessary. There's also a test-130.cs
19841 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19843 * typemanager.cs (TypeManager.ChangeType): Previously known as
19844 Enum.ChangeEnumType().
19846 2002-06-09 Martin Baulig <martin@gnome.org>
19848 * expression.cs (Cast.TryReduce): Added support for consts.
19850 2002-06-08 Ravi Pratap <ravi@ximian.com>
19852 * class.cs (Accessor): Hold attributes information so we can pass
19855 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19856 Modify to pass in attributes attached to the methods.
19858 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19860 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19861 to handle the Accessor kind :-)
19863 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19865 2002-06-08 Martin Baulig <martin@gnome.org>
19867 * expression.cs (Unary.TryReduceNegative): Added support for
19870 2002-06-08 Martin Baulig <martin@gnome.org>
19872 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19873 name can't be found in the `defined_names' - the caller will do a
19874 MemberLookup in this case and thus find methods in System.Enum
19875 such as Enum.IsDefined().
19877 2002-06-08 Martin Baulig <martin@gnome.org>
19879 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19880 Convert.ChangeType() which works with TypeBuilder created types.
19881 (Enum.LookupEnumValue, Enum.Define): Use it here.
19883 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19884 `TypeBuilder.BaseType != null' check.
19885 (TypeContainer.FindMembers): Only lookup parent members if we
19886 actually have a parent.
19887 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19888 (ConstructorInitializer.Resolve): Likewise.
19890 * interface.cs (Interface.FindMembers): Added
19891 `TypeBuilder.BaseType != null' check.
19893 * rootcontext.cs (RootContext.ResolveCore): Added
19894 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19895 classes_second_stage.
19897 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19898 debug_type and trace_type when compiling with --nostdlib.
19900 2002-06-07 Martin Baulig <martin@gnome.org>
19902 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19903 (AddField): Set it to true when adding a non-static field.
19904 (DefineType): Use `have_nonstatic_fields' to find out whether we
19905 have non-static fields, not `Fields != null'.
19907 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19909 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19910 dereferencing a null on the static-field code path)
19912 2002-05-30 Martin Baulig <martin@gnome.org>
19914 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19915 to take command line arguments. Use reflection to call the new
19916 custom `Initialize' function on the symbol writer and pass it the
19917 command line arguments.
19919 * driver.cs (--debug-args): New command line argument to pass command
19920 line arguments to the symbol writer.
19922 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19924 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19925 the target type for indexers and properties. Thanks to Joe for
19928 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19930 * typemanager.cs (MethodFlags): returns the method flags
19931 (Obsolete/ShouldIgnore) that control warning emission and whether
19932 the invocation should be made, or ignored.
19934 * expression.cs (Invocation.Emit): Remove previous hack, we should
19935 not do this on matching a base type, we should do this based on an attribute
19937 Only emit calls to System.Diagnostics.Debug and
19938 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19939 on the command line.
19941 * rootcontext.cs: Global settings for tracing and debugging.
19943 * cs-tokenizer.cs (define): New utility function to track
19944 defines. Set the global settings for TRACE and DEBUG if found.
19946 2002-05-25 Ravi Pratap <ravi@ximian.com>
19948 * interface.cs (Populate*): Pass in the TypeContainer as well as
19949 the DeclSpace as parameters so that we can create EmitContexts and
19950 then use that to apply attributes etc.
19952 (PopulateMethod, PopulateEvent, PopulateProperty)
19953 (PopulateIndexer): Apply attributes everywhere.
19955 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19958 (ApplyAttributes): Update accordingly.
19960 We now apply interface attributes for all members too.
19962 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19964 * class.cs (Indexer.Define); Correctly check if we are explicit
19965 implementation (instead of checking the Name for a ".", we
19966 directly look up if the InterfaceType was specified).
19968 Delay the creation of the PropertyBuilder.
19970 Only create the PropertyBuilder if we are not an explicit
19971 interface implementation. This means that explicit interface
19972 implementation members do not participate in regular function
19973 lookups, and hence fixes another major ambiguity problem in
19974 overload resolution (that was the visible effect).
19976 (DefineMethod): Return whether we are doing an interface
19979 * typemanager.cs: Temporary hack until we get attributes in
19980 interfaces (Ravi is working on that) and we get IndexerName
19981 support in interfaces.
19983 * interface.cs: Register the indexers as properties.
19985 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19986 warning, I have verified that this is a bug in the .NET runtime
19987 (JavaScript suffers of the same problem).
19989 * typemanager.cs (MemberLookup): When looking up members for
19990 interfaces, the parent of an interface is the implicit
19991 System.Object (so we succeed in searches of Object methods in an
19992 interface method invocation. Example: IEnumerable x; x.ToString
19995 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19997 * class.cs (Event): Events should also register if they do
19998 implement the methods that an interface requires.
20000 * typemanager.cs (MemberLookup); use the new GetInterfaces
20003 (GetInterfaces): The code used to lookup interfaces for a type is
20004 used in more than one place, factor it here.
20006 * driver.cs: Track the errors at the bottom of the file, we kept
20009 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20010 instance if the method we are calling is static!
20012 2002-05-24 Miguel de Icaza <miguel@ximian.com>
20014 * attribute.cs (ApplyAttributes): Make this function filter out
20015 the IndexerName attribute (as that attribute in reality is never
20016 applied) and return the string constant for the IndexerName
20019 * class.cs (TypeContainer.Emit): Validate that all the indexers
20020 have the same IndexerName attribute, and if so, set the
20021 DefaultName attribute on the class.
20023 * typemanager.cs: The return value might contain other stuff (not
20024 only methods). For instance, consider a method with an "Item"
20025 property and an Item method.
20027 * class.cs: If there is a problem with the parameter types,
20030 2002-05-24 Ravi Pratap <ravi@ximian.com>
20032 * ecore.cs (ImplicitConversionExists): Wrapper function which also
20033 looks at user defined conversion after making a call to
20034 StandardConversionExists - we need this for overload resolution.
20036 * expression.cs : Update accordingly the various method calls.
20038 This fixes 2 bugs filed against implicit user defined conversions
20040 2002-05-22 Miguel de Icaza <miguel@ximian.com>
20042 * statement.cs: Track the result of the assignment.
20044 2002-05-21 Miguel de Icaza <miguel@ximian.com>
20046 * expression.cs (MemberAccess): Improved error reporting for
20047 inaccessible members.
20049 2002-05-22 Martin Baulig <martin@gnome.org>
20051 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
20052 itself with debugging support.
20054 2002-05-22 Martin Baulig <martin@gnome.org>
20056 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20057 Removed, this isn't needed anymore.
20059 2002-05-20 Martin Baulig <martin@gnome.org>
20061 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20062 be underlying type for an enum.
20064 2002-05-20 Miguel de Icaza <miguel@ximian.com>
20066 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20067 that splits out the loading of just the core types.
20069 * rootcontext.cs (ResolveCore): Split the struct resolution in
20070 two, so we can load the enumeration underlying types before any
20073 * expression.cs (Is): Bandaid until we fix properly Switch (see
20074 bug #24985 for details).
20076 * typemanager.cs (ImplementsInterface): The hashtable will contain
20077 a null if there are no interfaces implemented.
20079 2002-05-18 Miguel de Icaza <miguel@ximian.com>
20081 * cs-parser.jay (indexer_declarator): It is fine to have array
20084 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20086 * typemanager.cs: (RegisterBuilder): New function used to register
20087 TypeBuilders that implement interfaces. Since
20088 TypeBuilder.GetInterfaces (as usual) does not work with lame
20090 (AddUserType): register interfaces.
20092 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20093 dealing with TypeBuilder. Also, arrays are showing up as
20094 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20095 methods can not be invoked on them!
20097 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20098 (ImplicitReferenceConversionExists): Split out from
20099 StandardConversionExists.
20101 * expression.cs (As): We were only implementing one of the three
20102 cases for the as operator. We now implement them all.
20103 (Is): Implement the various other cases for Is as well.
20105 * typemanager.cs (CACHE): New define used to control if we want or
20106 not the FindMembers cache. Seems to have a negative impact on
20107 performance currently
20109 (MemberLookup): Nested types have full acess to
20110 enclosing type members
20112 Remove code that coped with instance/static returns for events, we
20113 now catch this in RealFindMembers.
20115 (RealFindMembers): only perform static lookup if the instance
20116 lookup did not return a type or an event.
20118 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20120 * assign.cs (CompoundAssign): We pass more semantic information
20121 now to Compound Assignments than we did before: now we have all
20122 the information at hand, and now we resolve the target *before* we
20123 do the expression expansion, which allows the "CacheValue" method
20124 to have the effect we intended (before, a [x] += 1 would generate
20125 two differen ArrayAccess expressions from the ElementAccess,
20126 during the resolution process).
20128 (CompoundAssign.DoResolve): Resolve target and original_source here.
20130 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20132 * expression.cs (ArrayAccess): dropped debugging information.
20134 * typemanager.cs: Small bug fix: I was always returning i_members,
20135 instead of one of i_members or s_members (depending on which had
20138 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20139 method is invoked before any code generation takes place, and it
20140 is a mechanism to inform that the expression will be invoked more
20141 than once, and that the method should use temporary values to
20142 avoid having side effects
20144 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20146 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20149 * expression.cs (Indirection, ArrayAccess): Add support for
20150 CacheTemporaries in these two bad boys.
20152 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20153 ldobj or ldind_ref.
20154 (StoreFromPtr): Handle stobj as well.
20156 * expression.cs (UnaryMutator): Share more code.
20158 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20159 down: I was not tracking the Filter function as well, which
20160 was affecting the results of the cache.
20162 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20164 * attribute.cs: Remove the hack to handle the CharSet property on
20167 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20169 * attribute.cs (DoResolve): More uglyness, we now only try to
20170 resolve the attribute partially, to extract the CharSet
20171 information (only if we are a StructLayout attribute). Otherwise
20173 (GetExtraTypeInfo): Add some code to conditionally kill in the
20174 future this. I am more and more convinced that the .NET
20175 framework has special code to handle the attribute setting on
20178 * expression.cs (IsParamsMethodApplicable): Revert my previous
20179 foreach change here, it was wrong.
20181 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20183 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20184 (pp_expr): do not abort on unknown input, just return.
20185 (eval): abort if there are pending chars.
20187 * attribute.cs (Attribute.Resolve): Positional parameters are
20188 optional. Deal with that case.
20190 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20191 the Ansi/Unicode/Auto information for the type.
20193 (TypeContainer.DefineType): instantiate the EmitContext here, as
20194 we will be using it during the type definition (to resolve
20195 attributes) and during the emit phase.
20197 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20198 to pull type information out of the attributes
20200 (Attribute.Resolve): track the constructor builder, and allow for
20201 multiple invocations (structs and classes will use this).
20203 * ecore.cs (MemberLookupFinal): new version with all the
20204 parameters customizable.
20206 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20207 constructors. Return if the result value is null (as the error
20208 would have been flagged already by MemberLookupFinal)
20210 Do not allow instances of abstract classes or interfaces to be
20213 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20214 We have to compare the assembly property here when dealing with
20215 FamANDAssem and Assembly access modifiers, because we might be
20216 creating an assembly from *modules* (that means that we are not
20217 getting TypeBuilders for types defined in other modules that are
20218 part of this assembly).
20220 (Method.Emit): If the method is marked abstract and has a body,
20223 (TypeContainer.DefineMembers): If both the defined member and the
20224 parent name match are methods, then do not emit any warnings: let
20225 the Method.Define routine take care of flagging warnings. But if
20226 there is a mismatch (method overrides something else, or method is
20227 overriwritten by something, then emit warning).
20229 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20230 set to null, this means `do not check for the return type on the
20233 (Method.Define): set the return type for the method signature to
20234 null, so that we get methods with the same name and parameters and
20235 different return types. This is used to flag warning 114 (you are
20236 hiding a method, and you probably want to use the new/override
20239 * typemanager.cs (MemberLookup): Implemented proper access
20240 control, closing a long standing set of bug reports. The problem
20241 was that the Framework only has two bits: Public and NonPublic,
20242 and NonPublic includes private and protected methods, but we need
20243 to enforce the FamANDAssem, FamOrAssem and Family.
20245 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20247 * statement.cs (GotoCase): Return true: Ammounts to giving up
20248 knowledge on whether we return or not, and letting the other case
20249 be responsible for it.
20251 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20253 * driver.cs: Do not load directories for each file processed, only
20254 do it if there is a pattern.
20256 * ecore.cs: Report readonly assigns here as well, as we might have
20257 been resolved only by MemberAccess.
20259 (SimpleName.SimpleNameResolve): Also be useful for LValue
20260 resolution. We need this to propagate assign to local readonly variables
20262 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20263 do not want to reuse potential criteria memory.
20265 * class.cs (MyEventBuilder): Set reflected_type;
20267 * ecore.cs (Constantify): Added support for constifying bools.
20269 (RootContext.LookupType): Added a cache for values looked up in
20270 the declaration space.
20272 * typemanager.cs (FindMembers): Now is a front-end to
20273 RealFindMembers, and provides a two-level hashtable-based cache to
20276 15% performance improvement: from 22.5 to 19.2 seconds.
20278 * expression.cs (IsParamsMethodApplicable): use foreach.
20279 (Invocation.DoResolve): ditto.
20280 (New.DoResolve): ditto.
20281 (ArrayCreation.DoResolve): ditto.
20283 * ecore.cs (FindMostEncompassingType): use foreach.
20285 * delegate.cs (NewDelegate.DoResolve): Use foreach
20287 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20288 (RemoveMethods): use foreach.
20290 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20291 nested foreach statements instead of for, and also break out of
20292 the inner loop once a match is found.
20294 (Invocation.OverloadResolve): Use foreach, simplify the code.
20296 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20298 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20299 we actually unwrap the expression to allow for extra information
20302 * expression.cs: Use Shr_Un on unsigned operations.
20304 2002-05-08 Ravi Pratap <ravi@ximian.com>
20306 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20307 applicable operators was not being considered correctly. This closes
20308 the bug Miguel reported.
20310 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20312 * attribute.cs: check that the type derives from System.Attribute
20313 and report the correct error in that case (moved the duplicate code to
20314 its own method, too).
20316 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20318 * attribute.cs: lookup attribute type name as the spec says: first the
20319 bare attribute name and then name + "Attribute" (nant compiles with
20320 mcs after this fix).
20322 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20324 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20325 Because of the way we parse things, we should try to see if a
20326 UIntConstant can fit in an integer.
20328 2002-05-07 Ravi Pratap <ravi@ximian.com>
20330 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20331 when we are in an explicit context.
20333 (ConvertReferenceExplicit): When converting from Iface type S to Class
20334 T make sure the rules are implemented as an OR.
20336 * parameter.cs (ParameterType): Make it a property for now although the
20337 purpose really isn't anything immediate.
20339 * expression.cs (Is*Applicable): Do better checking on the parameter type
20340 of a ref/out parameter. The ones from the system assemblies are already
20341 marked with the correct type so we don't need to do any correction.
20343 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20344 the object type is standard too so include that.
20346 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20348 * ecore.cs (StandardConversionExists): Augment with missing code:
20349 deal with IntConstant, LongConstants and Enumerations.
20351 * assign.cs: Report the error, instead of failing silently
20353 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20354 typecontainer that they are declared, because the
20355 typecontainer/namespace will have the list of using clauses that
20356 need to be applied.
20358 Assembly Attributes were escaping the normal registration
20361 (EmitCode): Apply attributes within an EmitContext that represents
20362 the container they were declared on.
20364 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20366 2002-05-06 Ravi Pratap <ravi@ximian.com>
20368 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20369 Revamp completely - make much cleaner as we now operate only
20372 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20373 to implement the logic detailed in the spec more correctly.
20375 (UserDefinedConversion): Update accordingly.
20377 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20379 * statement.cs: Return flow analysis information up.
20381 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20384 (token): Do not consume an extra character before calling
20387 2002-05-06 Piers Haken <piersh@friskit.com>
20389 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20391 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20393 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20394 EmitContext during the instance constructor initializer
20395 resolution, to stop access to instance variables.
20397 This is mandated by the spec, last paragraph of the `constructor
20398 initializers' section.
20400 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20402 * cs-parser.jay, class.cs (Accessor): new class used to represent
20403 an accessor (get or set). In the past we used `null' to represent
20404 a missing accessor. But this is ambiguous because there was no
20405 way to tell in abstract indexers/properties if one of them was
20408 Now there is a way of addressing that.
20410 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20411 instead of FindMembers.
20413 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20414 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20416 * attribute.cs: Treat indexers and properties as the same in terms
20417 of applying attributes
20419 * ecore.cs (FindMostEncompassedType): Use statically initialized
20420 EmptyExpressions()s like we do elsewhere to avoid creating useless
20421 objects (and we take this out of the tight loop).
20423 (GetConversionOperators): Move the code to extract the actual
20424 operators to a separate routine to clean things up.
20426 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20428 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20429 events are always registered FieldBuilders.
20431 * class.cs (FieldBase): New class shared by Fields
20433 * delegate.cs: If we are a toplevel delegate, use our full name.
20434 If we are a nested delegate, then only use our tail name.
20436 2002-05-02 Ravi Pratap <ravi@ximian.com>
20438 * expression.cs (IsApplicable): Ensure that we add the "&" to
20439 ref/out types before comparing it with the type of the argument.
20441 (IsParamsMethodApplicable): Ditto.
20443 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20446 * delegate.cs : Handle the case when we have more than one applicable
20447 method. Flag an error only when we finish checking all.
20449 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20451 * expression.cs: Add support for boolean static initializers.
20453 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20455 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20457 * parameter.cs (ComputeParameterTypes,
20458 ComputeAndDefineParameterTypes): Better error handling: now we
20459 clear the `types' cache if we fail during any of the type lookups.
20460 We also return the status code correctly to our caller
20462 * delegate.cs: If we fail to define a delegate, abort the extra
20465 * expression.cs (Binary.ResolveOperator): for
20466 operator==(object,object) and operator !=(object, object) we also
20467 have to verify that there is an implicit conversion from one to
20470 (ArrayAccess.DoResolve): Array Access can operate on
20473 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20475 * assign.cs (CompoundAssign): A new class used as a "flag" that
20476 the assignment actually is happening as part of a compound
20477 assignment operator.
20479 During compound assignment, a few new rules exist to enable things
20486 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20487 to the type of x) if y is implicitly convertible to the type of x,
20488 and the operator is a builtin operator and the return type of the
20489 operator is explicitly convertible to the type of x.
20491 * rootcontext.cs: Reset warning level to 2. 4 catches various
20492 "interesting" features in mcs, we must clean this up at some
20493 point, but currently am trying to kill other bugs ;-)
20495 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20496 in container classes as well.
20498 * expression.cs (Binary.ResolveOperator): Handle string case
20499 before anything else (as operator overloading does emit an error
20500 before doing anything else).
20502 This code could go away when we move to a table driven model, but
20503 i could not come up with a good plan last night.
20505 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20507 * typemanager.cs (CSharpName): reimplementation using regex.
20508 * class.cs: added null check for fields in Emit
20509 * rootcontext.cs: set warninglevel to 4
20511 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20513 * typemanager.cs (CSharpName): reimplemented with Lupus
20516 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20518 * statement.cs (If): correclty implement Resolve, because we were
20519 not catching sem errors in there. The same process is needed
20521 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20524 (Statement.Warning_DeadCodeFound): Factorize code.
20525 (While): Report dead code here too.
20527 (Statement): Added Resolve virtual method to allow
20528 for resolution split from the emit code.
20530 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20532 * statement.cs (EmitBoolExpression): No longer try to resolve the
20534 (MakeBoolean): New utility function that resolve, implicitly
20535 converts to boolean and tags the expression.
20538 (If, Do): Implement dead code elimination.
20539 (While): Implement loop inversion
20541 (Do, While, For, If): Resolve the expression prior to calling our
20544 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20547 - added method Report28 (warning: program has more than one entry point)
20548 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20549 - modified method Method.Define, the part at the end of the method
20551 * rootcontext.cs: added static public Location EntryPointLocation;
20553 * ../errors/cs0028.cs : Add test case for the above warning.
20556 - modified method CSharpName to allow arrays of primitive type to
20557 be printed nicely (e.g. instead of System.Int32[][] it now prints
20559 - added method CSharpSignature: returns the signature of a method
20560 in string format to be used in reporting errors, warnings, etc.
20562 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20565 2002-04-26 Ravi Pratap <ravi@ximian.com>
20567 * delegate.cs (Define): Fix extremely silly bug where I was
20568 setting the type of the 'object' parameter of the BeginInvoke
20569 method to System.IAsyncResult instead of System.Object ;-)
20571 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20573 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20576 (Constructor.Emit): return if we fail to initialize the
20577 constructor. Another door closed!
20579 * expression.cs (New.DoResolve): Improve error message (from -6 to
20580 1501). Use DeclaredOnly lookup to find the exact constructor.
20582 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20583 loop. This is useful.
20585 * cs-parser.jay: Adjust the default parameters so that destructors
20586 have the proper signature.
20588 2002-04-26 Martin Baulig <martin@gnome.org>
20590 * driver.cs (LoadAssembly): If `assembly' contains any characters
20591 which are only valid in path names and not in assembly names
20592 (currently slash, backslash and point), use Assembly.LoadFrom ()
20593 instead of Assembly.Load () on the `assembly' (before iteration
20594 over the link_paths).
20596 2002-04-26 Martin Baulig <martin@gnome.org>
20598 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20600 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20602 * class.cs (Property): use the new typemanager.MemberLookup
20604 (TypeContainer.MemberLookup): Implement using the
20605 TypeManager.MemberLookup now.
20607 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20608 and return MemberInfos, so that these can be used without an
20609 EmitContext (what we had before).
20611 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20613 * expression.cs: Fix the case where the argument to params if the
20614 type of the params. I omitted handling this before. Fixed
20616 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20618 * driver.cs: Call BootCorlib_PopulateCoreType
20620 * class.cs (Property.CheckBase): Check for properties only, not
20623 * interface.cs: Temporary hack: try/catch around the
20624 CustomAttributeBuilder, because I am getting an exception that I
20627 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20628 types whose definitions are required to be there (attributes are
20629 defined before standard types).
20631 Compute definitions as we boot the various types, as they are used
20632 immediately (value_type class will need object_type, but if we do
20633 not initialize object_type, we will pass a null, which will let
20634 the runtime pick the System.Object from the existing corlib, which
20635 is not what we want).
20637 2002-04-22 Patrik Torstensson <totte@labs2.com>
20639 * cs-tokenizer.cs: fixed a number of trim() issues.
20641 2002-04-22 Ravi Pratap <ravi@ximian.com>
20643 * expression.cs (Argument.Type): Ensure that we return the correct
20644 type when we have out or ref parameters [in which case we
20647 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20649 * class.cs (Property, Indexer): Allow extern modifier in there.
20651 * typemanager.cs (InitBaseTypes): Initializes object_type and
20652 value_type, since those will be used early on during the bootstrap
20653 process to compile corlib.
20655 (InitCoreTypes): Move code from here to InitBaseTypes.
20657 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20659 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20660 single-dimension arrays as using the ldlen opcode.
20662 Daniel Lewis discovered this optimization.
20664 * typemanager.cs: Add signature for System.Array::get_Length
20666 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20668 * statement.cs: report the error when the foreach does not apply to an
20669 array nor a collection.
20671 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20673 * expression.cs: Add implicit conversions to the operator ~.
20675 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20677 * typemanager.cs: Locate the decimal constructor.
20679 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20681 * attribute.cs: use the new property of TypeOf.
20682 * expression.cs: added 'get' property around typearg.
20684 These changes fix a build breaker reported by NickD. Is this the
20685 correct way to fix? If not, please, revert my changes and make it
20688 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20690 * attribute.cs: Add support for typeof in attribute invocations.
20691 I am not sure that this is right though.
20693 2002-04-14 Duncan Mak <duncan@ximian.com>
20695 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20696 Binary.Operator.Division case.
20698 2002-04-13 Ravi Pratap <ravi@ximian.com>
20700 * class.cs (DefineType): Ensure that we do a proper check on
20701 attribute types and also register it with the TypeManager.
20703 (TypeContainer.Targets): The default for attribute types is
20704 AttributeTargets.All.
20706 * attribute.cs (ApplyAttributes): Registering the attribute type
20707 is done elsewhere, not when we discover we have a Usage attribute.
20709 2002-04-12 Ravi Pratap <ravi@ximian.com>
20711 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20712 and get rid of is_delegate parameter.
20714 * everywhere : update.
20716 2002-04-12 Ravi Pratap <ravi@ximian.com>
20718 * cs-parser.jay (compilation_unit): Revamp completely to use
20719 some new ideas that I got from Rhys' grammar to solve the problems
20720 with assembly level attributes.
20722 (outer_declaration): New grammar production.
20724 (attribute_sections): Add.
20726 (opt_attributes): Base on attribute_sections
20728 (namespace_declaration): Allow opt_attributes to tackle the case
20729 when we have assembly level attributes - we are clever in this
20732 * attribute.cs (ApplyAttributes): Do not worry about assembly
20733 attributes in the non-global context.
20735 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20736 instead of SetGlobalAttributes.
20738 * class.cs, rootcontext.cs : Ensure we define and generate
20739 attribute types before anything else.
20741 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20742 and flag the new error -20 for the case when the attribute type
20743 does not have valid targets specified. csc does not catch this.
20745 * ../errors/errors.txt : update for error # -20
20747 2002-04-11 Ravi Pratap <ravi@ximian.com>
20749 * support.cs (InternalParameters.ParameterModifier): Do some null
20750 checking and return sane values.
20752 * class.cs (Method.Define): If we are a PInvoke method, ensure
20753 that we are static and extern. Report error # 601
20755 * ../errors/cs0601.cs : Add test case for the above error.
20757 2002-04-07 Ravi Pratap <ravi@ximian.com>
20759 * rootcontext.cs (attribute_types): We need to keep type of
20760 all attribute types separately and emit code for them first.
20762 (RegisterAttribute) : Implement.
20764 * class.cs (DefineType): Check if the current Type is a custom
20765 attribute type and register it accordingly.
20767 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20768 adding the first attribute twice and rename to
20770 (SetGlobalAttributes): this.
20772 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20775 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20776 if we are processing global arguments. Hmm, I am unsure of this.
20778 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20780 * expression.cs: added static array of strings to avoid calling
20781 Enum.ToString () for Operator in Binary. Significant recover of
20784 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20786 * class.cs (FindMembers): Allow the Builders of the various
20787 members to be null. If they are skip them. This only happens
20788 during the PInvoke declaration.
20790 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20792 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20793 failure, so we do not keep going afterwards.
20795 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20796 wanted to pass `false' as the `is_delegate' argument. If this is
20797 the case, why not use delegate_type == null to mean `is_delegate =
20798 false' and anything else as is_delegate = true.
20800 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20802 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20803 code for the section, not the beginning of the tests.
20805 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20807 * cfold.cs: Handle operator + (Enum x, Underlying x)
20809 * expression.cs (Binary): same. Warn about errors where we have
20810 Enum/Enum in operator + as well.
20812 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20815 - added support for switch(bool)
20816 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20817 - add TableSwitchEmit() to handle table-based switch statements
20819 2002-04-05 Ravi Pratap <ravi@ximian.com>
20821 * expression.cs (Invocation.OverloadResolve): Factor out code which
20822 does parameter compatibility checking with arguments so that we can
20823 re-use the code even from Delegate.VerifyApplicability
20825 (VerifyArgumentsCompat): Move above code here.
20827 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20828 and instead make a call to the above method.
20830 2002-03-31 Ravi Pratap <ravi@ximian.com>
20832 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20833 We use it to keep track of classes which are attribute types.
20835 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20837 * delegate.cs (Delegate.Define): Correctly define the types in the
20838 presence of fixed and array parameters.
20840 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20843 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20844 include NonPublic after the first iteration.
20846 * class.cs (Indexer.CheckBase): Only check if both parents are
20849 * cs-parser.jay (accessor_body): If empty, set to null.
20851 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20852 same code path here to resolve constants names that we did have in
20853 MemberAccess.DoResolve. There is too much code duplicated here.
20855 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20857 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20859 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20862 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20863 tokens, numbers and strings.
20865 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20868 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20869 asyncronous parameters and the regular parameters.
20871 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20872 specify the target directory.
20874 * expression.cs: (This.DoResolve): Simplify
20875 (As.Emit): Optimize, do not generate IsInst if the expression is
20876 always of the given type.
20878 (Is.DoResolve): Bug fix, we were reporting both always/never for
20881 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20882 creating too many unnecessary arrays.
20884 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20886 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20887 fields instead of rolling our own initializer. Takes care of all
20888 implicit conversions, and drops unnecessary static checks/argument.
20890 2002-03-31 Dick Porter <dick@ximian.com>
20892 * driver.cs: use the GetDirectories() return values properly, and
20893 use "/" as path separator.
20895 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20897 * expression.cs (Unary): Optimize - - expr into expr.
20898 (Binary): Optimize a + (-b) into a -b.
20900 * codegen.cs (CodeGen): Made all methods static.
20902 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20906 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20907 TypeBuilder property.
20909 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20912 * tree.cs: Removed the various RecordXXXX, and replaced with a
20913 single RecordDecl. Removed all the accessor methods, and just
20914 left a single access point Type
20916 * enum.cs: Rename DefineEnum to DefineType.
20918 * decl.cs: New abstract method `DefineType' used to unify the
20919 Defines for Enumerations, Interfaces, TypeContainers and
20922 (FindType): Moved LookupInterfaceOrClass here. Moved the
20923 LookupBaseClasses method that used to live in class.cs and
20924 interface.cs here, and renamed to FindType.
20926 * delegate.cs: Implement DefineType. Take advantage of the
20927 refactored pattern for locating the parent builder without taking
20928 the parent_builder argument (which we know does not work if we are
20929 nested, and triggering a toplevel definition).
20931 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20933 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20934 accessibility of a member has changed during override and report
20937 * class.cs (Method.Define, Property.Define): Only complain on
20938 overrides if the method is private, any other accessibility is
20939 fine (and since we just checked the permission is the same, we are
20942 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20943 and elif are processed always. The other pre-processing
20944 directives are only processed if we are "taking" the path
20946 2002-03-29 Martin Baulig <martin@gnome.org>
20948 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20949 current location is not Null.
20951 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20952 a separate method so we can profile it.
20954 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20955 `span.Seconds' are just seconds, but no minutes or hours.
20956 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20958 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20960 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20961 Remove the gratuitous set of Final:
20963 // If an interface implementation, then we can set Final.
20964 if (((flags & MethodAttributes.Abstract) == 0) &&
20965 implementing.DeclaringType.IsInterface)
20966 flags |= MethodAttributes.Final;
20968 I do not know what I was smoking when I used that.
20971 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20972 step into fixing the name resolution issues for delegates and
20973 unifying the toplevel name resolution.
20975 2002-03-28 Martin Baulig <martin@gnome.org>
20977 * class.cs (Method.Emit): If we have a symbol writer, call its
20978 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20979 tell it about the current method.
20981 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20982 writer that we're going to emit the first byte of IL code for a new
20983 statement (a new source line).
20984 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20985 EmitContext.Mark() before emitting any code.
20987 * location.cs (SymbolDocument): Return null when we're Null.
20989 * statement.cs (Statement): Moved the `Location loc' variable here.
20990 (Statement.EmitBoolExpression): If we have a symbol writer, call
20991 ec.Mark() before emitting any code to tell it that we're at the
20992 beginning of a new statement.
20993 (StatementExpression): Added `Location' argument to the constructor.
20994 (Block): Added public readonly variable `StartLocation' and public
20995 variable `EndLocation'. The latter is to be set using SetEndLocation().
20996 (Block): Added constructor which takes a start and end location.
20997 (Block.SetEndLocation): New method. This sets the end location.
20998 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20999 local variables we create.
21000 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21001 each statement and do also mark the begin and end of the block.
21003 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21004 tell it the current lexer.Location, use Location.Null for the end of the
21006 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21007 current block, set its end location using SetEndLocation().
21008 (statement_expression): StatementExpression constructor now takes the
21009 lexer.Location as additional argument.
21010 (for_statement, declare_local_variables): Likewise.
21011 (declare_local_variables): When creating a new implicit block, use the
21012 new Block constructor and pass it the lexer.Location.
21014 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21016 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21017 members also on the parent interfaces recursively.
21019 2002-03-27 Miguel de Icaza <miguel@ximian.com>
21021 * report.cs: Use new formats, since Gonzalo finished the missing
21024 * expression.cs (Binary.ResolveOperator): added missing operator|
21025 operator& and operator^ for bool/bool.
21027 * cs-parser.jay: CheckDef now takes a Location argument that is
21028 used to report errors more precisly (instead of reporting the end
21029 of a definition, we try to track something which is a lot closer
21030 to the source of the problem).
21032 * cs-tokenizer.cs: Track global token use, so we can properly flag
21033 the use of #define/#undef after the first token has been seen.
21035 Also, rename the reportXXXX to Error_DescriptiveName
21037 * decl.cs (DeclSpace.IsTopLevel): Move property here from
21038 TypeContainer, so that Enum and Interface can use this too.
21040 * class.cs (TypeContainer.LookupInterfaceOrClass,
21041 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21042 `builder' argument. Typically this was used to pass the parent
21043 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21046 The problem is that a nested class could trigger the definition of
21047 a toplevel class, and the builder would be obviously wrong in that
21050 So we drop this argument, and we compute dynamically the
21051 TypeBuilder/ModuleBuilder (the correct information was available
21052 to us anyways from DeclSpace.Parent)
21054 * interface.cs (Interface.DefineInterface): Drop builder
21055 parameter cleanup like class.cs
21057 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
21060 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21063 (Try.Emit): Propagate the returns value from the statement.
21065 (Return.Emit): Even if we are leavning
21067 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21069 * modifiers.cs: Fix the computation of MethodAttributes flags.
21071 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21073 * driver.cs: allow compilation of files that start with '/'.
21074 Add a default case when checking the argument of --target.
21076 2002-03-25 Miguel de Icaza <miguel@ximian.com>
21078 * interface.cs: Implement the same search algorithm for types in
21079 the interface code.
21081 * delegate.cs: Do not allow multiple definition.
21083 * Recovered ChangeLog that got accidentally amputated
21085 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21087 * rootcontext.cs: Load manually enum to allow core classes to
21088 contain enumerations.
21090 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21091 Update to new static methods in TypeManager.
21093 * typemanager.cs (GetMethod, GetConstructor): Use our
21094 implementation of FindMembers to find the members, since during
21095 corlib compilation, the types are TypeBuilders and GetMethod and
21096 GetConstructor do not work.
21098 Make all methods in TypeManager static.
21100 (InitCodeHelpers): Split the functionality from
21101 the InitCodeTypes function.
21103 * driver.cs: Call InitCodeHelpers after we have populated the
21106 * cs-parser.jay (delegate_declaration): we did not used to compute
21107 the delegate name correctly for void delegates.
21109 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21111 * rootcontext.cs (RootContext): Init the interface_resolve_order
21112 and type_container_resolve_order always.
21114 (ResolveCore, BootstrapCorlib_ResolveClass,
21115 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21116 compiler when compiling with --nostdlib
21118 * class.cs (TypeContainer.DefineType): Check that our parent is
21119 not null. This test is most important when we are bootstraping
21122 * codegen.cs: Split out the symbol writing code.
21124 2002-03-25 Martin Baulig <martin@gnome.org>
21126 * driver.cs (-g): Made -g an alias for --debug.
21128 2002-03-24 Martin Baulig <martin@gnome.org>
21130 * codegen.cs (SymbolWriter): New public variable. Returns the
21131 current symbol writer.
21132 (CodeGen): Added `bool want_debugging_support' argument to the
21133 constructor. If true, tell the ModuleBuild that we want debugging
21134 support and ask it for the ISymbolWriter.
21135 (Save): If we have a symbol writer, call it's Close() method after
21136 saving the assembly.
21138 * driver.c (--debug): New command line argument to create a
21139 debugger information file.
21141 * location.cs (SymbolDocument): New public property. Returns an
21142 ISymbolDocumentWriter object for the current source file or null
21143 if we don't have a symbol writer.
21145 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21147 * driver.cs (LoadAssembly): Correctly return when all the paths
21148 have been tried and not before.
21150 * statement.cs (Switch.Emit): return the actual coverage for this
21151 statement (returns/not-returns)
21153 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21154 switch of the statement if we are the last switch section. That
21155 kills two problems: try/catch problems (we used to emit an empty
21156 nop at the end) and switch statements where all branches would
21159 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21161 * driver.cs: Add default assemblies (the equivalent to the
21162 Microsoft CSC.RSP file)
21164 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21165 also update tokens_seen and set it to false.
21167 * driver.cs: Implement --recurse for Mike.
21169 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21170 correctly splitting out the paths.
21172 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21174 * interface.cs (Interface.PopulateProperty): Instead of using
21175 `parent' as the declaration space for the set parameters, use
21178 * support.cs (InternalParameters): InternalParameters constructor
21179 takes a DeclSpace instead of a TypeContainer.
21181 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21182 types are being initialized, load the address of it before calling
21185 (New): Provide a mechanism to disable the generation of local
21186 value type temporaries when the caller will be providing us with
21187 an address to store it.
21189 (ArrayCreation.EmitDynamicInitializers): Use it.
21191 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21193 * expression.cs (Invocation.EmitArguments): Only probe for array
21194 property if there is more than one argument. Sorry about that.
21196 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21197 empty param arrays.
21199 * class.cs (Method.LabelParameters): Fix incorrect code path that
21200 prevented the `ParamArrayAttribute' from being applied to the
21203 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21205 * support.cs (ReflectionParameters): Correctly compute whether the
21206 last argument is a params array. Fixes the problem with
21209 * typemanager.cs: Make the assemblies array always be non-null
21210 (empty, but non-null)
21212 * tree.cs (RecordDecl): New function that abstracts the recording
21213 of names. This reports error 101, and provides a pointer to the
21214 previous declaration. Fixes a crash in the compiler.
21216 * cs-parser.jay (constructor_declaration): Update to new grammar,
21217 and provide a constructor_body that can be empty.
21219 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21221 * driver.cs: Add support for --resources.
21223 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21224 Make all types for the various array helper methods be integer.
21226 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21227 CheckState to ConvCast.
21229 (ConvCast): Now it takes a `checked' state argument, to avoid
21230 depending on the emit context for the conversion, and just using
21231 the resolve time setting.
21233 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21234 instead of Invocation.EmitArguments. We do not emit the original
21235 arguments, instead we emit those which have been converted to
21236 unsigned int expressions.
21238 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21240 * codegen.cs: ditto.
21242 * expression.cs (LocalVariableReference): Drop the use of the
21243 Store function that depended on the variable index.
21245 * statement.cs (VariableInfo): Drop the `Idx' property from this
21246 class, as this is not taking into account the indexes for
21247 temporaries tat we generate during the execution, getting the
21250 * class.cs: First emit class initializers, then call the parent
21253 * expression.cs (Binary): Fix opcode emision.
21254 (UnaryMutator.EmitCode): Support checked code generation
21256 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21257 matches for events for both the Static and Instance scans,
21258 pointing to the same element. Fix that.
21260 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21262 * rootcontext.cs (ResolveTree): Always set the
21263 interface_resolve_order, because nested interfaces will be calling
21266 * class.cs (GetInterfaceOrClass): Track the same resolution
21267 process used by TypeManager.LookupType. This fixes the nested
21268 type lookups in class declarations (separate path from
21271 (TypeContainer.DefineType): Also define nested interfaces.
21272 (TypeContainer.RegisterOrder): New public function used to
21273 register the order in which child interfaces need to be closed.
21275 Nested interfaces need to be closed after their parents have been
21278 * interface.cs (InterfaceAttr): Put all the logic for computing
21279 the interface attribute here.
21281 (DefineInterface): Register our interface order with the
21282 RootContext or with the TypeContainer depending on the case.
21284 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21286 * cs-parser.jay: rework foreach statement to work with the new
21287 changes to the policy on SimpleNames.
21289 * report.cs: support Stacktrace on warnings as well.
21291 * makefile: drop --unsafe and /unsafe from the compile.
21293 2002-03-13 Ravi Pratap <ravi@ximian.com>
21295 * ecore.cs (StandardConversionExists): Modify to take an Expression
21296 as the first parameter. Ensure we do null -> reference type conversion
21299 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21300 temporary Expression objects.
21302 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21304 * interface.cs: workaround bug in method overloading resolution
21305 (there is already a bugzilla bug for it).
21307 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21309 We could also solve this problem by having a separate path for
21310 performing type lookups, instead of DoResolve, we could have a
21311 ResolveType entry point, and only participating pieces of the
21312 production (simplename, deref, array) would implement this.
21314 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21315 signal SimpleName to only resolve type names and not attempt to
21316 resolve anything else.
21318 * expression.cs (Cast): Set the flag.
21320 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21322 * class.cs: Only report 108 if there is no `new' modifier.
21324 * cs-parser.jay: rework foreach statement to work with the new
21325 changes to the policy on SimpleNames.
21327 * report.cs: support Stacktrace on warnings as well.
21329 * makefile: drop --unsafe and /unsafe from the compile.
21331 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21333 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21334 lookups here, instead of doing that at parse time. This means
21335 that our grammar will not introduce `LocalVariableReferences' as
21336 expressions at this point. That solves the problem of code like
21340 static void Main ()
21344 This is only half the fix. The full fix requires parameters to
21345 also be handled in this way.
21347 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21348 makes the use more obvious of the DeclSpace. The
21349 ec.TypeContainer.TypeBuilder is now only used to pull the
21350 TypeBuilder for it.
21352 My theory is that I can get rid of the TypeBuilder completely from
21353 the EmitContext, and have typecasts where it is used (from
21354 DeclSpace to where it matters).
21356 The only pending problem is that the code that implements Aliases
21357 is on TypeContainer, and probably should go in DeclSpace.
21359 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21360 lookups here, instead of doing that at parse time. This means
21361 that our grammar will not introduce `LocalVariableReferences' as
21362 expressions at this point. That solves the problem of code like
21366 static void Main ()
21370 This is only half the fix. The full fix requires parameters to
21371 also be handled in this way.
21373 * class.cs (Property.DefineMethod): When implementing an interface
21374 method, set newslot, when implementing an abstract method, do not
21375 set the flag (before we tried never setting it, or always setting
21376 it, which is the difference).
21377 (Indexer.DefineMethod): same.
21378 (Method.DefineMethod): same.
21380 * ecore.cs: Only set the status used flag if we get back a Field.
21382 * attribute.cs: Temporary hack, so Paolo can keep working.
21384 2002-03-08 Ravi Pratap <ravi@ximian.com>
21386 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21387 the unmanaged type in the case we have a MarshalAs attribute.
21389 (Resolve): Handle the case when we are parsing the special MarshalAs
21390 attribute [we need to store the unmanaged type to use later]
21392 * typemanager.cs (marshal_as_attr_type): Built in type for the
21393 MarshalAs Attribute.
21395 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21396 on parameters and accordingly set the marshalling info.
21398 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21400 * class.cs: Optimizing slightly by removing redundant code after
21401 we switched to the `NoTypes' return value.
21402 (Property.DefineMethod): use NoTypes here too.
21404 This fixes the bug I introduced in my last batch of changes.
21406 2002-03-05 Ravi Pratap <ravi@ximian.com>
21408 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21410 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21411 Enums since those are types too.
21413 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21415 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21416 thanks to a call during the lookup process.
21418 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21420 * statement.cs (Foreach): Lots of work to accomodate a particular
21421 kind of foreach statement that I had not kept in mind. It is
21422 possible to have foreachs on classes that provide a GetEnumerator
21423 method that return objects that implement the "pattern" for using
21424 a foreach, there is no need to support GetEnumerator
21427 This is needed to compile nant.
21429 * decl.cs: Only report 114 if the member is not `Finalize' and if
21430 the warning level is at least 2.
21432 * class.cs: Moved the compare function from Method to
21435 (MethodSignature.InheritableMemberSignatureCompare): Add new
21436 filter function that is used to extract inheritable methods from a
21439 (Method.Define): Use the new `inheritable_method_signature_filter'
21442 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21445 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21447 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21449 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21451 * expression.cs: Pass location information to
21452 ConvertImplicitStandard.
21454 * class.cs: Added debugging code to track return values from
21457 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21459 * expression.cs (Is.DoResolve): If either side of the `is' is an
21460 interface, do not flag the warning.
21462 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21465 * report.cs: Allow for --fatal to be used with --probe.
21467 * typemanager.cs (NoTypes): Move the definition for the empty Type
21470 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21472 (TypeContainer.DefineProxy): New function used to proxy to parent
21473 implementations when implementing interfaces.
21474 (TypeContainer.ParentImplements): used to lookup if our parent
21475 implements a public function that is required by an interface.
21476 (TypeContainer.VerifyPendingMethods): Hook this up.
21478 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21479 `modules' and `assemblies' arraylists into arrays. We only grow
21480 these are the very early start up of the program, so this improves
21481 the speedof LookupType (nicely measured).
21483 * expression.cs (MakeByteBlob): Replaced unsafe code with
21484 BitConverter, as suggested by Paolo.
21486 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21487 folding of string concatenation, but if either side is a string,
21488 and the other is not, then return null, and let the runtime use
21489 the concatenation on the string plus the object (using
21490 `Object.ToString').
21492 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21494 Constant Folding has been implemented now.
21496 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21497 the error instead on types that are not supported in one's
21500 * constant.cs (Constant and all children): New set of functions to
21501 perform implict and explicit conversions.
21503 * ecore.cs (EnumConstant): Implement the new functions to perform
21504 conversion by proxying to the child expression.
21506 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21507 own separate setting that can not be turned off from the command
21508 line using --unchecked or --checked and is only controlled using
21509 the checked/unchecked statements and expressions. This setting is
21510 used by the constant folder to flag errors.
21512 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21513 ConstantCheckState as well.
21515 During Resolve, they also have to flag the state, because the
21516 constant folder runs completely in the Resolve phase.
21518 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21521 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21523 * cfold.cs: New file, this file contains the constant folder.
21525 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21526 argument to track whether we are using the resulting address to
21527 load or store a value and provide better error messages.
21529 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21530 new AddressOf arguments.
21532 * statement.cs (Foreach.EmitCollectionForeach): Update
21534 * expression.cs (Argument.Emit): Call AddressOf with proper
21535 arguments to track usage.
21537 (New.DoEmit): Call AddressOf with new arguments.
21539 (Unary.Emit): Adjust AddressOf call.
21541 2002-03-01 Ravi Pratap <ravi@ximian.com>
21543 * cs-parser.jay (member_access): Change the case for pre-defined types
21544 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21547 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21550 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21551 essentially like methods and apply attributes like MethodImplOptions to them too.
21553 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21556 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21557 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21560 * Update code everywhere accordingly.
21562 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21564 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21566 2002-02-28 Ravi Pratap <ravi@ximian.com>
21568 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21569 try performing lookups against those instead of jumping straight into using
21570 the 'using' clauses.
21572 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21574 (LookupType): Perform lookups in implicit parents too.
21576 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21577 sequence as RootContext.LookupType.
21579 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21580 the various cases of namespace lookups into this method.
21582 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21584 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21585 in positional arguments)
21587 * class.cs (Operator): Update the AllowedModifiers to contain
21590 * cs-parser.jay: Update operator declaration to allow for the
21591 operator body to be empty.
21593 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21596 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21598 * class.cs (Method.Emit): Label parameters.
21600 * driver.cs: Return 1 or 0 as the program exit code.
21602 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21604 * expression.cs: Special case the `null' object when trying to
21605 auto-compute the type, as anything can be explicitly converted to
21608 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21609 spotting this Paolo.
21611 (Expression.ImplicitNumericConversion): Perform comparissions of
21612 the type using the underlying type in the case of an enumeration
21613 rather than using the enumeration type for the compare.
21615 Cope with the underlying == type case, which is not possible to
21618 (Expression.ConvertNumericExplicit): Perform comparissions of
21619 the type using the underlying type in the case of an enumeration
21620 rather than using the enumeration type for the compare.
21622 * driver.cs: If the user does not supply an extension, assume .exe
21624 * cs-parser.jay (if_statement): Rewrote so that we can track the
21625 location for the if statement.
21627 * expression.cs (Binary.ConstantFold): Only concat strings when
21628 the operation is "+", not everything ;-)
21630 * statement.cs (Statement.EmitBoolExpression): Take a location
21632 (If, While, Do): Track location.
21634 * expression.cs (Binary.ResolveOperator): In the object + string
21635 case, I was missing a call to ConvertImplicit
21637 2002-02-25 Ravi Pratap <ravi@ximian.com>
21639 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21640 Location arguments. Ensure we use RootContext.LookupType to do our work
21641 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21643 * interface.cs (PopulateMethod): Handle the type of the parameter being
21646 * expression.cs (Invocation.BetterFunction): Handle the case when we
21647 have a params method with no fixed arguments and a call is made with no
21650 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21652 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21653 the verbatim-string-literal
21655 * support.cs (InternalParameters.ParameterModifier): handle null
21657 (InternalParameters.ParameterType): ditto.
21659 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21660 duplicating the name of the variable parameter.
21661 (GetParameterByName): Fix bug where we were not looking up array
21662 paramters if they were the only present (thanks Paolo!).
21663 (GetParameterInfo): We only have an empty set of types if both
21664 fixed and array are set to null.
21665 (GetParameterInfo-idx): Handle FixedParameter == null
21667 * cs-parser.jay: Handle the case where there is no catch
21668 statements (missing null test).
21670 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21672 * driver.cs (MainDriver): Be conservative on our command line
21675 Catch DirectoryNotFoundException when calling GetFiles.
21677 (SplitPathAndPattern): Used to split the input specification into
21678 a path and a pattern that we can feed to Directory.GetFiles.
21680 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21682 * statement.cs (Fixed): Implement the last case of the Fixed
21683 statement (string handling).
21685 * expression.cs (StringPtr): New class used to return a char * to
21686 a string; Used by the Fixed statement.
21688 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21690 * expression.cs (Binary.ResolveOperator): Remove redundant
21691 MemberLookup pn parent type.
21692 Optimize union call, we do not need a union if the types are the same.
21693 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21696 Specialize the use of MemberLookup everywhere, instead of using
21697 the default settings.
21699 (StackAlloc): Implement stackalloc keyword.
21701 * cs-parser.jay: Add rule to parse stackalloc.
21703 * driver.cs: Handle /h, /help, /?
21705 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21706 before we supported unsafe code.
21708 * makefile: add --unsafe to the self compilation of mcs.
21710 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21712 * expression.cs (PointerArithmetic): New class that is used to
21713 perform pointer arithmetic.
21714 (Binary.Resolve): Handle pointer arithmetic
21715 Handle pointer comparission.
21716 (ArrayPtr): Utility expression class that is used to take the
21717 address of an array.
21719 (ElementAccess): Implement array access for pointers
21721 * statement.cs (Fixed): Implement fixed statement for arrays, we
21722 are missing one more case before we are done.
21724 * expression.cs (Indirection): Implement EmitAssign and set the
21725 ExprClass to Variable. This allows pointer dereferences to be
21726 treated as variables, and to have values assigned to them.
21728 * ecore.cs (Expression.StoreFromPtr): New utility function to
21729 store values dereferencing.
21731 2002-02-20 Ravi Pratap <ravi@ximian.com>
21733 * expression.cs (Binary.ResolveOperator): Ensure that we are
21734 not trying to operate on a void type - this fixes the reported
21737 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21738 the parent implementation is sealed.
21740 * ../errors/cs0239.cs : Add.
21742 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21744 * typemanager.cs (unverifiable_code_type): Corresponds to
21745 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21746 which have unsafe code in them.
21748 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21751 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21753 * cs-tokenizer.cs: Add support for @"litreal strings"
21755 Make tokenizer accept pre-processor directives
21756 on any column (remove the old C-like limitation).
21758 * rootcontext.cs (EmitCode): Emit any global attributes.
21759 (AddGlobalAttributes): Used to keep track of assembly attributes.
21761 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21763 * cs-parser.jay: Add support for global attributes.
21765 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21767 * expression.cs (Indirection): New helper class. Unary will
21768 create Indirection classes to be able to implement the
21769 IMemoryLocation interface on it.
21771 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21773 * cs-parser.jay (fixed_statement): reference the right statement.
21775 * statement.cs (Fixed.Emit): Finish implementing the fixed
21776 statement for the &x case.
21778 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21780 * class.cs (Property.Define, Method.Define): Remove newslot when
21783 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21784 wrong. NewSlot should only be used if the `new' keyword is present.
21786 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21787 locating our system dir. Sorry about this.
21789 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21791 * driver.cs (GetSystemDir): Compute correctly the location of our
21792 system assemblies. I was using the compiler directory instead of
21793 the library directory.
21795 2002-02-13 Ravi Pratap <ravi@ximian.com>
21797 * expression.cs (BetterFunction): Put back in what Miguel commented out
21798 since it is the correct fix. The problem is elsewhere ;-)
21800 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21801 parameters of the parms method are themselves compatible or not !
21803 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21804 to check that a class implements an interface before saying that an implicit
21805 conversion was allowed. Use ImplementsInterface to do the checking.
21807 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21809 * class.cs (Method.Define): Track whether we are an explicit
21810 implementation or not. And only call DefineMethodOverride if we
21811 are an explicit implementation.
21813 (Property.DefineMethod): Ditto.
21815 2002-02-11 Ravi Pratap <ravi@ximian.com>
21817 * expression.cs (BetterFunction): Catch hideous bug which was
21818 preventing us from detecting ambiguous calls due to implicit casts i.e
21821 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21823 * support.cs (Pair): Remove un-needed method. I figured why I was
21824 getting the error in cs-parser.jay, the variable in a foreach loop
21825 is readonly, and the compiler does not really treat this as a variable.
21827 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21828 instead of EQUALS in grammar.
21830 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21832 * expression.cs (Unary.DoResolve): Check whether the argument is
21835 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21837 * support.cs: Api for Pair to set a value. Despite the fact that
21838 the variables are public the MS C# compiler refuses to compile
21839 code that accesses the field if the variable is part of a foreach
21842 * statement.cs (Fixed): Begin implementation of the fixed
21845 (Block.AddVariable): Return the VariableInfo on success and null
21846 on failure instead of true/false.
21848 * cs-parser.jay (foreach): Catch errors on variables already
21849 defined (we were ignoring this value before) and properly unwind
21850 the block hierarchy
21852 (fixed_statement): grammar for the fixed statement.
21854 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21856 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21857 pointer types to be incretemented.
21859 (SizeOf): Implement.
21861 * cs-parser.jay (pointer_member_access): Implement
21862 expr->IDENTIFIER production.
21864 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21865 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21868 (Unary): Implement indirection.
21870 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21871 use in non-unsafe context).
21873 (SimpleName.DoResolve): Check for pointers in field access on safe
21876 (Expression.LoadFromPtr): Factor the load-indirect code in this
21877 function. This was duplicated in UnboxCast and ParameterReference
21879 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21881 * expression.cs (ComposedCast): report an error if a pointer cast
21882 is used in a safe region.
21884 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21885 pointer type casts in unsafe context.
21887 * codegen.cs (EmitContext): Set up IsUnsafe.
21889 * cs-parser.jay (non_expression_type): Add productions for pointer
21892 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21893 code. We should not use force into static mode if the method is
21894 not virtual. Fixes bug in MIS
21896 * statement.cs (Do.Emit, While.Emit, For.Emit,
21897 Statement.EmitBoolExpression): Add support to Do and While to
21898 propagate infinite loop as `I do return' semantics.
21900 Improve the For case to also test for boolean constants.
21902 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21903 to the list of attributes we can add.
21905 Remove `EmitContext' argument.
21907 * class.cs (Method.Define): Apply parameter attributes.
21908 (Constructor.Define): Apply parameter attributes.
21909 (MethodCore.LabelParameters): Move here the core of labeling
21912 * support.cs (ReflectionParameters.ParameterModifier,
21913 InternalParameters.ParameterModifier): Use IsByRef on the type and
21914 only return the OUT bit for these parameters instead of in/out/ref
21917 This is because I miss-understood things. The ParameterInfo.IsIn
21918 and IsOut represent whether the parameter has the [In] and [Out]
21921 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21923 * ecore.cs (FieldExpr.Emit): Release temporaries.
21925 * assign.cs (LocalTemporary.Release): new function.
21927 * codegen.cs (EmitContext.GetTemporaryStorage,
21928 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21929 temporary storage. Now we can "put back" localbuilders when we
21932 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21934 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21935 need to make a copy of the variable to generate verifiable code.
21937 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21939 * driver.cs: Compute dynamically the system directory.
21941 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21942 Slower, but more generally useful. Used by the abstract
21943 registering implementation.
21945 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21946 the rules for the special rule on Type/instances. First check if
21947 we have the same name, and if so, try that special static path
21948 rather than the instance path.
21950 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21952 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21955 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21956 Enum, ValueType, Delegate or Array for non-corlib compiles.
21958 * cs-tokenizer.cs: Catch long identifiers (645)
21960 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21963 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21964 fix, we were returning too early, so we were not registering
21965 pending methods from abstract classes.
21967 Do not register pending methods if the class is abstract.
21969 * expression.cs (Conditional.DoResolve): Report circular implicit
21970 conversions when we neecd to compute it for conditional
21973 (Is.DoResolve): If the expression is always of the provided type,
21974 flag warning 183. If the expression can not ever be of the
21975 provided type flag warning 184.
21977 * class.cs: Catch 169 as well.
21979 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21982 2002-01-18 Nick Drochak <ndrochak@gol.com>
21984 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21986 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21988 * interface.cs: (PopulateMethod): Check for pointers being defined
21989 only if the unsafe context is active.
21990 (PopulateProperty): ditto.
21991 (PopulateIndexer): ditto.
21993 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21994 specified. If pointers are present, make sure that they are
21995 present in an unsafe context.
21996 (Constructor, Constructor.Define): ditto.
21997 (Field, Field.Define): ditto.
21998 (Property, Property.Define): ditto.
21999 (Event, Event.Define): ditto.
22001 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22002 hashtable if there are classes or structs defined.
22004 * expression.cs (LocalVariableReference.DoResolve): Simplify this
22005 code, as the constant resolution moved.
22007 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22008 the metadata, so we can flag error 133.
22010 * decl.cs (MemberCore.UnsafeOK): New function to test that a
22011 pointer is being declared in an unsafe context.
22013 2002-01-16 Miguel de Icaza <miguel@ximian.com>
22015 * modifiers.cs (Modifiers.Check): Require a Location argument.
22016 Report error 227 for Unsafe use.
22018 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22020 * statement.cs (For.Emit): If the test is null, then report that
22021 we do `return', as we wont reach anything afterwards.
22023 (Switch.SwitchGoverningType): Track the expression that matched
22026 * driver.cs: Allow negative numbers as an error code to flag.
22028 * cs-parser.jay: Handle 1551.
22030 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22032 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22034 * cs-parser.jay: Report 1518 (type declaration can only contain
22035 class, struct, interface, enum or delegate)
22037 (switch_label): Report 1523 (keywords `case' or `default' must
22040 (opt_switch_sections): Report 1522 (empty switch)
22042 * driver.cs: Report 1515 (response file specified multiple times)
22043 Report 1516 (Source file specified multiple times).
22045 * expression.cs (Argument.Resolve): Signal 1510
22047 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22048 access not allowed in static code)
22050 2002-01-11 Ravi Pratap <ravi@ximian.com>
22052 * typemanager.cs (IsPointerType): Utility method which we are going
22055 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22056 the object type, so we take care of that.
22058 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22060 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22061 added to non-params parameters :-)
22063 * typemanager.cs (CSharpName): Include 'void' type too.
22065 (void_ptr_type): Include in the set of core types.
22067 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
22070 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
22073 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
22074 completely forgotten about it.
22076 2002-01-10 Ravi Pratap <ravi@ximian.com>
22078 * cs-parser.jay (pointer_type): Add. This begins our implementation
22079 of parsing rules for unsafe code.
22081 (unsafe_statement): Implement.
22083 (embedded_statement): Modify to include the above.
22085 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22087 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22088 if the current context is an unsafe one.
22090 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22091 are handled differently, we need separate rules for them.
22093 (local_variable_declaration): Update to use local_variable_pointer_type
22094 to allow variable declarations of unmanaged pointer types.
22096 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22097 in unsafe contexts.
22099 * ../errors/cs0214.cs : Add.
22101 2002-01-16 Nick Drochak <ndrochak@gol.com>
22103 * makefile: remove 'response' file when cleaning.
22105 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22107 * cs-parser.jay: Report 1524.
22109 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22111 * typemanager.cs (RegisterMethod): drop checking if we have
22112 registered this from here
22114 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22116 * class.cs (Method.EmitDestructor): Implement calling our base
22119 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22120 value of InFinally.
22122 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22123 this routine and will wrap the call in a try/catch block. Deal
22126 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22128 * ecore.cs (Expression.MemberLookup): instead of taking a
22129 parameter `same_type' that was used to tell whether we could
22130 access private members we compute our containing type from the
22133 (FieldExpr): Added partial support for volatile fields. This does
22134 not work for volatile fields exposed from assemblies, as I can not
22135 figure out how to extract the modreq from it.
22137 Updated all the source files to use this.
22139 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22140 because it is referenced by MemberLookup very often.
22142 2002-01-09 Ravi Pratap <ravi@ximian.com>
22144 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22145 TypeBuilder.GetCustomAttributes to retrieve what we need.
22147 Get rid of redundant default_member_attr_type as this is the same as
22148 default_member_type which already exists.
22150 * interface.cs, attribute.cs : Update accordingly.
22152 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22154 * typemanager.cs: Enable IndexerPropertyName again. It does not
22155 work for TYpeBuilders though. Ravi, can you please fix this?
22157 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22159 * expression.cs (Argument.Emit): Handle the case of ref objects
22160 being passed to ref functions;
22162 (ParameterReference.EmitLoad): Loads the content of the pointer
22163 without dereferencing.
22165 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22167 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22169 2002-01-08 Ravi Pratap <ravi@ximian.com>
22171 * class.cs (Indexer.DefineMethod): Incorporate the interface
22172 type in the name of the method if we are doing explicit interface
22175 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22177 (BetterConversion): Fix extremely trivial bug where we were referring to
22178 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22181 * ../errors/bug16.cs : Add although we have fixed it.
22183 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22185 * expression.cs (BaseIndexer): Begin implementation.
22187 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22189 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22190 production directly to remove a shift/reduce, and implement
22191 explicit interface implementation.
22193 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22194 after a floating point suffix.
22196 * expression.cs (DoNumericPromotions): Improved the conversion for
22197 uint/uint. If we have a constant, we avoid doing a typecast to a
22200 * class.cs (Indexer): Implement explicit interface implementation
22203 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22205 * class.cs: make the default instance constructor public and hidebysig.
22207 2001-01-03 Ravi Pratap <ravi@ximian.com>
22209 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22210 so we can call it from elsewhere.
22212 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22213 we emit it internally if the class has a defined indexer; otherwise the user
22214 emits it by decorating the class definition with the DefaultMemberAttribute.
22216 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22217 attribute is not used on a type which defines an indexer.
22219 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22220 character when we skip whitespace.
22222 * ../errors/cs0646.cs : Add.
22224 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22226 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22229 * makefile: Add practical target `mcs3.exe' which builds the third
22230 generation compiler.
22232 * expression.cs (New): Fix structures constructor calling.
22234 * class.cs (Property, Method, Indexer): Emit Final flag on the
22235 method if we are an interface implementation and we are not
22238 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22239 whether this property is referencing a `base' method.
22241 * expression.cs (Invocation.EmitCall): take an extra argument:
22242 is_base, this is used to determine whether the `call' or
22243 `callvirt' opcode should be used.
22246 * delegate.cs: update EmitCall.
22248 * class.cs (Method.Define): Set NewSlot for the cases where we are
22249 not implementing an interface method.
22251 (Property.Define): ditto.
22253 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22255 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22256 'r'. Allows mcs to parse itself fully.
22258 2002-01-02 Ravi Pratap <ravi@ximian.com>
22260 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22261 of the number of initializers that require the InitializeArray method.
22263 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22264 update the above field where necessary.
22266 (MakeByteBlob): Update accordingly.
22268 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22271 (EmitDynamicInitializers): Update in accordance with the new optimization.
22273 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22274 same OpCode applies.
22276 * cs-parser.jay : Fix some glaring errors I introduced.
22278 2002-01-01 Ravi Pratap <ravi@ximian.com>
22280 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22281 so that we can check for name clashes there too.
22283 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22284 for interface indexers.
22286 * interfaces.cs (Define): Emit the default member attribute.
22288 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22289 variable was being referred to while setting the value ;-)
22291 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22293 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22294 byte-by-byte information when we know the data is zero.
22296 Make the block always a multiple of 4, because
22297 DefineInitializedData has a bug.
22299 * assign.cs: Fix, we should assign from the temporary, not from
22302 * expression.cs (MakeByteBlob): Fix my incorrect code.
22304 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22306 * typemanager.cs (EnumToUnderlying): This function is used to get
22307 the underlying type from an enumeration, because it does not
22310 * constant.cs: Use the I4_S form for values between -128 and 127.
22312 * statement.cs (Block.LookupLabel): Looks up a label.
22313 (Block): Drop support for labeled blocks.
22315 (LabeledStatement): New kind of statement that represents a label
22318 (Goto): Finally implement this bad boy.
22320 * cs-parser.jay: Update to reflect new mechanism to implement
22323 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22325 * codegen.cs (EmitContext.This): a codegen property that keeps the
22326 a single instance of this instead of creating many different this
22329 * delegate.cs (Delegate.DoResolve): Update to use the property;
22331 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22333 * expression.cs (BaseAccess.DoResolve): Ditto.
22335 2001-12-29 Ravi Pratap <ravi@ximian.com>
22337 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22338 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22340 (InitCoreTypes): Update accordingly.
22342 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22343 so we can quickly store the state.
22345 (ApplyAttributes): Set the correct implementation flags
22346 for InternalCall methods.
22348 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22350 * expression.cs (EmitCall): if a method is not virtual, then do
22351 not use callvirt on it.
22353 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22354 user defined stuff) requires the use of stobj, which takes an
22355 address on the stack instead of an array and an index. So emit
22356 the Ldelema operation for it.
22358 (EmitStoreOpcode): Use stobj for valuetypes.
22360 (UnaryMutator.EmitCode): Use the right 1 value depending on
22361 whether we are dealing with int64/uint64, float or doubles.
22363 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22364 constructors that I implemented last night.
22366 (Constructor.IsDefault): Fix to work properly for static
22369 * cs-parser.jay (CheckDef): report method signature errors.
22370 Update error number 103 to be 132.
22372 * decl.cs: New AdditionResult enumeration value: MethodExists.
22373 Although we do this check for methods later on in the semantic
22374 analysis, catching repeated default constructors is so easy that
22375 we catch these here.
22377 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22380 (ParameterReference.EmitAssign, Emit): handle
22383 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22384 (ArrayAccess.EmitStoreOpcode): ditto.
22386 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22388 * expression.cs (MakeByteBlob): Complete all the missing types
22389 (uint, short, ushort, byte, sbyte)
22391 * class.cs: Only init instance field initializers on instance
22394 Rename `constructors' to instance_constructors.
22396 (TypeContainer.AddConstructor): Only add constructors to the list
22397 if it is not static.
22399 Make sure that we handle default_static_constructor independently
22400 everywhere where we handle instance_constructors
22402 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22404 * class.cs: Do not lookup or create a base initializer for a
22405 static constructor.
22407 (ConstructorInitializer.Resolve): use the proper type to lookup
22410 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22412 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22415 * decl.cs: CloseType is now an virtual method, the default
22416 implementation just closes this type.
22418 2001-12-28 Ravi Pratap <ravi@ximian.com>
22420 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22421 to PreserveSig by default. Also emit HideBySig on such methods.
22423 Basically, set the defaults to standard values.
22425 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22426 argument, if candidate is better, it can't be worse than the best !
22428 (Invocation): Re-write bits to differentiate between methods being
22429 applicable in their expanded form and their normal form - for params
22432 Get rid of use_standard everywhere as only standard conversions are allowed
22433 in overload resolution.
22435 More spec conformance.
22437 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22439 * driver.cs: Add --timestamp, to see where the compiler spends
22442 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22443 `this' in static code.
22445 (SimpleName.DoResolve): Implement in terms of a helper function
22446 that allows static-references to be passed upstream to
22449 (Expression.ResolveWithSimpleName): Resolve specially simple
22450 names when called by MemberAccess to implement the special
22453 (Expression.ImplicitReferenceConversion): Handle conversions from
22454 Null to reference types before others, as Null's type is
22457 * expression.cs (Invocation.EmitCall): Handle the special case of
22458 calling methods declared on a reference type from a ValueType
22459 (Base classes System.Object and System.Enum)
22461 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22462 the left hand side is a TypeExpr, not on every enumeration.
22464 (Binary.Resolve): If types are reference types, then do a cast to
22465 object on operators != and == of both arguments.
22467 * typemanager.cs (FindMembers): Extract instance and static
22468 members if requested.
22470 * interface.cs (PopulateProperty): Use void_type instead of null
22471 as the return type for the setter method.
22473 (PopulateIndexer): ditto.
22475 2001-12-27 Ravi Pratap <ravi@ximian.com>
22477 * support.cs (ReflectionParameters): Fix minor bug where we
22478 were examining the wrong parameter for the ParamArray attribute.
22480 Cope with requests for the type of the parameter at position
22481 greater than the params parameter's. We now return the element
22482 type of the params array as that makes more sense.
22484 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22485 accordingly as we no longer have to extract the element type
22488 (Invocation.OverloadResolve): Update.
22490 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22492 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22493 against IEnumerator, test whether the return value is a descendant
22494 of the IEnumerator interface.
22496 * class.cs (Indexer.Define): Use an auxiliary method to implement
22497 the other bits of the method definition. Begin support for
22498 explicit interface implementation.
22500 (Property.DefineMethod): Use TypeManager.void_type instead of null
22501 for an empty return value.
22503 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22505 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22506 dealing with a FieldExpr which is composed of a FieldBuilder, in
22507 the code path we did extract the constant, but we should have
22508 obtained the underlying value to be able to cast it (otherwise we
22509 end up in an infinite loop, this is what Ravi was running into).
22511 (ArrayCreation.UpdateIndices): Arrays might be empty.
22513 (MemberAccess.ResolveMemberAccess): Add support for section
22514 14.5.4.1 that deals with the special case of E.I when E is a type
22515 and something else, that I can be a reference to a static member.
22517 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22518 handle a particular array type to create byte blobs, it is just
22519 something we dont generate byteblobs for.
22521 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22524 * location.cs (Push): remove the key from the hashtable that we
22525 are about to add. This happens for empty files.
22527 * driver.cs: Dispose files after we have parsed them.
22529 (tokenize): new function that only runs the tokenizer on its
22530 input, for speed testing.
22532 2001-12-26 Ravi Pratap <ravi@ximian.com>
22534 * class.cs (Event.Define): Define the private field only if there
22535 are no accessors defined.
22537 * expression.cs (ResolveMemberAccess): If there is no associated
22538 field with the event, that means we have an event defined with its
22539 own accessors and we should flag error cs0070 since transforming
22540 ourselves into a field is not valid in that case.
22542 * ecore.cs (SimpleName.DoResolve): Same as above.
22544 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22545 and charset to sane values.
22547 2001-12-25 Ravi Pratap <ravi@ximian.com>
22549 * assign.cs (DoResolve): Perform check on events only if they
22550 are being accessed outside the declaring type.
22552 * cs-parser.jay (event_declarations): Update rules to correctly
22553 set the type of the implicit parameter etc.
22555 (add_accessor, remove_accessor): Set current local parameters.
22557 * expression.cs (Binary): For delegate addition and subtraction,
22558 cast the return value from the method into the appropriate delegate
22561 2001-12-24 Ravi Pratap <ravi@ximian.com>
22563 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22564 of these as the workaround is unnecessary.
22566 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22567 delegate data - none of that is needed at all.
22569 Re-write bits to extract the instance expression and the delegate method
22572 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22575 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22576 of attaching attributes instead of duplicating code everywhere.
22578 * everywhere : Update code to do attribute emission using the above method.
22580 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22582 * expression.cs (IsParamsMethodApplicable): if there are not
22583 parameters, return immediately.
22585 * ecore.cs: The 0 literal can be implicity converted to an enum
22588 (SimpleName.DoResolve): First lookup the type, then lookup the
22591 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22592 want to get its address. If the InstanceExpression is not
22593 addressable, store the result in a temporary variable, then get
22596 * codegen.cs: Only display 219 errors on warning level or above.
22598 * expression.cs (ArrayAccess): Make it implement the
22599 IMemoryLocation interface.
22601 (Binary.DoResolve): handle the operator == (object a, object b)
22602 and operator != (object a, object b) without incurring into a
22603 BoxedCast (because 5 != o should never be performed).
22605 Handle binary enumerator operators.
22607 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22608 value type, otherwise use Ldelem_ref.
22610 Use precomputed names;
22612 (AddressOf): Implement address of
22614 * cs-parser.jay (labeled_statement): Fix recursive block
22615 addition by reworking the production.
22617 * expression.cs (New.DoEmit): New has a special case:
22619 If we are dealing with a ValueType, we have a few
22620 situations to deal with:
22622 * The target of New is a ValueType variable, that is
22623 easy, we just pass this as the variable reference
22625 * The target of New is being passed as an argument,
22626 to a boxing operation or a function that takes a
22629 In this case, we need to create a temporary variable
22630 that is the argument of New.
22633 2001-12-23 Ravi Pratap <ravi@ximian.com>
22635 * rootcontext.cs (LookupType): Check that current_type is not null before
22636 going about looking at nested types.
22638 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22639 not implement the IAssignMethod interface any more.
22641 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22642 where we tranform them into FieldExprs if they are being resolved from within
22643 the declaring type.
22645 * ecore.cs (SimpleName.DoResolve): Do the same here.
22647 * assign.cs (DoResolve, Emit): Clean up code considerably.
22649 * ../errors/bug10.cs : Add.
22651 * ../errors/cs0070.cs : Add.
22653 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22655 * assign.cs : Get rid of EventIsLocal everywhere.
22657 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22659 * ecore.cs (ConvertIntLiteral): finished the implementation.
22661 * statement.cs (SwitchLabel): Convert the value we are using as a
22662 key before looking up the table.
22664 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22666 * codegen.cs (EmitTopBlock): Require a Location argument now.
22668 * cs-parser.jay (constructor_declarator): We need to setup
22669 current_local_parameters before we parse the
22670 opt_constructor_initializer, to allow the variables to be bound
22671 to the constructor arguments.
22673 * rootcontext.cs (LookupType): First lookup nested classes in our
22674 class and our parents before we go looking outside our class.
22676 * expression.cs (ConstantFold): Extract/debox the values at the
22679 * rootcontext.cs (EmitCode): Resolve the constants first before we
22680 resolve the types. This is not really needed, but it helps debugging.
22682 * statement.cs: report location.
22684 * cs-parser.jay: pass location to throw statement.
22686 * driver.cs: Small bug fix.
22688 * report.cs: Updated format to be 4-zero filled digits.
22690 2001-12-22 Ravi Pratap <ravi@ximian.com>
22692 * expression.cs (CheckIndices): Fix minor bug where the wrong
22693 variable was being referred to ;-)
22695 (DoEmit): Do not call EmitStaticInitializers when the
22696 underlying type is System.Object.
22698 2001-12-21 Ravi Pratap <ravi@ximian.com>
22700 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22701 and do the usual workaround for SRE.
22703 * class.cs (MyEventBuilder.EventType): New member to get at the type
22704 of the event, quickly.
22706 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22708 * assign.cs (Assign.DoResolve): Handle the case when the target
22709 is an EventExpr and perform the necessary checks.
22711 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22714 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22716 (EventExpr): Set the type in the constructor itself since we
22717 are meant to be born fully resolved.
22719 (EventExpr.Define): Revert code I wrote earlier.
22721 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22722 instance expression is null. The instance expression is a This in that case
22723 or a null, depending on whether it is a static method or not.
22725 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22726 refers to more than one method.
22728 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22729 and accordingly flag errors.
22731 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22733 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22735 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22737 * location.cs (ToString): Provide useful rutine.
22739 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22741 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22742 objects, return the actual integral boxed.
22744 * statement.cs (SwitchLabel): define an ILLabel for each
22747 (Switch.CheckSwitch): If the value is a Literal, extract
22748 the underlying literal.
22750 Also in the unused hashtable we had, add the SwitchLabel so we can
22751 quickly look this value up.
22753 * constant.cs: Implement a bunch of new constants. Rewrite
22754 Literal based on this. Made changes everywhere to adapt to this.
22756 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22757 dereferencing array only once, and also copes with enumrations.
22759 bytes are two bytes wide, not one.
22761 (Cast): Perform constant conversions.
22763 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22764 wrappers to the literals here.
22766 * expression.cs (DoNumericPromotions): long literals can converted
22767 to ulong implicity (this is taken care of elsewhere, but I was
22768 missing this spot).
22770 * ecore.cs (Expression.Literalize): Make the return type Literal,
22771 to improve type checking.
22773 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22775 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22777 * literal.cs: Revert code from ravi that checked the bounds. The
22778 bounds are sane by the definition of the type itself.
22780 * typemanager.cs: Fix implementation of ImplementsInterface. We
22781 need to actually look up in our parent hierarchy for interfaces
22784 * const.cs: Use the underlying type for enumerations
22786 * delegate.cs: Compute the basename for the delegate creation,
22787 that should fix the delegate test case, and restore the correct
22788 Type Lookup semantics in rootcontext
22790 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22791 referencing a nested type with the Reflection API is using the "+"
22794 * cs-parser.jay: Do not require EOF token at the end.
22796 2001-12-20 Ravi Pratap <ravi@ximian.com>
22798 * rootcontext.cs (LookupType): Concatenate type names with
22799 a '.' instead of a '+' The test suite passes again.
22801 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22802 field of the enumeration.
22804 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22805 the case when the member is an EventExpr.
22807 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22808 static has an associated instance expression.
22810 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22812 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22814 * class.cs (Event.Define): Register event and perform appropriate checks
22817 We define the Add and Remove methods even if the use provides none because
22818 in that case, we provide default implementations ourselves.
22820 Define a private field of the type of the event. This is done by the CSC compiler
22821 and we should be doing it too ;-)
22823 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22824 More methods we use in code we generate.
22826 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22829 (InitCoreTypes): Update accordingly for the above.
22831 * class.cs (Event.Emit): Generate code for default accessors that we provide
22833 (EmitDefaultMethod): Do the job in the above.
22835 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22838 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22840 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22841 builders even if we were missing one.
22843 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22844 pass the Basename as our class name instead of the Name. The
22845 basename will be correctly composed for us.
22847 * parameter.cs (Paramters): Now takes a Location argument.
22849 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22850 make all the code call directly LookupType in RootContext and take
22851 this chance to pass the Location information everywhere.
22853 * Everywhere: pass Location information.
22855 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22857 * class.cs (Constructor.Define): Updated way of detecting the
22858 length of the parameters.
22860 (TypeContainer.DefineType): Use basename as the type name for
22863 (TypeContainer.Define): Do not recursively define types here, as
22864 definition is taken care in order by the RootContext.
22866 * tree.cs: Keep track of namespaces in a per-file basis.
22868 * parameter.cs (Parameter.ComputeSignature): Update to use
22871 (Parameters.GetSignature): ditto.
22873 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22874 instead of a TypeContainer.
22876 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22877 resolve names. Because we need to be resolve in our context, not
22880 * driver.cs: Implement response files.
22882 * class.cs (TypeContainer.DefineType): If we are defined, do not
22883 redefine ourselves.
22885 (Event.Emit): Emit the code for add/remove handlers.
22886 (Event.Define): Save the MethodBuilders for add/remove.
22888 * typemanager.cs: Use pair here too.
22890 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22891 DictionaryEntry requires the first argument to be non-null.
22893 (enum_declaration): Compute full name for registering the
22896 (delegate_declaration): Instead of using
22897 formal_parameter_list, use opt_formal_parameter_list as the list
22900 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22901 (EventParsing): New property that controls whether `add' and
22902 `remove' are returned as tokens or identifiers (for events);
22904 2001-12-19 Ravi Pratap <ravi@ximian.com>
22906 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22907 use MyEventBuilder only and let it wrap the real builder for us.
22909 (MyEventBuilder): Revamp constructor etc.
22911 Implement all operations that we perform on EventBuilder in precisely the same
22914 (FindMembers): Update to use the EventBuilder member.
22916 (Event.Emit): Update accordingly.
22918 2001-12-18 Ravi Pratap <ravi@ximian.com>
22920 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22921 by calling the appropriate methods.
22923 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22926 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22928 2001-12-17 Ravi Pratap <ravi@ximian.com>
22930 * delegate.cs (Delegate.Populate): Check that the return type
22931 and various parameters types are indeed accessible.
22933 * class.cs (Constructor.Define): Same here.
22935 (Field.Define): Ditto.
22937 (Event.Define): Ditto.
22939 (Operator.Define): Check that the underlying Method defined itself
22940 correctly - so it's MethodBuilder should not be null.
22942 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22943 expression happens to be null.
22945 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22946 members but as of now we don't seem to be able to do anything really useful with it.
22948 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22949 not the EventBuilder.
22951 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22953 * cs-tokenizer.cs: Add support for defines.
22954 Add support for #if, #elif, #else, #endif
22956 (eval_var): evaluates a variable.
22957 (eval): stubbed for evaluating functions.
22959 * cs-parser.jay: Pass the defines information
22961 * driver.cs: Add --define command line option.
22963 * decl.cs: Move MemberCore here.
22965 Make it the base class for DeclSpace. This allows us to catch and
22966 report 108 and 109 for everything now.
22968 * class.cs (TypeContainer.Define): Extract all the members
22969 before populating and emit the warning 108 (new keyword required
22970 to override) instead of having each member implement this.
22972 (MemberCore.Define): New abstract method, we will be using this in
22973 the warning reporting engine in Populate.
22975 (Operator.Define): Adjust to new MemberCore protocol.
22977 * const.cs (Const): This does not derive from Expression, it is a
22978 temporary object we use to create fields, it is a MemberCore.
22980 * class.cs (Method.Define): Allow the entry point to be in a
22983 * driver.cs: Rewrite the argument handler to clean it up a bit.
22985 * rootcontext.cs: Made it just an auxiliary namespace feature by
22986 making everything static.
22988 * driver.cs: Adapt code to use RootContext type name instead of
22991 * delegate.cs: Remove RootContext argument.
22993 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22996 * class.cs (Event.Define): The lookup can fail.
22998 * cs-tokenizer.cs: Begin implementation of pre-procesor.
23000 * expression.cs: Resolve the this instance before invoking the code.
23002 2001-12-17 Miguel de Icaza <miguel@ximian.com>
23004 * cs-parser.jay: Add a production in element_access that allows
23005 the thing to become a "type" reference. This way we can parse
23006 things like "(string [])" as a type.
23008 Note that this still does not handle the more complex rules of
23012 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
23014 * ecore.cs: (CopyNewMethods): new utility function used to
23015 assemble the list of methods from running FindMembers.
23017 (MemberLookup): Rework FindMembers so that
23019 2001-12-16 Miguel de Icaza <miguel@ximian.com>
23021 * class.cs (TypeContainer): Remove Delegates who fail to be
23024 * delegate.cs (Populate): Verify that we dont get null return
23025 values. TODO: Check for AsAccessible.
23027 * cs-parser.jay: Use basename to emit error 574 (destructor should
23028 have the same name as container class), not the full name.
23030 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23031 possible representation.
23033 Also implements integer type suffixes U and L.
23035 2001-12-15 Miguel de Icaza <miguel@ximian.com>
23037 * expression.cs (ArrayCreation.DoResolve): We need to do the
23038 argument resolution *always*.
23040 * decl.cs: Make this hold the namespace. Hold the root context as
23042 (LookupType): Move here.
23044 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23046 * location.cs (Row, Name): Fixed the code, it was always returning
23047 references to the first file.
23049 * interface.cs: Register properties defined through interfaces.
23051 * driver.cs: Add support for globbing on the command line
23053 * class.cs (Field): Make it derive from MemberCore as well.
23056 2001-12-15 Ravi Pratap <ravi@ximian.com>
23058 * class.cs (Event::Define): Check that the type of the event is a delegate
23059 type else flag error #66.
23061 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23064 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23065 values of EntryPoint, CharSet etc etc.
23067 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23069 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23070 be null and we should ignore this. I am not sure if this is really clean. Apparently,
23071 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23072 which needs this to do its work.
23074 * ../errors/cs0066.cs : Add.
23076 2001-12-14 Miguel de Icaza <miguel@ximian.com>
23078 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23081 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23082 clears out the parameters field.
23083 (MemberSignatureCompare): Cleanup
23085 (MemberCore): New base class used to share code between MethodCore
23088 (RegisterRequiredImplementations) BindingFlags.Public requires
23089 either BindingFlags.Instace or Static. Use instance here.
23091 (Property): Refactored code to cope better with the full spec.
23093 * parameter.cs (GetParameterInfo): Return an empty array instead
23096 * class.cs (Property): Abstract or extern properties have no bodies.
23098 * parameter.cs (GetParameterInfo): return a zero-sized array.
23100 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23101 method modifier validation to the typecontainer so we can reuse
23102 this on properties.
23104 (MethodCore.ParameterTypes): return an empty sized array of types.
23106 (Property.Define): Test property modifier validity.
23108 Add tests for sealed/override too.
23110 (Method.Emit): abstract or extern methods have no bodies.
23112 2001-12-14 Ravi Pratap <ravi@ximian.com>
23114 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23117 (Method::Define, ::Emit): Modify accordingly.
23119 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23121 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23123 * makefile: Pass in /unsafe.
23125 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23127 * class.cs (MakeKey): Kill routine.
23129 * class.cs (TypeContainer.Define): Correctly define explicit
23130 method implementations (they require the full interface name plus
23133 * typemanager.cs: Deply the PtrHashtable here and stop using the
23134 lame keys. Things work so much better.
23136 This of course broke everyone who depended on `RegisterMethod' to
23137 do the `test for existance' test. This has to be done elsewhere.
23139 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23140 the object stupid Equals method (because, that like fails all over
23141 the place). We still do not use it.
23143 * class.cs (TypeContainer.SetRequiredInterface,
23144 TypeContainer.RequireMethods): Killed these two routines and moved
23145 all the functionality to RegisterRequiredImplementations.
23147 (TypeContainer.RegisterRequiredImplementations): This routine now
23148 registers all the implementations required in an array for the
23149 interfaces and abstract methods. We use an array of structures
23150 which can be computed ahead of time to reduce memory usage and we
23151 also assume that lookups are cheap as most classes will not
23152 implement too many interfaces.
23154 We also avoid creating too many MethodSignatures.
23156 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23157 clear the "pending" bit if we find that there are problems with
23160 (TypeContainer.VerifyPendingMethods): Update to report errors of
23161 methods that look like implementations but are not.
23163 (TypeContainer.Define): Add support for explicit interface method
23166 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23168 * typemanager.cs: Keep track of the parameters here instead of
23169 being a feature of the TypeContainer.
23171 * class.cs: Drop the registration of parameters here, as
23172 InterfaceMethods are also interface declarations.
23174 * delegate.cs: Register methods with the TypeManager not only with
23175 the TypeContainer. This code was buggy.
23177 * interface.cs: Full registation here.
23179 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23181 * expression.cs: Remove reducer for binary expressions, it can not
23184 * const.cs: Put here the code that used to go into constant.cs
23186 * constant.cs: Put here the code for constants, this is a new base
23187 class for Literals.
23189 * literal.cs: Make Literal derive from Constant.
23191 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23193 * statement.cs (Return.Emit): Report error 157 if the user
23194 attempts to return from a finally block.
23196 (Return.Emit): Instead of emitting a return, jump to the end of
23199 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23200 LocalBuilder to store the result of the function. ReturnLabel is
23201 the target where we jump.
23204 2001-12-09 Radek Doulik <rodo@ximian.com>
23206 * cs-parser.jay: remember alias in current namespace
23208 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23211 * class.cs (LookupAlias): lookup alias in my_namespace
23213 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23215 (LookupAlias): lookup alias in this and if needed in parent
23218 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23222 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23223 making things static. I need this to avoid passing the
23224 TypeContainer when calling ParameterType.
23226 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23227 that did string manipulation to compute the type and then call
23228 GetType. Use Parameter.ParameterType instead.
23230 * cs-tokenizer.cs: Consume the suffix for floating values.
23232 * expression.cs (ParameterReference): figure out whether this is a
23233 reference parameter or not. Kill an extra variable by computing
23234 the arg_idx during emission.
23236 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23237 function that returns whether a parameter is an out/ref value or not.
23239 (Parameter.ParameterType): The type of the parameter (base,
23240 without ref/out applied).
23242 (Parameter.Resolve): Perform resolution here.
23243 (Parameter.ExternalType): The full type (with ref/out applied).
23245 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23246 support for expressions on the using statement.
23248 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23250 * statement.cs (Using.EmitLocalVariableDecls): Split the
23251 localvariable handling of the using statement.
23253 (Block.EmitMeta): Keep track of variable count across blocks. We
23254 were reusing slots on separate branches of blocks.
23256 (Try.Emit): Emit the general code block, we were not emitting it.
23258 Check the type of the declaration to be an IDisposable or
23259 something that can be implicity converted to it.
23261 Emit conversions if required.
23263 * ecore.cs (EmptyExpression): New utility class.
23264 (Expression.ImplicitConversionExists): New utility function.
23266 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23268 * statement.cs (Using): Implement.
23270 * expression.cs (LocalVariableReference): Support read only variables.
23272 * statement.cs: Remove the explicit emit for the Leave opcode.
23273 (VariableInfo): Add a readonly field.
23275 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23277 * ecore.cs (ConvCast): new class used to encapsulate the various
23278 explicit integer conversions that works in both checked and
23279 unchecked contexts.
23281 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23282 properly generate the overflow opcodes.
23284 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23286 * statement.cs: The correct type for the EmptyExpression is the
23287 element_type, not the variable type. Ravi pointed this out.
23289 2001-12-04 Ravi Pratap <ravi@ximian.com>
23291 * class.cs (Method::Define): Handle PInvoke methods specially
23292 by using DefinePInvokeMethod instead of the usual one.
23294 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23295 above to do the task of extracting information and defining the method.
23297 2001-12-04 Ravi Pratap <ravi@ximian.com>
23299 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23300 of the condition for string type.
23302 (Emit): Move that here.
23304 (ArrayCreation::CheckIndices): Keep string literals in their expression
23307 (EmitDynamicInitializers): Handle strings appropriately.
23309 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23311 * codegen.cs (EmitContext): Replace multiple variables with a
23312 single pointer to the current Switch statement.
23314 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23317 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23321 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23324 (Foreach.Emit): Foreach on arrays was not setting
23325 up the loop variables (for break/continue).
23327 (GotoCase): Semi-implented.
23329 2001-12-03 Ravi Pratap <ravi@ximian.com>
23331 * attribute.cs (CheckAttribute): Handle system attributes by using
23332 Attribute.GetAttributes to examine information we need.
23334 (GetValidPlaces): Same here.
23336 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23338 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23340 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23342 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23344 (Method::Emit): Handle the case when we are a PInvoke method.
23346 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23348 * expression.cs: Use ResolveWithSimpleName on compound names.
23350 2001-12-02 Ravi Pratap <ravi@ximian.com>
23352 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23353 before trying to reduce it.
23355 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23357 * constant.cs (LookupConstantValue): Implement.
23359 (EmitConstant): Use the above in emitting the constant.
23361 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23362 that are user-defined by doing a LookupConstantValue on them.
23364 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23367 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23369 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23371 (BaseAccess.DoResolve): Implement.
23373 (MemberAccess.DoResolve): Split this routine into a
23374 ResolveMemberAccess routine that can be used independently
23376 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23378 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23379 As that share bits of the implementation. Is returns a boolean,
23380 while As returns the Type that is being probed.
23382 2001-12-01 Ravi Pratap <ravi@ximian.com>
23384 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23385 instead of a Literal - much easier.
23387 (EnumInTransit): Remove - utterly useless :-)
23389 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23391 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23393 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23394 chain when we have no associated expression.
23396 2001-11-30 Ravi Pratap <ravi@ximian.com>
23398 * constant.cs (Define): Use Location while reporting the errror.
23400 Also emit a warning when 'new' is used and there is no inherited
23403 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23406 (LookupEnumValue): Implement to lookup an enum member's value and define it
23409 (Populate): Re-write accordingly to use the above routine.
23411 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23413 * expression.cs (This): Fix prototype for DoResolveLValue to
23414 override the base class DoResolveLValue.
23416 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23419 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23420 (we need to load the address of the field here). This fixes
23423 (FieldExpr.DoResolveLValue): Call the DoResolve
23424 function to initialize the Instance expression.
23426 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23427 correctly the GetEnumerator operation on a value type.
23429 * cs-parser.jay: Add more simple parsing error catches.
23431 * statement.cs (Switch): Add support for string switches.
23432 Handle null specially.
23434 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23436 2001-11-28 Ravi Pratap <ravi@ximian.com>
23438 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23440 (declare_local_constant): New helper function.
23442 * statement.cs (AddConstant): Keep a separate record of constants
23444 (IsConstant): Implement to determine if a variable is a constant.
23446 (GetConstantExpression): Implement.
23448 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23450 * statement.cs (IsVariableDefined): Re-write.
23452 2001-11-27 Ravi Pratap <ravi@ximian.com>
23454 * class.cs (TypeContainer::FindMembers): Look for constants
23455 in the case when we are looking for MemberTypes.Field
23457 * expression.cs (MemberAccess::DoResolve): Check that in the
23458 case we are a FieldExpr and a Literal, we are not being accessed
23459 by an instance reference.
23461 * cs-parser.jay (local_constant_declaration): Implement.
23463 (declaration_statement): Implement for constant declarations.
23465 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23467 * statement.cs (Switch): Catch double defaults.
23469 (Switch): More work on the switch() statement
23470 implementation. It works for integral values now, need to finish
23474 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23476 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23477 integer literals into other integer literals. To be used by
23480 2001-11-24 Ravi Pratap <ravi@ximian.com>
23482 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23485 (EmitDynamicInitializers): Cope with the above since we extract data
23486 directly from ArrayData now.
23488 (ExpectInitializers): Keep track of whether initializers are mandatory
23491 (Bounds): Make it a hashtable to prevent the same dimension being
23492 recorded for every element in that dimension.
23494 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23497 Also fix bug which was causing the indices to be emitted in the reverse
23500 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23502 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23503 unfinished. They do not work, because the underlying code is
23506 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23508 * cs-parser.jay: Remove bogus fixme.
23510 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23511 on Switch statement.
23513 2001-11-23 Ravi Pratap <ravi@ximian.com>
23515 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23518 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23519 parameter. Apparently, any expression is allowed.
23521 (ValidateInitializers): Update accordingly.
23523 (CheckIndices): Fix some tricky bugs thanks to recursion.
23525 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23526 I was being completely brain-dead.
23528 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23529 and re-write acordingly.
23531 (DelegateInvocation): Re-write accordingly.
23533 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23535 (MakeByteBlob): Handle types more correctly.
23537 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23538 initialization from expressions but it is incomplete because I am a complete
23541 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23543 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23544 on If. Basically, we have to return `true' (ie, we do return to
23545 our caller) only if both branches of the if return.
23547 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23548 short-circuit operators, handle them as short circuit operators.
23550 (Cast.DoResolve): Resolve type.
23551 (Cast.Cast): Take an expression as the target type.
23553 * cs-parser.jay (cast_expression): Remove old hack that only
23554 allowed a limited set of types to be handled. Now we take a
23555 unary_expression and we resolve to a type during semantic
23558 Use the grammar productions from Rhys to handle casts (this is
23559 not complete like Rhys syntax yet, we fail to handle that corner
23560 case that C# has regarding (-x), but we will get there.
23562 2001-11-22 Ravi Pratap <ravi@ximian.com>
23564 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23565 field which is an array type.
23567 * cs-parser.jay (declare_local_variables): Support array initialization too.
23569 * typemanager.cs (MakeKey): Implement.
23571 (everywhere): Use the above appropriately.
23573 * cs-parser.jay (for_statement): Update for array initialization while
23574 declaring variables.
23576 * ecore.cs : The error message was correct, it's the variable's names that
23577 were misleading ;-) Make the code more readable.
23579 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23580 the correct type etc.
23582 (ConvertExplicit): Handle Enum types by examining the underlying type.
23584 2001-11-21 Ravi Pratap <ravi@ximian.com>
23586 * parameter.cs (GetCallingConvention): Always return
23587 CallingConventions.Standard for now.
23589 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23591 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23592 and `r' after calling DoNumericPromotions.
23594 * ecore.cs: Fix error message (the types were in the wrong order).
23596 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23597 BindingFlags.Instance as well
23599 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23600 implicit int literal conversion in an empty cast so that we
23601 propagate the right type upstream.
23603 (UnboxCast): new class used to unbox value types.
23604 (Expression.ConvertExplicit): Add explicit type conversions done
23607 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23608 the target type before applying the implicit LongLiterals to ULong
23611 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23613 * cs-parser.jay (for_statement): Reworked the way For works: now
23614 we declare manually any variables that are introduced in
23615 for_initializer to solve the problem of having out-of-band code
23616 emition (that is what got for broken).
23618 (declaration_statement): Perform the actual variable declaration
23619 that used to be done in local_variable_declaration here.
23621 (local_variable_declaration): Do not declare anything, just pass
23622 the information on a DictionaryEntry
23624 2001-11-20 Ravi Pratap <ravi@ximian.com>
23626 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23627 re-write of the logic to now make it recursive.
23629 (UpdateIndices): Re-write accordingly.
23631 Store element data in a separate ArrayData list in the above methods.
23633 (MakeByteBlob): Implement to dump the array data into a byte array.
23635 2001-11-19 Ravi Pratap <ravi@ximian.com>
23637 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23640 * constant.cs (Define): Implement.
23642 (EmitConstant): Re-write fully.
23644 Pass in location info.
23646 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23649 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23650 DictionaryEntry since we need location info too.
23652 (constant_declaration): Update accordingly.
23654 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23655 code into another method : UpdateIndices.
23657 2001-11-18 Ravi Pratap <ravi@ximian.com>
23659 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23660 some type checking etc.
23662 2001-11-17 Ravi Pratap <ravi@ximian.com>
23664 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23665 bits to provide dimension info if the user skips doing that.
23667 Update second constructor to store the rank correctly.
23669 2001-11-16 Ravi Pratap <ravi@ximian.com>
23671 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23672 and try to implement.
23674 * ../errors/cs0150.cs : Add.
23676 * ../errors/cs0178.cs : Add.
23678 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23680 * statement.cs: Implement foreach on multi-dimensional arrays.
23682 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23683 name of the params argument.
23685 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23686 initializing the array.
23688 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23689 we can use this elsewhere.
23691 * statement.cs: Finish implementation of foreach for single
23694 * cs-parser.jay: Use an out-of-band stack to pass information
23695 around, I wonder why I need this.
23697 foreach_block: Make the new foreach_block the current_block.
23699 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23700 function used to return a static Parameters structure. Used for
23701 empty parameters, as those are created very frequently.
23703 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23705 2001-11-15 Ravi Pratap <ravi@ximian.com>
23707 * interface.cs : Default modifier is private, not public. The
23708 make verify test passes again.
23710 2001-11-15 Ravi Pratap <ravi@ximian.com>
23712 * support.cs (ReflectionParameters): Fix logic to determine
23713 whether the last parameter is a params one. Test 9 passes again.
23715 * delegate.cs (Populate): Register the builders we define with
23716 RegisterParameterForBuilder. Test 19 passes again.
23718 * cs-parser.jay (property_declaration): Reference $6 instead
23719 of $$ to get at the location.
23721 (indexer_declaration): Similar stuff.
23723 (attribute): Ditto.
23725 * class.cs (Property): Register parameters for the Get and Set methods
23726 if they exist. Test 23 passes again.
23728 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23729 call to EmitArguments as we are sure there aren't any params arguments.
23730 Test 32 passes again.
23732 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23733 IndexOutOfRangeException.
23735 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23736 Test 33 now passes again.
23738 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23740 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23741 broke a bunch of things. Will have to come up with a better way
23742 of tracking locations.
23744 * statement.cs: Implemented foreach for single dimension arrays.
23746 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23748 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23749 an error. This removes the lookup from the critical path.
23751 * cs-parser.jay: Removed use of temporary_loc, which is completely
23754 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23756 * support.cs (ReflectionParameters.ParameterModifier): Report
23757 whether the argument is a PARAMS argument or not.
23759 * class.cs: Set the attribute `ParamArrayAttribute' on the
23760 parameter argument.
23762 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23763 and cons_param_array_attribute (ConstructorInfo for
23764 ParamArrayAttribute).,
23766 * codegen.cs: Emit the return using the `Return' statement, that
23767 way we can report the error correctly for missing return values.
23769 * class.cs (Method.Emit): Clean up.
23771 * expression.cs (Argument.Resolve): Take another argument: the
23772 location where this argument is used. Notice that this is not
23773 part of the "Argument" class as to reduce the size of the
23774 structure (we know the approximate location anyways).
23776 Test if the argument is a variable-reference, if not, then
23777 complain with a 206.
23779 (Argument.Emit): Emit addresses of variables.
23781 (Argument.FullDesc): Simplify.
23783 (Invocation.DoResolve): Update for Argument.Resolve.
23785 (ElementAccess.DoResolve): ditto.
23787 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23788 method should be virtual, as this method is always virtual.
23790 (NewDelegate.DoResolve): Update for Argument.Resolve.
23792 * class.cs (ConstructorInitializer.DoResolve): ditto.
23794 * attribute.cs (Attribute.Resolve): ditto.
23796 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23798 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23800 * expression.cs (ParameterReference): Drop IStackStorage and implement
23801 IAssignMethod instead.
23803 (LocalVariableReference): ditto.
23805 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23806 IAssignMethod instead.
23808 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23810 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23811 enumerations that are used in heavily used structures derive from
23812 byte in a laughable and pathetic attempt to reduce memory usage.
23813 This is the kind of pre-optimzations that you should not do at
23814 home without adult supervision.
23816 * expression.cs (UnaryMutator): New class, used to handle ++ and
23817 -- separatedly from the other unary operators. Cleans up the
23818 code, and kills the ExpressionStatement dependency in Unary.
23820 (Unary): Removed `method' and `Arguments' from this class, making
23821 it smaller, and moving it all to SimpleCall, so I can reuse this
23822 code in other locations and avoid creating a lot of transient data
23823 strucutres when not required.
23825 * cs-parser.jay: Adjust for new changes.
23827 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23829 * enum.cs (Enum.Populate): If there is a failure during
23832 * cs-parser.jay (opt_enum_base): we used to catch type errors
23833 here, but this is really incorrect. The type error should be
23834 catched during semantic analysis.
23836 2001-12-11 Ravi Pratap <ravi@ximian.com>
23838 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23839 current_local_parameters as expected since I, in my stupidity, had forgotten
23842 * attribute.cs (GetValidPlaces): Fix stupid bug.
23844 * class.cs (Method::Emit): Perform check on applicability of attributes.
23846 (Constructor::Emit): Ditto.
23848 (Field::Emit): Ditto.
23850 (Field.Location): Store location information.
23852 (Property, Event, Indexer, Operator): Ditto.
23854 * cs-parser.jay (field_declaration): Pass in location for each field.
23856 * ../errors/cs0592.cs : Add.
23858 2001-11-12 Ravi Pratap <ravi@ximian.com>
23860 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23862 (InitCoreTypes): Update accordingly.
23864 (RegisterAttrType, LookupAttr): Implement.
23866 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23867 info about the same.
23869 (Resolve): Update to populate the above as necessary.
23871 (Error592): Helper.
23873 (GetValidPlaces): Helper to the above.
23875 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23877 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23879 2001-11-12 Ravi Pratap <ravi@ximian.com>
23881 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23883 * ../errors/cs0617.cs : Add.
23885 2001-11-11 Ravi Pratap <ravi@ximian.com>
23887 * enum.cs (Emit): Rename to Populate to be more consistent with what
23888 we expect it to do and when exactly it is called.
23890 * class.cs, rootcontext.cs : Update accordingly.
23892 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23893 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23895 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23897 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23898 of a fieldinfo using the above, when dealing with a FieldBuilder.
23900 2001-11-10 Ravi Pratap <ravi@ximian.com>
23902 * ../errors/cs0031.cs : Add.
23904 * ../errors/cs1008.cs : Add.
23906 * ../errrors/cs0543.cs : Add.
23908 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23911 (FindMembers): Implement.
23913 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23914 enums and delegates too.
23916 (enum_types): Rename to builder_to_enum.
23918 (delegate_types): Rename to builder_to_delegate.
23920 * delegate.cs (FindMembers): Implement.
23922 2001-11-09 Ravi Pratap <ravi@ximian.com>
23924 * typemanager.cs (IsEnumType): Implement.
23926 * enum.cs (Emit): Re-write parts to account for the underlying type
23927 better and perform checking etc.
23929 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23930 of the underlying type.
23932 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23935 * enum.cs (error31): Helper to report error #31.
23937 * cs-parser.jay (enum_declaration): Store location of each member too.
23939 * enum.cs (member_to_location): New hashtable.
23941 (AddEnumMember): Update location hashtable.
23943 (Emit): Use the location of each member while reporting errors.
23945 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23947 * cs-parser.jay: A for_initializer if is a
23948 local_variable_declaration really ammount to have an implicit
23949 block with the variable declaration and no initializer for for.
23951 * statement.cs (For.Emit): Cope with null initializers.
23953 This fixes the infinite loop on for initializers.
23955 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23957 * enum.cs: More cleanup.
23959 * ecore.cs: Remove dead code.
23961 * class.cs (Property.Emit): More simplification.
23962 (Event.Emit): ditto.
23964 Reworked to have less levels of indentation.
23966 2001-11-08 Ravi Pratap <ravi@ximian.com>
23968 * class.cs (Property): Emit attributes.
23978 * enum.cs (Emit): Ditto.
23980 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23983 * class.cs (Field, Event, etc.): Move attribute generation into the
23984 Emit method everywhere.
23986 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23987 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23988 as we had no way of defining nested enums !
23990 * rootcontext.cs : Adjust code accordingly.
23992 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23994 2001-11-07 Ravi Pratap <ravi@ximian.com>
23996 * expression.cs (EvalConstantExpression): Move into ecore.cs
23998 * enum.cs (Enum): Rename some members and make them public and readonly
23999 according to our convention.
24001 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24004 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24006 (Enum::Emit): Write a simple version for now which doesn't try to compute
24007 expressions. I shall modify this to be more robust in just a while.
24009 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24011 (TypeContainer::CloseType): Create the Enum types too.
24013 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24015 * expression.cs (EvalConstantExpression): Get rid of completely.
24017 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24018 user-defined values and other cases.
24020 (IsValidEnumLiteral): Helper function.
24022 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
24023 out there in the case we had a literal FieldExpr.
24025 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24027 (Literalize): Revamp a bit to take two arguments.
24029 (EnumLiteral): New class which derives from Literal to wrap enum literals.
24031 2001-11-06 Ravi Pratap <ravi@ximian.com>
24033 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24035 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24037 (Resolve): Use the above to ensure we have proper initializers.
24039 2001-11-05 Ravi Pratap <ravi@ximian.com>
24041 * expression.cs (Expression::EvalConstantExpression): New method to
24042 evaluate constant expressions.
24044 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24046 2001-11-07 Miguel de Icaza <miguel@ximian.com>
24048 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24051 (Binary.ResolveOperator): Handle operator != (object a, object b)
24052 and operator == (object a, object b);
24054 (Binary.DoNumericPromotions): Indicate whether the numeric
24055 promotion was possible.
24057 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24060 Made the ArrayAccess implement interface IAssignMethod instead of
24061 IStackStore as the order in which arguments are passed reflects
24064 * assign.cs: Instead of using expr.ExprClass to select the way of
24065 assinging, probe for the IStackStore/IAssignMethod interfaces.
24067 * typemanager.cs: Load InitializeArray definition.
24069 * rootcontext.cs (RootContext.MakeStaticData): Used to define
24070 static data that can be used to initialize arrays.
24072 2001-11-05 Miguel de Icaza <miguel@ximian.com>
24074 * expression.cs: Handle operator== and operator!= for booleans.
24076 (Conditioal.Reduce): Implement reducer for the ?: operator.
24078 (Conditional.Resolve): Implement dead code elimination.
24080 (Binary.Resolve): Catch string literals and return a new
24081 concatenated string.
24083 (Unary.Reduce): Implement reduction of unary expressions.
24085 * ecore.cs: Split out the expression core handling here.
24087 (Expression.Reduce): New method used to perform constant folding
24088 and CSE. This is needed to support constant-expressions.
24090 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24091 targets, and optimize for !x.
24093 2001-11-04 Ravi Pratap <ravi@ximian.com>
24095 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24096 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24097 set custom atttributes.
24099 * literal.cs (Literal::GetValue): New abstract method to return the actual
24100 value of the literal, cast as an object.
24102 (*Literal): Implement GetValue method.
24104 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24105 expressions to the arraylist but objects of type Argument.
24107 * class.cs (TypeContainer::Emit): Emit our attributes too.
24109 (Method::Emit, Constructor::Emit): Ditto.
24111 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24112 to be ignoring earlier.
24114 2001-11-03 Ravi Pratap <ravi@ximian.com>
24116 * attribute.cs (AttributeSection::Define): Implement to do the business
24117 of constructing a CustomAttributeBuilder.
24119 (Attribute): New trivial class. Increases readability of code.
24121 * cs-parser.jay : Update accordingly.
24123 (positional_argument_list, named_argument_list, named_argument): New rules
24125 (attribute_arguments): Use the above so that we are more correct.
24127 2001-11-02 Ravi Pratap <ravi@ximian.com>
24129 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24130 to perform all checks for a method with a params parameter.
24132 (Invocation::OverloadResolve): Update to use the above method and therefore
24133 cope correctly with params method invocations.
24135 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24138 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24139 constructors in our parent too because we can't afford to miss out on
24142 * attribute.cs (AttributeSection): New name for the class Attribute
24144 Other trivial changes to improve readability.
24146 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24147 use the new class names.
24149 2001-11-01 Ravi Pratap <ravi@ximian.com>
24151 * class.cs (Method::Define): Complete definition for params types too
24153 (Indexer::Define): Ditto.
24155 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24156 Cope everywhere with a request for info about the array parameter.
24158 2001-11-01 Ravi Pratap <ravi@ximian.com>
24160 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24162 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24163 local_variable_type to extract the string corresponding to the type.
24165 (local_variable_type): Fixup the action to use the new helper method.
24167 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24170 * expression.cs : Clean out code which uses the above.
24172 2001-10-31 Ravi Pratap <ravi@ximian.com>
24174 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24175 and bale out if necessary by returning a false.
24177 (RegisterProperty): Ditto.
24179 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24180 and print out appropriate error messages.
24182 * interface.cs (everywhere): Ditto.
24184 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24185 location to constructor.
24187 * class.cs (Property, Event, Indexer): Update accordingly.
24189 * ../errors/cs111.cs : Added.
24191 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24192 of a method, as laid down by the spec.
24194 (Invocation::OverloadResolve): Use the above method.
24196 2001-10-31 Ravi Pratap <ravi@ximian.com>
24198 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24199 now take a TypeContainer and a Parameters object.
24201 (ParameterData): Modify return type of ParameterModifier method to be
24202 Parameter.Modifier and not a string.
24204 (ReflectionParameters, InternalParameters): Update accordingly.
24206 * expression.cs (Argument::GetParameterModifier): Same here.
24208 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24209 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24210 symbol in it at all so maybe this is only for now.
24212 2001-10-30 Ravi Pratap <ravi@ximian.com>
24214 * support.cs (InternalParameters): Constructor now takes an extra argument
24215 which is the actual Parameters class.
24217 (ParameterDesc): Update to provide info on ref/out modifiers.
24219 * class.cs (everywhere): Update call to InternalParameters to pass in
24220 the second argument too.
24222 * support.cs (ParameterData): Add ParameterModifier, which is a method
24223 to return the modifier info [ref/out etc]
24225 (InternalParameters, ReflectionParameters): Implement the above.
24227 * expression.cs (Argument::ParameterModifier): Similar function to return
24228 info about the argument's modifiers.
24230 (Invocation::OverloadResolve): Update to take into account matching modifiers
24233 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24234 a new SetFormalParameters object which we pass to InternalParameters.
24236 2001-10-30 Ravi Pratap <ravi@ximian.com>
24238 * expression.cs (NewArray): Merge into the ArrayCreation class.
24240 2001-10-29 Ravi Pratap <ravi@ximian.com>
24242 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24243 NewUserdefinedArray into one as there wasn't much of a use in having
24246 * expression.cs (Argument): Change field's name to ArgType from Type.
24248 (Type): New readonly property which returns the proper type, taking into
24249 account ref/out modifiers.
24251 (everywhere): Adjust code accordingly for the above.
24253 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24254 whether we are emitting for a ref or out parameter.
24256 * expression.cs (Argument::Emit): Use the above field to set the state.
24258 (LocalVariableReference::Emit): Update to honour the flag and emit the
24261 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24263 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24265 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24267 (ReflectionParameters, InternalParameters): Implement the above method.
24269 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24272 (Invocation::FullMethodDesc): Ditto.
24274 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24276 * cs-parser.jay: Add extra production for the second form of array
24279 * expression.cs (ArrayCreation): Update to reflect the above
24282 * Small changes to prepare for Array initialization.
24284 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24286 * typemanager.cs (ImplementsInterface): interface might be null;
24287 Deal with this problem;
24289 Also, we do store negative hits on the cache (null values), so use
24290 this instead of calling t.GetInterfaces on the type everytime.
24292 2001-10-28 Ravi Pratap <ravi@ximian.com>
24294 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24296 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24297 split functionality out into different classes.
24299 (New::FormArrayType): Move into NewBuiltinArray.
24301 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24304 (NewBuiltinArray): New class to handle creation of built-in arrays.
24306 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24307 account creation of one-dimensional arrays.
24309 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24311 (NewUserdefinedArray::DoResolve): Implement.
24313 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24315 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24316 we maintain inside the TypeManager. This is necessary to perform lookups on the
24319 (LookupType): Update to perform GetType on the module builders too.
24321 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24323 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24325 2001-10-23 Ravi Pratap <ravi@ximian.com>
24327 * expression.cs (New::DoResolve): Implement guts of array creation.
24329 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24331 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24333 * expression.cs: Fix bug I introduced lsat night that broke
24336 (Expression.Resolve): Report a 246 error (can not resolve name)
24337 if we find a SimpleName in the stream.
24339 (Expression.ResolveLValue): Ditto.
24341 (Expression.ResolveWithSimpleName): This function is a variant of
24342 ResolveName, this one allows SimpleNames to be returned without a
24343 warning. The only consumer of SimpleNames is MemberAccess
24345 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24347 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24348 might arrive here. I have my doubts that this is correct.
24350 * statement.cs (Lock): Implement lock statement.
24352 * cs-parser.jay: Small fixes to support `lock' and `using'
24354 * cs-tokenizer.cs: Remove extra space
24356 * driver.cs: New flag --checked, allows to turn on integer math
24359 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24360 Threading.Monitor.Exit
24362 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24364 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24365 Expression Class to be IndexerAccess.
24367 Notice that Indexer::DoResolve sets the eclass to Value.
24369 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24371 * class.cs (TypeContainer::Emit): Emit code for indexers.
24373 * assign.cs (IAssignMethod): New interface implemented by Indexers
24374 and Properties for handling assignment.
24376 (Assign::Emit): Simplify and reuse code.
24378 * expression.cs (IndexerAccess, PropertyExpr): Implement
24379 IAssignMethod, clean up old code.
24381 2001-10-22 Ravi Pratap <ravi@ximian.com>
24383 * typemanager.cs (ImplementsInterface): New method to determine if a type
24384 implements a given interface. Provides a nice cache too.
24386 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24389 (ConvertReferenceExplicit): Ditto.
24391 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24392 various methods, with correct names etc.
24394 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24395 Operator.UnaryNegation.
24397 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24398 we have a unary plus or minus operator.
24400 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24403 * everywhere : update accordingly.
24405 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24408 * class.cs (Method::Define): For the case where we are implementing a method
24409 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24410 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24412 2001-10-21 Ravi Pratap <ravi@ximian.com>
24414 * interface.cs (FindMembers): Implement to work around S.R.E
24417 * typemanager.cs (IsInterfaceType): Implement.
24419 (FindMembers): Update to handle interface types too.
24421 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24422 use IsAssignableFrom as that is not correct - it doesn't work.
24424 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24425 and accordingly override EmitStatement.
24427 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24428 using the correct logic :-)
24430 2001-10-19 Ravi Pratap <ravi@ximian.com>
24432 * ../errors/cs-11.cs : Add to demonstrate error -11
24434 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24436 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24437 then pass this as a hint to ResolveLValue.
24439 * expression.cs (FieldExpr): Add Location information
24441 (FieldExpr::LValueResolve): Report assignment to readonly
24444 (Expression::ExprClassFromMemberInfo): Pass location information.
24446 (Expression::ResolveLValue): Add new method that resolves an
24449 (Expression::DoResolveLValue): Default invocation calls
24452 (Indexers): New class used to keep track of indexers in a given
24455 (IStackStore): Renamed from LValue, as it did not really describe
24456 what this did. Also ResolveLValue is gone from this interface and
24457 now is part of Expression.
24459 (ElementAccess): Depending on the element access type
24461 * typemanager.cs: Add `indexer_name_type' as a Core type
24462 (System.Runtime.CompilerServices.IndexerNameAttribute)
24464 * statement.cs (Goto): Take a location.
24466 2001-10-18 Ravi Pratap <ravi@ximian.com>
24468 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24469 if two delegates are compatible.
24471 (NewDelegate::DoResolve): Update to take care of the case when
24472 we instantiate a delegate from another delegate.
24474 * typemanager.cs (FindMembers): Don't even try to look up members
24475 of Delegate types for now.
24477 2001-10-18 Ravi Pratap <ravi@ximian.com>
24479 * delegate.cs (NewDelegate): New class to take care of delegate
24482 * expression.cs (New): Split the delegate related code out into
24483 the NewDelegate class.
24485 * delegate.cs (DelegateInvocation): New class to handle delegate
24488 * expression.cs (Invocation): Split out delegate related code into
24489 the DelegateInvocation class.
24491 2001-10-17 Ravi Pratap <ravi@ximian.com>
24493 * expression.cs (New::DoResolve): Implement delegate creation fully
24494 and according to the spec.
24496 (New::DoEmit): Update to handle delegates differently.
24498 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24499 because of which we were printing out arguments in reverse order !
24501 * delegate.cs (VerifyMethod): Implement to check if the given method
24502 matches the delegate.
24504 (FullDelegateDesc): Implement.
24506 (VerifyApplicability): Implement.
24508 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24509 delegate invocations too.
24511 (Invocation::Emit): Ditto.
24513 * ../errors/cs1593.cs : Added.
24515 * ../errors/cs1594.cs : Added.
24517 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24519 2001-10-16 Ravi Pratap <ravi@ximian.com>
24521 * typemanager.cs (intptr_type): Core type for System.IntPtr
24523 (InitCoreTypes): Update for the same.
24525 (iasyncresult_type, asynccallback_type): Ditto.
24527 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24530 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24533 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24534 the builders for the 4 members of a delegate type :-)
24536 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24539 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24541 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24543 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24545 * statement.cs (Break::Emit): Implement.
24546 (Continue::Emit): Implement.
24548 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24549 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24550 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24551 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24554 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24555 properties that track the label for the current loop (begin of the
24556 loop and end of the loop).
24558 2001-10-15 Ravi Pratap <ravi@ximian.com>
24560 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24561 use of emitting anything at all.
24563 * class.cs, rootcontext.cs : Get rid of calls to the same.
24565 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24567 (Populate): Define the constructor correctly and set the implementation
24570 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24573 (AddDelegateType): Implement.
24575 (IsDelegateType): Implement helper method.
24577 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24579 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24580 and accordingly handle it.
24582 * delegate.cs (Populate): Take TypeContainer argument.
24583 Implement bits to define the Invoke method. However, I still haven't figured out
24584 how to take care of the native int bit :-(
24586 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24587 Qualify the name of the delegate, not its return type !
24589 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24592 (StandardConversionExists): Checking for array types turns out to be recursive.
24594 (ConvertReferenceExplicit): Implement array conversion.
24596 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24598 2001-10-12 Ravi Pratap <ravi@ximian.com>
24600 * cs-parser.jay (delegate_declaration): Store the fully qualified
24601 name as it is a type declaration.
24603 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24606 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24607 as TypeContainer::DefineType.
24609 (Populate): Method in which all the definition of the various methods (Invoke)
24612 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24615 (CloseDelegate): Finally creates the delegate.
24617 * class.cs (TypeContainer::DefineType): Update to define delegates.
24618 (Populate, Emit and CloseType): Do the same thing here too.
24620 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24621 delegates in all these operations.
24623 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24625 * expression.cs: LocalTemporary: a new expression used to
24626 reference a temporary that has been created.
24628 * assign.cs: Handle PropertyAccess back here, so that we can
24629 provide the proper semantic access to properties.
24631 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24632 a few more explicit conversions.
24634 * modifiers.cs: `NEW' modifier maps to HideBySig.
24636 * expression.cs (PropertyExpr): Make this into an
24637 ExpressionStatement, and support the EmitStatement code path.
24639 Perform get/set error checking, clean up the interface.
24641 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24642 them into toplevel access objects.
24644 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24646 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24649 * typemanager.cs: Keep track here of our PropertyBuilders again to
24650 work around lameness in SRE.
24652 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24654 * expression.cs (LValue::LValueResolve): New method in the
24655 interface, used to perform a second resolution pass for LValues.
24657 (This::DoResolve): Catch the use of this in static methods.
24659 (This::LValueResolve): Implement.
24661 (This::Store): Remove warning, assigning to `this' in structures
24664 (Invocation::Emit): Deal with invocation of
24665 methods on value types. We need to pass the address to structure
24666 methods rather than the object itself. (The equivalent code to
24667 emit "this" for structures leaves the entire structure on the
24668 stack instead of a pointer to it).
24670 (ParameterReference::DoResolve): Compute the real index for the
24671 argument based on whether the method takes or not a `this' pointer
24672 (ie, the method is static).
24674 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24675 value types returned from functions when we need to invoke a
24676 method on the sturcture.
24679 2001-10-11 Ravi Pratap <ravi@ximian.com>
24681 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24682 defining the type in the Modulebuilder or Typebuilder. This is to take
24683 care of nested types which need to be defined on the TypeBuilder using
24684 DefineNestedMethod.
24686 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24687 methods in RootContext, only ported to be part of TypeContainer.
24689 (TypeContainer::GetInterfaceOrClass): Ditto.
24691 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24693 * interface.cs (Interface::DefineInterface): New method. Does exactly
24694 what RootContext.CreateInterface did earlier, only it takes care of nested types
24697 (Interface::GetInterfaces): Move from RootContext here and port.
24699 (Interface::GetInterfaceByName): Same here.
24701 * rootcontext.cs (ResolveTree): Re-write.
24703 (PopulateTypes): Re-write.
24705 * class.cs (TypeContainer::Populate): Populate nested types too.
24706 (TypeContainer::Emit): Emit nested members too.
24708 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24709 instead just use the name argument passed in as it is already fully
24712 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24713 to TypeContainer mapping to see if a type is user-defined.
24715 * class.cs (TypeContainer::CloseType): Implement.
24717 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24718 the default constructor.
24720 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24723 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24725 * interface.cs (CloseType): Create the type here.
24727 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24730 Remove all the methods which are now in TypeContainer.
24732 2001-10-10 Ravi Pratap <ravi@ximian.com>
24734 * delegate.cs (Define): Re-write bits to define the delegate
24737 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24739 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24741 * expression.cs (ImplicitReferenceConversion): handle null as well
24742 as a source to convert to any reference type.
24744 * statement.cs (Return): Perform any implicit conversions to
24745 expected return type.
24747 Validate use of return statement.
24749 * codegen.cs (EmitContext): Pass the expected return type here.
24751 * class.cs (Method, Constructor, Property): Pass expected return
24752 type to EmitContext.
24754 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24756 * expression.cs: Make DoResolve take an EmitContext instead of a
24759 Replaced `l' and `location' for `loc', for consistency.
24761 (Error, Warning): Remove unneeded Tc argument.
24763 * assign.cs, literal.cs, constant.cs: Update to new calling
24766 * codegen.cs: EmitContext now contains a flag indicating whether
24767 code is being generated in a static method or not.
24769 * cs-parser.jay: DecomposeQI, new function that replaces the old
24770 QualifiedIdentifier. Now we always decompose the assembled
24771 strings from qualified_identifier productions into a group of
24774 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24776 * rootcontext.cs: Deal with field-less struct types correctly now
24777 by passing the size option to Define Type.
24779 * class.cs: Removed hack that created one static field.
24781 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24783 * statement.cs: Moved most of the code generation here.
24785 2001-10-09 Ravi Pratap <ravi@ximian.com>
24787 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24790 (ElementAccess): Remove useless bits for now - keep checks as the spec
24793 2001-10-08 Ravi Pratap <ravi@ximian.com>
24795 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24796 and start performing checks according to the spec.
24798 2001-10-07 Ravi Pratap <ravi@ximian.com>
24800 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24801 rank_specifiers instead.
24803 (rank_specifiers): Change the order in which the rank specifiers are stored
24805 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24807 * expression.cs (ElementAccess): Implement the LValue interface too.
24809 2001-10-06 Ravi Pratap <ravi@ximian.com>
24811 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24812 except that user defined conversions are not included.
24814 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24815 perform the conversion of the return type, if necessary.
24817 (New::DoResolve): Check whether we are creating an array or an object
24818 and accordingly do the needful.
24820 (New::Emit): Same here.
24822 (New::DoResolve): Implement guts of array creation.
24824 (New::FormLookupType): Helper function.
24826 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24828 * codegen.cs: Removed most of the code generation here, and move the
24829 corresponding code generation bits to the statement classes.
24831 Added support for try/catch/finalize and throw.
24833 * cs-parser.jay: Added support for try/catch/finalize.
24835 * class.cs: Catch static methods having the flags override,
24836 virtual or abstract.
24838 * expression.cs (UserCast): This user cast was not really doing
24839 what it was supposed to do. Which is to be born in fully resolved
24840 state. Parts of the resolution were being performed at Emit time!
24844 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24846 * expression.cs: Implicity convert the result from UserCast.
24848 2001-10-05 Ravi Pratap <ravi@ximian.com>
24850 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24851 prevented it from working correctly.
24853 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24854 merely ConvertImplicit.
24856 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24858 * typemanager.cs: Make the LookupTypeContainer function static,
24859 and not per-instance.
24861 * class.cs: Make static FindMembers (the one that takes a Type
24864 * codegen.cs: Add EmitForeach here.
24866 * cs-parser.jay: Make foreach a toplevel object instead of the
24867 inline expansion, as we need to perform semantic analysis on it.
24869 2001-10-05 Ravi Pratap <ravi@ximian.com>
24871 * expression.cs (Expression::ImplicitUserConversion): Rename to
24872 UserDefinedConversion.
24874 (Expression::UserDefinedConversion): Take an extra argument specifying
24875 whether we look for explicit user conversions too.
24877 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24879 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24881 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24882 with the appropriate arguments.
24884 * cs-parser.jay (cast_expression): Record location too.
24886 * expression.cs (Cast): Record location info.
24888 (Expression::ConvertExplicit): Take location argument.
24890 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24891 to determine if we are doing explicit conversions.
24893 (UserCast::Emit): Update accordingly.
24895 (Expression::ConvertExplicit): Report an error if everything fails.
24897 * ../errors/cs0030.cs : Add.
24899 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24901 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24902 virtual and newslot bits.
24904 * class.cs (TypeContainer::RegisterRequiredImplementations):
24905 Record methods we need.
24907 (TypeContainer::MakeKey): Helper function to make keys for
24908 MethodBases, since the Methodbase key is useless.
24910 (TypeContainer::Populate): Call RegisterRequiredImplementations
24911 before defining the methods.
24913 Create a mapping for method_builders_to_methods ahead of time
24914 instead of inside a tight loop.
24916 (::RequireMethods): Accept an object as the data to set into the
24917 hashtable so we can report interface vs abstract method mismatch.
24919 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24921 * report.cs: Make all of it static.
24923 * rootcontext.cs: Drop object_type and value_type computations, as
24924 we have those in the TypeManager anyways.
24926 Drop report instance variable too, now it is a global.
24928 * driver.cs: Use try/catch on command line handling.
24930 Add --probe option to debug the error reporting system with a test
24933 * report.cs: Add support for exiting program when a probe
24934 condition is reached.
24936 2001-10-03 Ravi Pratap <ravi@ximian.com>
24938 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24939 we do a forcible conversion regardless of type, to check if
24940 ForceConversion returns a null.
24942 (Binary::error19): Use location to report error.
24944 (Unary::error23): Use location here too.
24946 * ../errors/cs0019.cs : Check in.
24948 * ../errors/cs0023.cs : Check in.
24950 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24951 case of a non-null MethodInfo object with a length of 0 !
24953 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24954 an applicable member - according to the spec :-)
24955 Also fix logic to find members in base types.
24957 (Unary::ResolveOperator): Same here.
24959 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24960 as I was getting thoroughly confused between this and error19 :-)
24962 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24963 (::FindMostEncompassedType): Implement.
24964 (::FindMostEncompassingType): Implement.
24965 (::StandardConversionExists): Implement.
24967 (UserImplicitCast): Re-vamp. We now need info about most specific
24968 source and target types so that we can do the necessary conversions.
24970 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24971 mathematical union with no duplicates.
24973 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24975 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24976 in order from base classes to child classes, so that we can in
24977 child classes look up in our parent for method names and
24978 attributes (required for handling abstract, virtual, new, override
24979 constructs: we need to instrospect our base class, and if we dont
24980 populate the classes in order, the introspection might be
24981 incorrect. For example, a method could query its parent before
24982 the parent has any methods and would determine that the parent has
24983 no abstract methods (while it could have had them)).
24985 (RootContext::CreateType): Record the order in which we define the
24988 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24990 * class.cs (TypeContainer::Populate): Also method definitions can
24991 fail now, keep track of this.
24993 (TypeContainer::FindMembers): Implement support for
24994 DeclaredOnly/noDeclaredOnly flag.
24996 (Constructor::Emit) Return the ConstructorBuilder.
24998 (Method::Emit) Return the MethodBuilder.
24999 Check for abstract or virtual methods to be public.
25001 * rootcontext.cs (RootContext::CreateType): Register all the
25002 abstract methods required for the class to be complete and the
25003 interface methods that must be implemented.
25005 * cs-parser.jay: Report error 501 (method requires body if it is
25006 not marked abstract or extern).
25008 * expression.cs (TypeOf::Emit): Implement.
25010 * typemanager.cs: runtime_handle_type, new global type.
25012 * class.cs (Property::Emit): Generate code for properties.
25014 2001-10-02 Ravi Pratap <ravi@ximian.com>
25016 * expression.cs (Unary::ResolveOperator): Find operators on base type
25017 too - we now conform exactly to the spec.
25019 (Binary::ResolveOperator): Same here.
25021 * class.cs (Operator::Define): Fix minor quirk in the tests.
25023 * ../errors/cs0215.cs : Added.
25025 * ../errors/cs0556.cs : Added.
25027 * ../errors/cs0555.cs : Added.
25029 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25031 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25032 single integer which is really efficient
25034 2001-10-01 Ravi Pratap <ravi@ximian.com>
25036 * expression.cs (Expression::ImplicitUserConversion): Use location
25037 even in the case when we are examining True operators.
25039 * class.cs (Operator::Define): Perform extensive checks to conform
25040 with the rules for operator overloading in the spec.
25042 * expression.cs (Expression::ImplicitReferenceConversion): Implement
25043 some of the other conversions mentioned in the spec.
25045 * typemanager.cs (array_type): New static member for the System.Array built-in
25048 (cloneable_interface): For System.ICloneable interface.
25050 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25051 we start resolving the tree and populating types.
25053 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25055 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25057 * expression.cs (Expression::ExprClassFromMemberInfo,
25058 Expression::Literalize): Create literal expressions from
25059 FieldInfos which are literals.
25061 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25062 type casts, because they were wrong. The test suite in tests
25065 (ImplicitNumericConversion): ushort to ulong requires a widening
25068 Int32 constant to long requires widening cast as well.
25070 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25071 for integers because the type on the stack is not i4.
25073 2001-09-30 Miguel de Icaza <miguel@ximian.com>
25075 * expression.cs (report118): require location argument.
25077 * parameter.cs: Do not dereference potential null value.
25079 * class.cs: Catch methods that lack the `new' keyword when
25080 overriding a name. Report warnings when `new' is used without
25081 anything being there to override.
25083 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25085 * class.cs: Only add constructor to hashtable if it is non-null
25086 (as now constructors can fail on define).
25088 (TypeManager, Class, Struct): Take location arguments.
25090 Catch field instance initialization in structs as errors.
25092 accepting_filter: a new filter for FindMembers that is static so
25093 that we dont create an instance per invocation.
25095 (Constructor::Define): Catch errors where a struct constructor is
25098 * cs-parser.jay: Pass location information for various new
25101 * delegate.cs (Delegate): take a location argument.
25103 * driver.cs: Do not call EmitCode if there were problesm in the
25104 Definition of the types, as many Builders wont be there.
25106 * decl.cs (Decl::Decl): Require a location argument.
25108 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25109 into integers, and find the most appropiate integer for it.
25111 * literal.cs: Implement ULongLiteral.
25113 * rootcontext.cs: Provide better information about the location of
25114 failure when CreateType fails.
25116 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25118 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25121 * expression.cs (Binary::CheckShiftArguments): Add missing type
25123 (Binary::ResolveOperator): Add type to the logical and and logical
25124 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25127 (Binary::DoNumericPromotions): In the case where either argument
25128 is ulong (and most signed types combined with ulong cause an
25129 error) perform implicit integer constant conversions as well.
25131 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25133 * expression.cs (UserImplicitCast): Method should always be
25135 (Invocation::BetterConversion): Simplified test for IntLiteral.
25137 (Expression::ImplicitNumericConversion): Split this routine out.
25138 Put the code that performs implicit constant integer conversions
25141 (Expression::Resolve): Become a wrapper around DoResolve so we can
25142 check eclass and type being set after resolve.
25144 (Invocation::Badness): Remove this dead function
25146 (Binary::ResolveOperator): Do not compute the expensive argumnets
25147 unless we have a union for it.
25149 (Probe::Emit): Is needs to do an isinst and then
25150 compare against null.
25152 (::CanConvert): Added Location argument. If the Location argument
25153 is null (Location.Null), then we do not report errors. This is
25154 used by the `probe' mechanism of the Explicit conversion. We do
25155 not want to generate an error for something that the user
25156 explicitly requested to be casted. But the pipeline for an
25157 explicit cast first tests for potential implicit casts.
25159 So for now, if the Location is null, it means `Probe only' to
25160 avoid adding another argument. Might have to revise this
25163 (ClassCast): New class used to type cast objects into arbitrary
25164 classes (used in Explicit Reference Conversions).
25166 Implement `as' as well.
25168 Reverted all the patches from Ravi below: they were broken:
25170 * The use of `level' as a mechanism to stop recursive
25171 invocations is wrong. That was there just to catch the
25172 bug with a strack trace but not as a way of addressing
25175 To fix the problem we have to *understand* what is going
25176 on and the interactions and come up with a plan, not
25177 just get things going.
25179 * The use of the type conversion cache that I proposed
25180 last night had an open topic: How does this work across
25181 protection domains. A user defined conversion might not
25182 be public in the location where we are applying the
25183 conversion, a different conversion might be selected
25184 (ie, private A->B (better) but public B->A (worse),
25185 inside A, A->B applies, but outside it, B->A will
25188 * On top of that (ie, even if the above is solved),
25189 conversions in a cache need to be abstract. Ie, `To
25190 convert from an Int to a Short use an OpcodeCast', not
25191 `To convert from an Int to a Short use the OpcodeCast on
25192 the variable 5' (which is what this patch was doing).
25194 2001-09-28 Ravi Pratap <ravi@ximian.com>
25196 * expression.cs (Invocation::ConversionExists): Re-write to use
25197 the conversion cache
25199 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25200 cache all conversions done, not just user-defined ones.
25202 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25203 to determine if a conversion exists instead of acutually trying to
25204 perform the conversion. It's faster too.
25206 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25207 and only then attempt the implicit conversion.
25209 2001-09-28 Ravi Pratap <ravi@ximian.com>
25211 * expression.cs (ConvertImplicit): Use a cache for conversions
25212 already found. Check level of recursion and bail out if necessary.
25214 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25216 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25217 Export standard methods that we expect for string operations.
25219 * statement.cs (Block::UsageWarning): Track usage of variables and
25220 report the errors for not used variables.
25222 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25225 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25227 * codegen.cs: remove unnneded code
25229 * expression.cs: Removed BuiltinTypeAccess class
25231 Fix the order in which implicit conversions are
25234 The previous fixed dropped support for boxed conversions (adding a
25235 test to the test suite now)
25237 (UserImplicitCast::CanConvert): Remove test for source being null,
25238 that code is broken. We should not feed a null to begin with, if
25239 we do, then we should track the bug where the problem originates
25240 and not try to cover it up here.
25242 Return a resolved expression of type UserImplicitCast on success
25243 rather than true/false. Ravi: this is what I was talking about,
25244 the pattern is to use a static method as a "constructor" for
25247 Also, do not create arguments until the very last minute,
25248 otherwise we always create the arguments even for lookups that
25249 will never be performed.
25251 (UserImplicitCast::Resolve): Eliminate, objects of type
25252 UserImplicitCast are born in a fully resolved state.
25254 * typemanager.cs (InitCoreTypes): Init also value_type
25255 (System.ValueType).
25257 * expression.cs (Cast::Resolve): First resolve the child expression.
25259 (LValue): Add new method AddressOf to be used by
25262 Change the argument of Store to take an EmitContext instead of an
25263 ILGenerator, because things like FieldExpr need to be able to call
25264 their children expression to generate the instance code.
25266 (Expression::Error, Expression::Warning): Sugar functions for
25269 (Expression::MemberLookup): Accept a TypeContainer instead of a
25270 Report as the first argument.
25272 (Expression::ResolvePrimary): Killed. I still want to improve
25273 this as currently the code is just not right.
25275 (Expression::ResolveMemberAccess): Simplify, but it is still
25278 (Unary::Resolve): Catch errors in AddressOf operators.
25280 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25281 index to a byte for the short-version, or the compiler will choose
25282 the wrong Emit call, which generates the wrong data.
25284 (ParameterReference::Emit, ::Store): same.
25286 (FieldExpr::AddressOf): Implement.
25288 * typemanager.cs: TypeManager: made public variable instead of
25291 * driver.cs: document --fatal.
25293 * report.cs (ErrorMessage, WarningMessage): new names for the old
25294 Error and Warning classes.
25296 * cs-parser.jay (member_access): Turn built-in access to types
25297 into a normal simplename
25299 2001-09-27 Ravi Pratap <ravi@ximian.com>
25301 * expression.cs (Invocation::BetterConversion): Fix to cope
25302 with q being null, since this was introducing a bug.
25304 * expression.cs (ConvertImplicit): Do built-in conversions first.
25306 2001-09-27 Ravi Pratap <ravi@ximian.com>
25308 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25310 2001-09-27 Ravi Pratap <ravi@ximian.com>
25312 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25313 I had introduced long ago (what's new ?).
25315 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25316 the work of all the checking.
25317 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25318 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25320 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25321 that is the right way.
25323 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25324 overloading resolution. Use everywhere instead of cutting and pasting code.
25326 (Binary::ResolveOperator): Use MakeUnionSet.
25328 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25329 we have to convert to bool types. Not complete yet.
25331 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25333 * typemanager.cs (TypeManager::CSharpName): support ushort.
25335 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25336 to provide an expression that performsn an implicit constant int
25337 conversion (section 6.1.6).
25338 (Expression::ConvertImplicitRequired): Reworked to include
25339 implicit constant expression conversions.
25341 (Expression::ConvertNumericExplicit): Finished.
25343 (Invocation::Emit): If InstanceExpression is null, then it means
25344 that we perform a call on this.
25346 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25348 * expression.cs (Unary::Emit): Remove some dead code.
25349 (Probe): Implement Resolve and Emit for `is'.
25350 (Expression::ConvertImplicitRequired): Attempt to do constant
25351 expression conversions here. Maybe should be moved to
25352 ConvertImplicit, but I am not sure.
25353 (Expression::ImplicitLongConstantConversionPossible,
25354 Expression::ImplicitIntConstantConversionPossible): New functions
25355 that tell whether is it possible to apply an implicit constant
25356 expression conversion.
25358 (ConvertNumericExplicit): Started work on explicit numeric
25361 * cs-parser.jay: Update operator constants.
25363 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25364 (Parameters::GetSignature): Hook up VerifyArgs here.
25365 (Parameters::VerifyArgs): Verifies that no two arguments have the
25368 * class.cs (Operator): Update the operator names to reflect the
25369 ones that the spec expects (as we are just stringizing the
25372 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25373 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25374 previous usage did only work for our methods.
25375 (Expression::ConvertImplicit): Handle decimal implicit numeric
25376 conversions as well.
25377 (Expression::InternalTypeConstructor): Used to invoke constructors
25378 on internal types for default promotions.
25380 (Unary::Emit): Implement special handling for the pre/post
25381 increment/decrement for overloaded operators, as they need to have
25382 the same semantics as the other operators.
25384 (Binary::ResolveOperator): ditto.
25385 (Invocation::ConversionExists): ditto.
25386 (UserImplicitCast::Resolve): ditto.
25388 2001-09-26 Ravi Pratap <ravi@ximian.com>
25390 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25391 operator, return after emitting body. Regression tests pass again !
25393 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25394 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25395 (Invocation::OverloadResolve): Ditto.
25396 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25398 * everywhere : update calls to the above methods accordingly.
25400 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25402 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25404 * expression.cs (ExpressionStatement): New base class used for
25405 expressions that can appear in statements, so that we can provide
25406 an alternate path to generate expression that do not leave a value
25409 (Expression::Emit, and all the derivatives): We no longer return
25410 whether a value is left on the stack or not. Every expression
25411 after being emitted leaves a single value on the stack.
25413 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25414 facilties of ExpressionStatement if possible.
25416 * cs-parser.jay: Update statement_expression.
25418 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25420 * driver.cs: Change the wording of message
25422 2001-09-25 Ravi Pratap <ravi@ximian.com>
25424 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25425 the type of the expression to the return type of the method if
25426 we have an overloaded operator match ! The regression tests pass again !
25427 (Unary::ResolveOperator): Ditto.
25429 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25430 to find "op_Implicit", not "implicit" ;-)
25431 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25432 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25434 * everywhere : Correct calls to the above accordingly.
25436 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25437 (ConvertImplicit): Do user-defined conversion if it exists.
25439 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25441 * assign.cs: track location.
25442 (Resolve): Use implicit conversions on assignment.
25444 * literal.cs: Oops. Not good, Emit of short access values should
25445 pass (Bytes) or the wrong argument will be selected.
25447 * expression.cs (Unary::Emit): Emit code for -expr.
25449 (Unary::ResolveOperator): Handle `Substract' for non-constants
25450 (substract from zero from the non-constants).
25451 Deal with Doubles as well.
25453 (Expression::ConvertImplicitRequired): New routine that reports an
25454 error if no implicit conversion exists.
25456 (Invocation::OverloadResolve): Store the converted implicit
25457 expressions if we make them
25459 2001-09-24 Ravi Pratap <ravi@ximian.com>
25461 * class.cs (ConstructorInitializer): Take a Location argument.
25462 (ConstructorBaseInitializer): Same here.
25463 (ConstructorThisInitializer): Same here.
25465 * cs-parser.jay : Update all calls accordingly.
25467 * expression.cs (Unary, Binary, New): Take location argument.
25468 Update accordingly everywhere.
25470 * cs-parser.jay : Update all calls to the above to take a location
25473 * class.cs : Ditto.
25475 2001-09-24 Ravi Pratap <ravi@ximian.com>
25477 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25478 (Invocation::BetterConversion): Same here
25479 (Invocation::ConversionExists): Ditto.
25481 (Invocation::ConversionExists): Implement.
25483 2001-09-22 Ravi Pratap <ravi@ximian.com>
25485 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25486 Also take an additional TypeContainer argument.
25488 * All over : Pass in TypeContainer as argument to OverloadResolve.
25490 * typemanager.cs (CSharpName): Update to check for the string type and return
25493 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25496 2001-09-21 Ravi Pratap <ravi@ximian.com>
25498 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25499 (Invocation::BetterFunction): Implement.
25500 (Invocation::BetterConversion): Implement.
25501 (Invocation::ConversionExists): Skeleton, no implementation yet.
25503 Okay, things work fine !
25505 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25507 * typemanager.cs: declare and load enum_type, delegate_type and
25510 * expression.cs (Expression::Emit): Now emit returns a value that
25511 tells whether a value is left on the stack or not. This strategy
25512 might be reveted tomorrow with a mechanism that would address
25513 multiple assignments.
25514 (Expression::report118): Utility routine to report mismatches on
25517 (Unary::Report23): Report impossible type/operator combination
25520 (Unary::IsIncrementableNumber): Whether the type can be
25521 incremented or decremented with add.
25522 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25524 (Unary::ResolveOperator): Implement ++, !, ~,
25526 (Invocation::Emit): Deal with new Emit convetion.
25528 * All Expression derivatives: Updated their Emit method to return
25529 whether they leave values on the stack or not.
25531 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25532 stack for expressions that are statements.
25534 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25536 * expression.cs (LValue): New interface. Must be implemented by
25538 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25541 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25542 interface for generating code, simplifies the code.
25544 2001-09-20 Ravi Pratap <ravi@ximian.com>
25546 * expression.cs (everywhere): Comment out return statements in ::Resolve
25547 methods to avoid the warnings.
25549 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25551 * driver.cs (parse): Report error 2001 if we can not open the
25554 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25557 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25560 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25561 otherwise nested blocks end up with the same index.
25563 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25565 * expression.cs: Instead of having FIXMEs in the Resolve
25566 functions, throw exceptions so it is obvious that we are facing a
25569 * cs-parser.jay (invocation_expression): Pass Location information.
25571 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25572 Use a basename for those routines because .NET does not like paths
25575 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25578 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25580 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25581 are loading the correct data types (throws an exception if not).
25582 (TypeManager::InitCoreTypes): Use CoreLookupType
25584 * expression.cs (Unary::ResolveOperator): return the child
25585 expression for expressions which are just +expr.
25586 (Unary::ResolveOperator): Return negative literals for -LITERAL
25587 expressions (otherwise they are Unary {Literal}).
25588 (Invocation::Badness): Take into account `Implicit constant
25589 expression conversions'.
25591 * literal.cs (LongLiteral): Implement long literal class.
25592 (IntLiteral): export the `Value' of the intliteral.
25594 2001-09-19 Ravi Pratap <ravi@ximian.com>
25596 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25598 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25599 instead of 'Operator'
25601 * expression.cs (Binary::ResolveOperator): Update accordingly.
25602 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25605 * cs-parser.jay (unary_expression): Update to use the new names.
25607 * gen-treedump.cs (GetUnary): Same here.
25609 * expression.cs (Unary::Resolve): Implement.
25610 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25611 operators are found instead of making noise ;-)
25612 (Unary::ResolveOperator): New method to do precisely the same thing which
25613 Binary::ResolveOperator does for Binary expressions.
25614 (Unary.method, .Arguments): Add.
25615 (Unary::OperName): Implement.
25616 (Unary::ForceConversion): Copy and Paste !
25618 * class.cs (Operator::Define): Fix a small bug for the case when we have
25621 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25622 for the inbuilt operators. Only overloading works for now ;-)
25624 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25626 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25627 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25629 * expression.cs (This::Emit): Implement.
25630 (This::Resolve): Implement.
25631 (TypeOf:Resolve): Implement.
25632 (Expression::ResolveSimpleName): Add an implicit this to instance
25634 (MemberAccess::Resolve): Deal with Parameters and Fields.
25635 Bind instance variable to Field expressions.
25636 (FieldExpr::Instance): New field used to track the expression that
25637 represents the object instance.
25638 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25640 (FieldExpr::Emit): Implement.
25642 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25643 the last instruction contains a return opcode to avoid generating
25644 the last `ret' instruction (this generates correct code, and it is
25645 nice to pass the peverify output).
25647 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25648 initializer for static and instance variables.
25649 (Constructor::Emit): Allow initializer to be null in the case of
25650 static constructors. Only emit initializer for instance
25653 (TypeContainer::FindMembers): Return a null array if there are no
25656 Also fix the code for the MemberTypes.Method branch, as it was not
25657 scanning that for operators (or tried to access null variables before).
25659 * assign.cs (Assign::Emit): Handle instance and static fields.
25663 * driver.cs: Stop compilation if there are parse errors.
25665 * cs-parser.jay (constructor_declaration): Provide default base
25666 initializer for non-static constructors.
25667 (constructor_declarator): Do not provide a default base
25668 initializers if none was specified.
25669 Catch the fact that constructors should not have parameters.
25671 * class.cs: Do not emit parent class initializers for static
25672 constructors, that should be flagged as an error.
25674 2001-09-18 Ravi Pratap <ravi@ximian.com>
25676 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25677 Move back code into TypeContainer::Populate.
25679 2001-09-18 Ravi Pratap <ravi@ximian.com>
25681 * class.cs (TypeContainer::AddConstructor): Fix the check to
25682 compare against Name, not Basename.
25683 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25685 * cs-parser.jay : Update accordingly.
25687 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25688 for methods, don't forget to look into the operators too.
25689 (RegisterMethodBuilder): Helper method to take care of this for
25690 methods, constructors and operators.
25691 (Operator::Define): Completely revamp.
25692 (Operator.OperatorMethod, MethodName): New fields.
25693 (TypeContainer::Populate): Move the registering of builders into
25694 RegisterMethodBuilder.
25695 (Operator::Emit): Re-write.
25697 * expression.cs (Binary::Emit): Comment out code path to emit method
25698 invocation stuff for the case when we have a user defined operator. I am
25699 just not able to get it right !
25701 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25703 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25706 (Expression::MemberLookup): Provide a version that allows to
25707 specify the MemberTypes and BindingFlags.
25709 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25710 so it was not fetching variable information from outer blocks.
25712 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25713 Beforefieldinit as it was buggy.
25715 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25716 that Ravi put here.
25718 * class.cs (Constructor::Emit): Only emit if block is not null.
25719 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25720 deal with this by semantically definining it as if the user had
25723 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25724 constructors as we now "emit" them at a higher level.
25726 (TypeContainer::DefineDefaultConstructor): Used to define the
25727 default constructors if none was provided.
25729 (ConstructorInitializer): Add methods Resolve and Emit.
25731 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25733 2001-09-17 Ravi Pratap <ravi@ximian.com>
25735 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25736 the default constructor builder with our hashtable for methodbuilders
25739 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25740 and argument_count is 0 in which case we have a match.
25741 (Binary::ResolveOperator): More null checking and miscellaneous coding
25744 2001-09-17 Ravi Pratap <ravi@ximian.com>
25746 * rootcontext.cs (IsNameSpace): Compare against null.
25748 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25750 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25751 and Unary::Operator.
25753 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25756 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25757 we have overloaded operators.
25758 (Binary::ResolveOperator): Implement the part which does the operator overload
25761 * class.cs (Operator::Emit): Implement.
25762 (TypeContainer::Emit): Emit the operators we have too.
25764 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25765 the case when we have a user-defined operator.
25767 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25769 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25771 2001-09-16 Ravi Pratap <ravi@ximian.com>
25773 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25774 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25775 (Constructor::Emit): Implement.
25776 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25777 if we have no work to do.
25778 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25781 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25782 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25784 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25787 2001-09-15 Ravi Pratap <ravi@ximian.com>
25789 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25791 (Tree::RecordNamespace): Method to do what the name says ;-)
25792 (Tree::Namespaces): Property to get at the namespaces hashtable.
25794 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25797 * rootcontext.cs (IsNamespace): Fixed it :-)
25799 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25801 * class.cs (TypeContainer::FindMembers): Add support for
25803 (MethodCore): New class that encapsulates both the shared aspects
25804 of a Constructor and a Method.
25805 (Method, Constructor): Factored pieces into MethodCore.
25807 * driver.cs: Added --fatal which makes errors throw exceptions.
25808 Load System assembly as well as part of the standard library.
25810 * report.cs: Allow throwing exceptions on errors for debugging.
25812 * modifiers.cs: Do not use `parent', instead use the real type
25813 container to evaluate permission settings.
25815 * class.cs: Put Ravi's patch back in. He is right, and we will
25816 have to cope with the
25818 2001-09-14 Ravi Pratap <ravi@ximian.com>
25820 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25821 FamORAssem, not FamANDAssem.
25823 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25825 * driver.cs: Added --parse option that only parses its input files
25828 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25829 incorrect. IsTopLevel is not used to tell whether an object is
25830 root_types or not (that can be achieved by testing this ==
25831 root_types). But to see if this is a top-level *class* (not
25832 necessarly our "toplevel" container).
25834 2001-09-14 Ravi Pratap <ravi@ximian.com>
25836 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25837 parent instead of a direct call to GetType.
25839 2001-09-14 Ravi Pratap <ravi@ximian.com>
25841 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25842 Modifiers.TypeAttr. This should just be a call to that method.
25844 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25845 object so that we can determine if we are top-level or not.
25847 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25850 * enum.cs (Enum::Define): Ditto.
25852 * modifiers.cs (FieldAttr): Re-write.
25854 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25855 (TypeContainer::HaveStaticConstructor): New property to provide access
25856 to precisely that info.
25858 * modifiers.cs (MethodAttr): Re-write.
25859 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25861 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25862 of top-level types as claimed.
25864 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25866 * expression.cs (MemberLookup): Fruitless attempt to lookup
25867 constructors. Maybe I need to emit default constructors? That
25868 might be it (currently .NET emits this for me automatically).
25869 (Invocation::OverloadResolve): Cope with Arguments == null.
25870 (Invocation::EmitArguments): new function, shared by the new
25871 constructor and us.
25872 (Invocation::Emit): Handle static and instance methods. Emit
25873 proper call instruction for virtual or non-virtual invocations.
25874 (New::Emit): Implement.
25875 (New::Resolve): Implement.
25876 (MemberAccess:Resolve): Implement.
25877 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25878 to track instances.
25879 (FieldExpr::Resolve): Set type.
25881 * support.cs: Handle empty arguments.
25883 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25884 SimpleLookup): Auxiliary routines to help parse a qualifier
25887 Update qualifier_identifier rule.
25889 * codegen.cs: Removed debugging messages.
25891 * class.cs: Make this a global thing, this acts just as a "key" to
25892 objects that we might have around.
25894 (Populate): Only initialize method_builders_to_methods once.
25896 * expression.cs (PropertyExpr): Initialize type from the
25899 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25900 Resolve pattern. Attempt to implicitly convert value to boolean.
25903 * expression.cs: Set the type for the int32/int32 argument case.
25904 (Binary::ResolveOperator): Set the return type to boolean for
25905 comparission operators
25907 * typemanager.cs: Remove debugging print code.
25909 (Invocation::Resolve): resolve type.
25911 * class.cs: Allocate a MemberInfo of the correct size, as the code
25912 elsewhere depends on the test to reflect the correct contents.
25914 (Method::) Keep track of parameters, due to System.Reflection holes
25916 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25919 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25920 of the exact size and return that.
25922 (Class::LookupMethodByBuilder): New function that maps
25923 MethodBuilders to its methods. Required to locate the information
25924 on methods because System.Reflection bit us again.
25926 * support.cs: New file, contains an interface ParameterData and
25927 two implementations: ReflectionParameters and InternalParameters
25928 used to access Parameter information. We will need to grow this
25931 * expression.cs (Invocation::GetParameterData): implement a cache
25932 and a wrapper around the ParameterData creation for methods.
25933 (Invocation::OverloadResolve): Use new code.
25935 2001-09-13 Ravi Pratap <ravi@ximian.com>
25937 * class.cs (TypeContainer::EmitField): Remove and move into
25938 (Field::Define): here and modify accordingly.
25939 (Field.FieldBuilder): New member.
25940 (TypeContainer::Populate): Update accordingly.
25941 (TypeContainer::FindMembers): Implement.
25943 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25945 * statement.cs: (VariableInfo::VariableType): New field to be
25946 initialized with the full type once it is resolved.
25948 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25950 * parameter.cs (GetParameterInfo): Use a type cache to compute
25951 things only once, and to reuse this information
25953 * expression.cs (LocalVariableReference::Emit): Implement.
25954 (OpcodeCast::Emit): fix.
25956 (ParameterReference::Resolve): Implement.
25957 (ParameterReference::Emit): Implement.
25959 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25960 that are expressions need to stay as Expressions.
25962 * typemanager.cs (CSharpName): Returns the C# name of a type if
25965 * expression.cs (Expression::ConvertImplicit): New function that
25966 implements implicit type conversions.
25968 (Expression::ImplicitReferenceConversion): Implements implicit
25969 reference conversions.
25971 (EmptyCast): New type for transparent casts.
25973 (OpcodeCast): New type for casts of types that are performed with
25974 a sequence of bytecodes.
25976 (BoxedCast): New type used for casting value types into reference
25977 types. Emits a box opcode.
25979 (Binary::DoNumericPromotions): Implements numeric promotions of
25980 and computation of the Binary::Type.
25982 (Binary::EmitBranchable): Optimization.
25984 (Binary::Emit): Implement code emission for expressions.
25986 * typemanager.cs (TypeManager): Added two new core types: sbyte
25989 2001-09-12 Ravi Pratap <ravi@ximian.com>
25991 * class.cs (TypeContainer::FindMembers): Method which does exactly
25992 what Type.FindMembers does, only we don't have to use reflection. No
25993 implementation yet.
25995 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25996 typecontainer objects as we need to get at them.
25997 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25999 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26000 typecontainer object.
26002 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26003 of just a Report object.
26005 2001-09-11 Ravi Pratap <ravi@ximian.com>
26007 * class.cs (Event::Define): Go back to using the prefixes "add_" and
26009 (TypeContainer::Populate): Now define the delegates of the type too.
26010 (TypeContainer.Delegates): Property to access the list of delegates defined
26013 * delegates.cs (Delegate::Define): Implement partially.
26015 * modifiers.cs (TypeAttr): Handle more flags.
26017 2001-09-11 Ravi Pratap <ravi@ximian.com>
26019 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26021 (Operator::Define): Re-write logic to get types by using the LookupType method
26022 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26023 (Indexer::Define): Ditto.
26024 (Event::Define): Ditto.
26025 (Property::Define): Ditto.
26027 2001-09-10 Ravi Pratap <ravi@ximian.com>
26029 * class.cs (TypeContainer::Populate): Now define operators too.
26030 (TypeContainer.Operators): New property to access the list of operators
26032 (Operator.OperatorMethodBuilder): New member to hold the method builder
26033 for the operator we are defining.
26034 (Operator::Define): Implement.
26036 2001-09-10 Ravi Pratap <ravi@ximian.com>
26038 * class.cs (Event::Define): Make the prefixes of the accessor methods
26039 addOn_ and removeOn_
26041 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26042 of the location being passed in too. Ideally, this should go later since all
26043 error reporting should be done through the Report object.
26045 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26046 (Populate): Iterate thru the indexers we have and define them too.
26047 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26048 for the get and set accessors.
26049 (Indexer::Define): Implement.
26051 2001-09-09 Miguel de Icaza <miguel@ximian.com>
26053 * expression.cs (Binary::Resolve): Beginning of it. I scratched
26054 my previous implementation, did not work.
26056 * typemanager.cs: Add a couple of missing types (the longs).
26058 * literal.cs: Use TypeManager.bool_type instead of getting it.
26060 * expression.cs (EventExpr): New kind of expressions.
26061 (Expressio::ExprClassFromMemberInfo): finish
26063 2001-09-08 Miguel de Icaza <miguel@ximian.com>
26065 * assign.cs: Emit stores to static fields differently.
26067 2001-09-08 Ravi Pratap <ravi@ximian.com>
26069 * Merge in changes and adjust code to tackle conflicts. Backed out my
26070 code in Assign::Resolve ;-)
26072 2001-09-08 Ravi Pratap <ravi@ximian.com>
26074 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26075 instead Report.Error and also pass in the location.
26076 (CSharpParser::Lexer): New readonly property to return the reference
26077 to the Tokenizer object.
26078 (declare_local_variables): Use Report.Error with location instead of plain
26082 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26083 (Operator.CheckBinaryOperator): Ditto.
26085 * cs-parser.jay (operator_declarator): Update accordingly.
26087 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26088 (CheckBinaryOperator): Same here.
26090 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26091 on the name without any prefixes of namespace names etc. This is because we
26092 already might have something already fully qualified like
26093 'System.Console.WriteLine'
26095 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26097 2001-09-07 Ravi Pratap <ravi@ximian.com>
26099 * cs-tokenizer.cs (location): Return a string which also contains
26102 * expression.cs (ElementAccess): New class for expressions of the
26103 type 'element access.'
26104 (BaseAccess): New class for expressions of the type 'base access.'
26105 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26108 * cs-parser.jay (element_access): Implement action.
26109 (base_access): Implement actions.
26110 (checked_expression, unchecked_expression): Implement.
26112 * cs-parser.jay (local_variable_type): Correct and implement.
26113 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26115 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26117 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26118 name and the specifiers.
26120 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26122 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26123 making them all public ;-)
26125 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26128 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26130 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26132 (FieldExpr, PropertyExprs): New resolved expressions.
26133 (SimpleName::MemberStaticCheck): Perform static checks for access
26134 to non-static fields on static methods. Maybe this should be
26135 generalized for MemberAccesses.
26136 (SimpleName::ResolveSimpleName): More work on simple name
26139 * cs-parser.jay (primary_expression/qualified_identifier): track
26140 the parameter index.
26142 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26143 (EmitContext::EmitBoolExpression): Chain to expression generation
26144 instead of temporary hack.
26145 (::EmitStatementExpression): Put generic expression code generation.
26147 * assign.cs (Assign::Emit): Implement variable assignments to
26148 local variables, parameters and fields.
26150 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26152 * statement.cs (Block::GetVariableInfo): New method, returns the
26153 VariableInfo for a variable name in a block.
26154 (Block::GetVariableType): Implement in terms of GetVariableInfo
26156 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26157 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26159 2001-09-06 Ravi Pratap <ravi@ximian.com>
26161 * cs-parser.jay (operator_declaration): Continue on my quest : update
26162 to take attributes argument.
26163 (event_declaration): Ditto.
26164 (enum_declaration): Ditto.
26165 (indexer_declaration): Ditto.
26167 * class.cs (Operator::Operator): Update constructor accordingly.
26168 (Event::Event): Ditto.
26170 * delegate.cs (Delegate::Delegate): Same here.
26172 * enum.cs (Enum::Enum): Same here.
26174 2001-09-05 Ravi Pratap <ravi@ximian.com>
26176 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26178 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26180 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26181 being passed around as an arraylist.
26182 (Attributes::AddAttribute): Method to add attribute sections.
26184 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26185 (struct_declaration): Update accordingly.
26186 (constant_declaration): Update.
26187 (field_declaration): Update.
26188 (method_header): Update.
26189 (fixed_parameter): Update.
26190 (parameter_array): Ditto.
26191 (property_declaration): Ditto.
26192 (destructor_declaration): Ditto.
26194 * class.cs (Struct::Struct): Update constructors accordingly.
26195 (Class::Class): Ditto.
26196 (Field::Field): Ditto.
26197 (Method::Method): Ditto.
26198 (Property::Property): Ditto.
26199 (TypeContainer::OptAttribute): update property's return type.
26201 * interface.cs (Interface.opt_attributes): New member.
26202 (Interface::Interface): Update to take the extra Attributes argument.
26204 * parameter.cs (Parameter::Parameter): Ditto.
26206 * constant.cs (Constant::Constant): Ditto.
26208 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26209 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26210 the attributes as a parameter.
26211 (InterfaceProperty): Update constructor call.
26212 (InterfaceEvent): Ditto.
26213 (InterfaceMethod): Ditto.
26214 (InterfaceIndexer): Ditto.
26216 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26217 pass the attributes too.
26218 (interface_event_declaration): Ditto.
26219 (interface_property_declaration): Ditto.
26220 (interface_method_declaration): Ditto.
26221 (interface_declaration): Ditto.
26223 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26225 * class.cs (Method::Define): Track the "static Main" definition to
26226 create an entry point.
26228 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26229 EntryPoint if we find it.
26231 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26232 (EmitContext::ig): Make this variable public.
26234 * driver.cs: Make the default output file be the first file name
26235 with the .exe extension.
26237 Detect empty compilations
26239 Handle various kinds of output targets. Handle --target and
26240 rename -t to --dumper.
26242 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26243 methods inherited from Expression return now an Expression. This
26244 will is used during the tree rewriting as we resolve them during
26247 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26248 the spec. Missing entirely is the information about
26249 accessability of elements of it.
26251 (Expression::ExprClassFromMemberInfo): New constructor for
26252 Expressions that creates a fully initialized Expression based on
26253 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26256 (Invocation::Resolve): Begin implementing resolution of invocations.
26258 * literal.cs (StringLiteral): Implement Emit.
26260 2001-09-05 Ravi Pratap <ravi@ximian.com>
26262 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26265 2001-09-04 Ravi Pratap <ravi@ximian.com>
26267 * cs-parser.jay (attribute_arguments): Implement actions.
26268 (attribute): Fix bug in production. Implement action.
26269 (attribute_list): Implement.
26270 (attribute_target): Implement.
26271 (attribute_target_specifier, opt_target_specifier): Implement
26272 (CheckAttributeTarget): New method to check if the attribute target
26274 (attribute_section): Implement.
26275 (opt_attributes): Implement.
26277 * attribute.cs : New file to handle attributes.
26278 (Attribute): Class to hold attribute info.
26280 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26281 (attribute_section): Modify production to use 2 different rules to
26282 achieve the same thing. 1 s/r conflict down !
26283 Clean out commented, useless, non-reducing dimension_separator rules.
26285 * class.cs (TypeContainer.attributes): New member to hold list
26286 of attributes for a type.
26287 (Struct::Struct): Modify to take one more argument, the attribute list.
26288 (Class::Class): Ditto.
26289 (Field::Field): Ditto.
26290 (Method::Method): Ditto.
26291 (Property::Property): Ditto.
26293 * cs-parser.jay (struct_declaration): Update constructor call to
26294 pass in the attributes too.
26295 (class_declaration): Ditto.
26296 (constant_declaration): Ditto.
26297 (field_declaration): Ditto.
26298 (method_header): Ditto.
26299 (fixed_parameter): Ditto.
26300 (parameter_array): Ditto.
26301 (property_declaration): Ditto.
26303 * constant.cs (Constant::Constant): Update constructor similarly.
26304 Use System.Collections.
26306 * parameter.cs (Parameter::Parameter): Update as above.
26308 2001-09-02 Ravi Pratap <ravi@ximian.com>
26310 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26311 (TypeContainer.delegates): New member to hold list of delegates.
26313 * cs-parser.jay (delegate_declaration): Implement the action correctly
26314 this time as I seem to be on crack ;-)
26316 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26318 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26319 tell whether an identifier represents a namespace.
26321 * expression.cs (NamespaceExpr): A namespace expression, used only
26322 temporarly during expression resolution.
26323 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26324 utility functions to resolve names on expressions.
26326 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26328 * codegen.cs: Add hook for StatementExpressions.
26330 * class.cs: Fix inverted test for static flag in methods.
26332 2001-09-02 Ravi Pratap <ravi@ximian.com>
26334 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26335 to make it coincide with MS' number.
26336 (Operator::CheckBinaryOperator): Ditto.
26338 * ../errors/errors.txt : Remove error numbers added earlier.
26340 * ../errors/cs1019.cs : Test case for error # 1019
26342 * ../errros/cs1020.cs : Test case for error # 1020
26344 * cs-parser.jay : Clean out commented cruft.
26345 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26346 used anywhere - non-reducing rule.
26347 (namespace_declarations): Non-reducing rule - comment out.
26349 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26350 with TypeContainer::AddEnum.
26352 * delegate.cs : New file for delegate handling classes.
26353 (Delegate): Class for declaring delegates.
26355 * makefile : Update.
26357 * cs-parser.jay (delegate_declaration): Implement.
26359 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26361 * class.cs (Event::Define): Implement.
26362 (Event.EventBuilder): New member.
26364 * class.cs (TypeContainer::Populate): Update to define all enums and events
26366 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26367 readonly fields for all these cases ?
26369 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26371 * class.cs (Property): Revamp to use the convention of making fields readonly.
26372 Accordingly modify code elsewhere.
26374 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26375 the Define method of the Property class.
26377 * class.cs : Clean up applied patch and update references to variables etc. Fix
26379 (TypeContainer::Populate): Update to define all the properties we have. Also
26380 define all enumerations.
26382 * enum.cs (Define): Implement.
26384 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26386 * cs-parser.jay (overloadable_operator): The semantic value is an
26387 enum of the Operator class.
26388 (operator_declarator): Implement actions.
26389 (operator_declaration): Implement.
26391 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26392 validity of definitions.
26393 (Operator::CheckBinaryOperator): Static method to check for binary operators
26394 (TypeContainer::AddOperator): New method to add an operator to a type.
26396 * cs-parser.jay (indexer_declaration): Added line to actually call the
26397 AddIndexer method so it gets added ;-)
26399 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26400 already taken care of by the MS compiler ?
26402 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26404 * class.cs (Operator): New class for operator declarations.
26405 (Operator::OpType): Enum for the various operators.
26407 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26409 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26410 ostensibly handle this in semantic analysis.
26412 * cs-parser.jay (general_catch_clause): Comment out
26413 (specific_catch_clauses, specific_catch_clause): Ditto.
26414 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26415 (catch_args, opt_catch_args): New productions.
26416 (catch_clause): Rewrite to use the new productions above
26417 (catch_clauses): Modify accordingly.
26418 (opt_catch_clauses): New production to use in try_statement
26419 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26420 and re-write the code in the actions to extract the specific and
26421 general catch clauses by being a little smart ;-)
26423 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26424 Hooray, try and catch statements parse fine !
26426 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26428 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26429 string from the hashtable of variables.
26431 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26432 I end up making that mistake ;-)
26433 (catch_clauses): Fixed gross error which made Key and Value of the
26434 DictionaryEntry the same : $1 !!
26436 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26438 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26440 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26441 when the add and remove accessors are specified.
26443 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26445 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26446 information about indexer_declarator.
26447 (indexer_declarator): Implement actions.
26448 (parsing_indexer): New local boolean used to keep track of whether
26449 we are parsing indexers or properties. This is necessary because
26450 implicit_parameters come into picture even for the get accessor in the
26451 case of an indexer.
26452 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26454 * class.cs (Indexer): New class for indexer declarations.
26455 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26456 (TypeContainer::indexers): New member to hold list of indexers for the
26459 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26461 * cs-parser.jay (add_accessor_declaration): Implement action.
26462 (remove_accessor_declaration): Implement action.
26463 (event_accessors_declaration): Implement
26464 (variable_declarators): swap statements for first rule - trivial.
26466 * class.cs (Event): New class to hold information about event
26468 (TypeContainer::AddEvent): New method to add an event to a type
26469 (TypeContainer::events): New member to hold list of events.
26471 * cs-parser.jay (event_declaration): Implement actions.
26473 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26475 * cs-parser.jay (dim_separators): Implement. Make it a string
26476 concatenating all the commas together, just as they appear.
26477 (opt_dim_separators): Modify accordingly
26478 (rank_specifiers): Update accordingly. Basically do the same
26479 thing - instead, collect the brackets here.
26480 (opt_rank_sepcifiers): Modify accordingly.
26481 (array_type): Modify to actually return the complete type string
26482 instead of ignoring the rank_specifiers.
26483 (expression_list): Implement to collect the expressions
26484 (variable_initializer): Implement. We make it a list of expressions
26485 essentially so that we can handle the array_initializer case neatly too.
26486 (variable_initializer_list): Implement.
26487 (array_initializer): Make it a list of variable_initializers
26488 (opt_array_initializer): Modify accordingly.
26490 * expression.cs (New::NType): Add enumeration to help us
26491 keep track of whether we have an object/delegate creation
26492 or an array creation.
26493 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26494 members to hold data about array creation.
26495 (New:New): Modify to update NewType
26496 (New:New): New Overloaded contructor for the array creation
26499 * cs-parser.jay (array_creation_expression): Implement to call
26500 the overloaded New constructor.
26502 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26504 * class.cs (TypeContainer::Constructors): Return member
26505 constructors instead of returning null.
26507 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26509 * typemanager.cs (InitCoreTypes): Initialize the various core
26510 types after we have populated the type manager with the user
26511 defined types (this distinction will be important later while
26512 compiling corlib.dll)
26514 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26515 on Expression Classification. Now all expressions have a method
26516 `Resolve' and a method `Emit'.
26518 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26519 generation from working. Also add some temporary debugging
26522 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26524 * codegen.cs: Lots of code generation pieces. This is only the
26525 beginning, will continue tomorrow with more touches of polish. We
26526 handle the fundamentals of if, while, do, for, return. Others are
26527 trickier and I need to start working on invocations soon.
26529 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26532 * codegen.cs (EmitContext): New struct, used during code
26533 emission to keep a context. Most of the code generation will be
26536 * cs-parser.jay: Add embedded blocks to the list of statements of
26537 this block. So code generation proceeds in a top down fashion.
26539 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26541 * statement.cs: Add support for multiple child blocks.
26543 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26545 * codegen.cs (EmitCode): New function, will emit the code for a
26546 Block of code given a TypeContainer and its ILGenerator.
26548 * statement.cs (Block): Standard public readonly optimization.
26549 (Block::Block constructors): Link children.
26550 (Block::Child): Child Linker.
26551 (Block::EmitVariables): Emits IL variable declarations.
26553 * class.cs: Drop support for MethodGroups here, delay until
26555 (Method::): Applied the same simplification that I did before, and
26556 move from Properties to public readonly fields.
26557 (Method::ParameterTypes): Returns the parameter types for the
26558 function, and implements a cache that will be useful later when I
26559 do error checking and the semantic analysis on the methods is
26561 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26562 and made a method, optional argument tells whether this is a class
26563 or a structure to apply the `has-this' bit.
26564 (Method::GetCallingConvention): Implement, returns the calling
26566 (Method::Define): Defines the type, a second pass is performed
26567 later to populate the methods.
26569 (Constructor::ParameterTypes): implement a cache similar to the
26570 one on Method::ParameterTypes, useful later when we do semantic
26573 (TypeContainer::EmitMethod): New method. Emits methods.
26575 * expression.cs: Removed MethodGroup class from here.
26577 * parameter.cs (Parameters::GetCallingConvention): new method.
26579 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26581 * class.cs (TypeContainer::Populate): Drop RootContext from the
26584 (Constructor::CallingConvention): Returns the calling convention.
26585 (Constructor::ParameterTypes): Returns the constructor parameter
26588 (TypeContainer::AddConstructor): Keep track of default constructor
26589 and the default static constructor.
26591 (Constructor::) Another class that starts using `public readonly'
26592 instead of properties.
26594 (Constructor::IsDefault): Whether this is a default constructor.
26596 (Field::) use readonly public fields instead of properties also.
26598 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26599 track of static constructors; If none is used, turn on
26600 BeforeFieldInit in the TypeAttributes.
26602 * cs-parser.jay (opt_argument_list): now the return can be null
26603 for the cases where there are no arguments.
26605 (constructor_declarator): If there is no implicit `base' or
26606 `this', then invoke the default parent constructor.
26608 * modifiers.cs (MethodAttr): New static function maps a set of
26609 modifiers flags into a MethodAttributes enum
26610 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26611 MethodAttr, TypeAttr to represent the various mappings where the
26612 modifiers are used.
26613 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26615 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26617 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26620 * interface.cs (PopulateIndexer): Implemented the code generator
26621 for interface indexers.
26623 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26625 * interface.cs (InterfaceMemberBase): Now we track the new status
26628 (PopulateProperty): Implement property population. Woohoo! Got
26629 Methods and Properties going today.
26631 Removed all the properties for interfaces, and replaced them with
26632 `public readonly' fields.
26634 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26636 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26637 initialize their hashtables/arraylists only when they are needed
26638 instead of doing this always.
26640 * parameter.cs: Handle refs and out parameters.
26642 * cs-parser.jay: Use an ArrayList to construct the arguments
26643 instead of the ParameterCollection, and then cast that to a
26646 * parameter.cs: Drop the use of ParameterCollection and use
26647 instead arrays of Parameters.
26649 (GetParameterInfo): Use the Type, not the Name when resolving
26652 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26654 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26655 and instead use public readonly fields.
26657 * class.cs: Put back walking code for type containers.
26659 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26661 * class.cs (MakeConstant): Code to define constants.
26663 * rootcontext.cs (LookupType): New function. Used to locate types
26666 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26668 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26669 this System.Reflection code is. Kudos to Microsoft
26671 * typemanager.cs: Implement a type cache and avoid loading all
26672 types at boot time. Wrap in LookupType the internals. This made
26673 the compiler so much faster. Wow. I rule!
26675 * driver.cs: Make sure we always load mscorlib first (for
26676 debugging purposes, nothing really important).
26678 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26679 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26681 * rootcontext.cs: Lookup types on their namespace; Lookup types
26682 on namespaces that have been imported using the `using' keyword.
26684 * class.cs (TypeContainer::TypeAttr): Virtualize.
26685 (Class::TypeAttr): Return attributes suitable for this bad boy.
26686 (Struct::TypeAttr): ditto.
26687 Handle nested classes.
26688 (TypeContainer::) Remove all the type visiting code, it is now
26689 replaced with the rootcontext.cs code
26691 * rootcontext.cs (GetClassBases): Added support for structs.
26693 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26695 * interface.cs, statement.cs, class.cs, parameter.cs,
26696 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26697 Drop use of TypeRefs, and use strings instead.
26699 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26703 * class.cs (Struct::Struct): set the SEALED flags after
26704 checking the modifiers.
26705 (TypeContainer::TypeAttr): new property, returns the
26706 TypeAttributes for a class.
26708 * cs-parser.jay (type_list): Oops, list production was creating a
26709 new list of base types.
26711 * rootcontext.cs (StdLib): New property.
26712 (GetInterfaceTypeByName): returns an interface by type name, and
26713 encapsulates error handling here.
26714 (GetInterfaces): simplified.
26715 (ResolveTree): Encapsulated all the tree resolution here.
26716 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26719 * driver.cs: Add support for --nostdlib, to avoid loading the
26720 default assemblies.
26721 (Main): Do not put tree resolution here.
26723 * rootcontext.cs: Beginning of the class resolution.
26725 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26727 * rootcontext.cs: Provide better error reporting.
26729 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26731 * rootcontext.cs (CreateInterface): Handle the case where there
26732 are no parent interfaces.
26734 (CloseTypes): Routine to flush types at the end.
26735 (CreateInterface): Track types.
26736 (GetInterfaces): Returns an array of Types from the list of
26737 defined interfaces.
26739 * typemanager.c (AddUserType): Mechanism to track user types (puts
26740 the type on the global type hash, and allows us to close it at the
26743 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26745 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26746 RecordInterface instead.
26748 * cs-parser.jay: Updated to reflect changes above.
26750 * decl.cs (Definition): Keep track of the TypeBuilder type that
26751 represents this type here. Not sure we will use it in the long
26752 run, but wont hurt for now.
26754 * driver.cs: Smaller changes to accomodate the new code.
26756 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26759 * rootcontext.cs (CreateInterface): New method, used to create
26760 the System.TypeBuilder type for interfaces.
26761 (ResolveInterfaces): new entry point to resolve the interface
26763 (CodeGen): Property, used to keep track of the code generator.
26765 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26767 * cs-parser.jay: Add a second production for delegate_declaration
26770 (enum_body): Put an opt_comma here instead of putting it on
26771 enum_body or enum_member_declarations so we can handle trailing
26772 commas on enumeration members. Gets rid of a shift/reduce.
26774 (type_list): Need a COMMA in the middle.
26776 (indexer_declaration): Tell tokenizer to recognize get/set
26778 * Remove old targets.
26780 * Re-add the parser target.
26782 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26784 * cs-parser.jay: Add precendence rules for a number of operators
26785 ot reduce the number of shift/reduce conflicts in the grammar.
26787 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26789 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26792 Get rid of old crufty code.
26794 * rootcontext.cs: Use this to keep track of the parsed
26795 representation and the defined types available to the program.
26797 * gen-treedump.cs: adjust for new convention.
26799 * type.cs: Split out the type manager, and the assembly builder
26802 * typemanager.cs: the type manager will live here now.
26804 * cil-codegen.cs: And the code generator here.
26806 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26808 * makefile: Fixed up for easy making.
26810 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26812 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26815 (unary_expression): Expand pre_increment_expression and
26816 post_decrement_expression to reduce a shift/reduce.
26818 2001-07-11 Simon Cozens
26820 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26822 Improve allow_keyword_as_indent name.
26824 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26826 * Adjustments for Beta2.
26828 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26830 * decl.cs: Added `Define' abstract method.
26831 (InTransit): new property, used to catch recursive definitions.
26833 * interface.cs: Implement `Define'.
26835 * modifiers.cs: Map Modifiers.constants to
26836 System.Reflection.TypeAttribute flags.
26838 * class.cs: Keep track of types and user-defined types.
26839 (BuilderInit): New method for creating an assembly
26840 (ResolveType): New function to launch the resolution process, only
26841 used by interfaces for now.
26843 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26844 that are inserted into the name space.
26846 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26848 * ARGH. I have screwed up my tree so many times due to the use of
26849 rsync rather than using CVS. Going to fix this at once.
26851 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26854 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26856 * Experiment successful: Use System.Type rather that our own
26859 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26861 * cs-parser.jay: Removed nsAliases from here.
26863 Use new namespaces, handle `using XXX;'
26865 * namespace.cs: Reimplemented namespace handling, use a recursive
26866 definition of the class. Now we can keep track of using clauses
26867 and catch invalid using clauses.
26869 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26871 * gen-treedump.cs: Adapted for all the renaming.
26873 * expression.cs (Expression): this class now has a Type property
26874 which returns an expression Type.
26876 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26877 `Type', as this has a different meaning now in the base
26879 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26881 * interface.cs, class.cs: Removed from all the sources the
26882 references to signature computation, as we can not do method
26883 signature computation during the parsing time, as we are not
26884 trying to solve at that point distinguishing:
26888 void a (NS.Blah x) {}
26891 Which depending on the context might be valid or not, as we do not
26892 know if Blah is the same thing as NS.Blah at that point.
26894 * Redid everything so the code uses TypeRefs now instead of
26895 Types. TypeRefs are just temporary type placeholders, that need
26896 to be resolved. They initially have a pointer to a string and the
26897 current scope in which they are used. This is used later by the
26898 compiler to resolve the reference to an actual Type.
26900 * DeclSpace is no longer a CIR.Type, and neither are
26901 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26902 are all DeclSpaces, but no Types.
26904 * type.cs (TypeRefManager): This implements the TypeRef manager,
26905 which keeps track of all the types that need to be resolved after
26906 the parsing has finished.
26908 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26910 * ARGH. We are going to have to store `foreach' as a class rather
26911 than resolving it, as we need to verify error 1579 after name
26912 resolution. *OR* we could keep a flag that says `This request to
26913 IEnumerator comes from a foreach statement' which we can then use
26914 to generate the error.
26916 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26918 * class.cs (TypeContainer.AddMethod): we now add methods to the
26919 MethodGroup instead of the method hashtable.
26921 * expression.cs: Add MethodGroup abstraction, which gets us one
26922 step closer to the specification in the way we handle method
26925 * cs-parser.jay (primary_expression): qualified_identifier now
26926 tried to match up an identifier to a local variable reference or
26927 to a parameter reference.
26929 current_local_parameters is now a parser global variable that
26930 points to the current parameters for the block, used during name
26933 (property_declaration): Now creates an implicit `value' argument to
26936 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26938 * parameter.cs: Do not use `param' arguments as part of the
26939 signature, per the spec.
26941 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26943 * decl.cs: Base class for classes, structs and interfaces. This
26944 is the "Declaration Space"
26946 * cs-parser.jay: Use CheckDef for checking declaration errors
26947 instead of having one on each function.
26949 * class.cs: Factor out some code for handling error handling in
26950 accordance to the "Declarations" section in the "Basic Concepts"
26951 chapter in the ECMA C# spec.
26953 * interface.cs: Make all interface member classes derive from
26954 InterfaceMemberBase.
26956 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26958 * Many things: all interfaces are parsed and generated in
26959 gen-treedump. Support for member variables, constructors,
26960 destructors, properties, constants is there.
26962 Beginning of the IL backend, but very little done, just there for
26965 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26967 * cs-parser.jay: Fix labeled statement.
26969 * cs-tokenizer.cs (escape): Escape " and ' always.
26970 ref_line, ref_name: keep track of the line/filename as instructed
26971 by #line by the compiler.
26974 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26976 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26977 to match the values in System.CodeDOM.
26979 Divid renamed to Divide.
26981 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26983 (Statements.set): remove.
26985 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26988 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26989 falseStatements always have valid values.
26991 * cs-parser.jay: Use System.CodeDOM now.