
module test

	implicit none

	type my_type
		class(*), allocatable	::		scal
		class(*), allocatable	::		vec(:)
	contains
		procedure, pass(m)		::		scalar_assign
		procedure, pass(m)		::		vector_assign
		generic				::		assignment(=) => scalar_assign, vector_assign
	end type

contains

	subroutine scalar_assign(s, m)
		class(*), allocatable, intent(out)		::		s
		class(my_type), intent(in)			::		m
		integer							::		i

		allocate(s, source=m%scal)

	end subroutine
	
	subroutine vector_assign(v, m)
		class(*), allocatable, intent(out)		::		v(:)
		class(my_type), intent(in)			::		m

		allocate(v, source=m%vec)

	end subroutine

end module

