- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When nesting block statements into each other, it is no longer possible to access the result value of an outer function.Consider
program nestBlock
implicit none
contains
integer function test() result(Res)
block
block
Res = 1
end block
end block
end function
end program
This leads to error #7816: Invalid assignment to function result of external procedure.
The error occurs regardless of whether a result variable is defined or the function name is used by itself. Assignment works for one single block, but as soon as the second level starts, the result can no longer be written to.
Compiler: Visual Fortran Compiler 17.0.2.187
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this defect and for the convenient reproducer. I escalated it to Development.
(Internal tracking id: DPD200420015)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page