Open
Description
One thing that seems to come up frequently in generics (especially with what seems to be the quintessential example for Fortran), is specifying a "Trait" (or a "template" procedure) in such a way as two (or more) arguments must have the same type. For example, if I want to define a trait that requires the add
function, in (psuedo)code, I'd like to have it look something like the following:
trait addable
function add(x, y) result(z)
type(addable), intent(in) :: x
type(typeof(x)), intent(in) :: y
type(typeof(x)) :: z
end function
end trait
but (AFAIK), typeof
only works for variables with a declared, specific type. I think it would make sense to have it work in this context, but it's something we should be thinking about.
Metadata
Metadata
Assignees
Labels
No labels