Yes, that works without any problem. If you need to use any property of the extended (derived) type, you have to use select type
, but if not, it is without any complication.
If you need the dummy argument to be allocatable
or pointer
, there are some restrictions:
12.5.2.5
2 The actual argument shall be polymorphic if and only if the associated dummy argument is polymorphic, and either both the actual and dummy arguments shall be unlimited polymorphic, or the declared type of the actual argument shall be the same as the declared type of the dummy argument.
(the reason for this is explained in NOTE 12.27 in ISO/IEC 1539-1:2010)