(j3.2006) Component etc. names

Van Snyder vsnyder
Tue Apr 24 20:39:16 EDT 2012


C514 says no entity declared within a type definition shall have the
same name as another entity declared within the same type definition.

I cannot find a constraint that says a type parameter, data component,
or procedure component declared in a type extension shall not have the
same name as an entity in its parent type, or the same name as its
parent type.  C514 doesn't cover this because an extension type is a
different scoping unit from its parent.

I cannot find a constraint that a procedure binding in a type extension
shall not have the same name as a type parameter, data component, or
procedure component of its parent type, or the same name as its parent
type.  C514 doesn't cover this either, for the same reason.

These are obvious things that I'm sure we intend, but I can't find them.

Is the <final-procedure-stmt> a declaration of an entity?  Does C514
prohibit a <binding-name> in a <type-bound-proc-binding> to be the same
as a <final-subroutine-name>?

Can I have

  type :: T
  contains
    procedure :: Final
    final :: Final
  end type T

or do I need to do something like

  type :: T
  contains
    procedure :: Force_Finalization => Final
    final :: Final
  end type T

Apparently, neither one is possible.  C456 requires the passed-object
dummy argument to be polymorphic, while C480 requires the argument of a
final subroutine NOT to be polymorphic.

How about

  type :: T
    integer :: Final
  contains
    final :: Final
  end type T

or

  type :: T
  contains
    procedure :: Final => ForceFinalization
    final :: Final
  end type T

Does C514 prohibit either one of these?





More information about the J3 mailing list