- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not know if this is a bug or a (overlooked) feature.
I have a module with a user defined type and operator overload function. For example:
interface operator (+)
module procedure nmin_add
end interface
The procedure nmin_add adds two of the type and returns the type result.
Performing A = B + C where the operands and result are the same type.
No issue when a procedure contains:
use foo_module ! A, B and C, and nmin_add contained in the module
The issue comes in when I have:
use foo_module, only: A, B C
error #6549: An arithmetic or LOGICAL type is required in this context. [...]
as well as
use foo_module, only: A, B C, nmin_add
error #6580: Name in only-list does not exist or is not accessible. [NMIN_ADD]
The problem I believe is the operator(+) isn't imported, nor is the function. It looks like there is no syntax on the use only to pull in the operators.
Sorry, for not providing a reproducer.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ahh, hadn't tried that.
That works.
Thanks
Helps resolve name collisions.
Jim
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page