-
-
Save unterumarmung/eb025d23f36af73ef8b6b442a8d0dc58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module a | |
implicit none | |
abstract interface | |
function foo(x) | |
integer, intent(in) :: x | |
integer :: foo | |
end function foo | |
end interface | |
type handle | |
procedure(foo), pointer, nopass :: foo1 => NULL() | |
procedure(foo), pointer, nopass :: foo2 => NULL() | |
end type handle | |
end module a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module b | |
use a | |
implicit none | |
contains | |
integer function bar1(foo1) | |
implicit none | |
procedure(foo) :: foo1 | |
bar1 = 42 | |
end function bar1 | |
integer function bar2(h) | |
implicit none | |
type(handle) :: h | |
procedure(foo), pointer :: f1 => NULL() | |
procedure(foo), pointer :: f2 => NULL() | |
integer :: res | |
f1 => h%foo1 | |
res = bar1(f1) | |
bar2 = res | |
end function bar2 | |
end module b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment