# Pure procedure and intent(out) polymorphic pointer argument

**URL:** <https://fortran-lang.discourse.group/t/pure-procedure-and-intent-out-polymorphic-pointer-argument/8830>\
**Category:** Uncategorized\
**Created:** [November 12, 2024, 1:05am UTC](https://fortran-lang.discourse.group/t/pure-procedure-and-intent-out-polymorphic-pointer-argument/8830 "2024-11-12T01:05:18Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [November 12, 2024, 11:16pm UTC](https://fortran-lang.discourse.group/t/pure-procedure-and-intent-out-polymorphic-pointer-argument/8830/15 "2024-11-12T23:16:58Z")

</div>

Just curious, is there any reason why you can’t simply use a function?

```auto
module bugmod
    implicit none
    type value_t
    end type
    type(value_t), target :: foo
contains
    function fetch_ptr() result(ptr)
        class(value_t), pointer :: ptr
        ptr => foo
    end function
end module

program test
    use bugmod
    associate(tmp => fetch_ptr()) ! (bug?!)
       print *, associated(tmp,foo)
    end associate
end program

```

---

_[View the full topic](https://fortran-lang.discourse.group/t/pure-procedure-and-intent-out-polymorphic-pointer-argument/8830)._
