gfc_namespace *module_ns;
gfc_interface *old_interface_head, *interface;
- if (gfc_state_stack->state != COMP_INTERFACE
+ if ((gfc_state_stack->state != COMP_INTERFACE
+ && gfc_state_stack->state != COMP_CONTAINS)
|| gfc_state_stack->previous == NULL
|| current_interface.type == INTERFACE_NAMELESS
|| current_interface.type == INTERFACE_ABSTRACT)