La fonction n'a pas de type implicites

Je suis en train d'apprendre à travailler avec des fonctions. J'ai le code suivant:

program main
  implicit none

  write(*,*) test(4)
end program

integer function test(n)
  implicit none
  integer, intent(in) :: n
  integer :: i, ans

  ans=1
  do i=1,n
  ans=ans*i
  enddo

  test=ans
end function test

Quand je compile (avec gfortran 4.1.2), j'obtiens l'erreur suivante:

In file test.f90:4

  write(*,*) test(4)
           1
Error: Function 'test' at (1) has no IMPLICIT type

OriginalL'auteur sodiumnitrate | 2013-07-19