forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

error 144 - Type has been declared but ... :: a bug?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
qt



Joined: 23 Aug 2005
Posts: 46
Location: Berlin, Germany

PostPosted: Fri Jul 24, 2015 4:22 pm    Post subject: error 144 - Type has been declared but ... :: a bug? Reply with quote

A customer sent me the following source code. When FTN95 compiles it the error 144 is output, although we can't see that there is anything faulty. We have checked with other compilers, which didn't complain:

Code:

module type1_module

 private
 public type1

 type :: type1
    integer                           :: id
 end type type1

end module type1_module

!----------------------------------------------------------

module module1

 private
 public msg_len
 public func1 ! delete this line and the error is gone

 integer, parameter :: msg_len=256

 contains

! if this function is deleted the error is gone
function func1(t1_inst1) result(ierr)
  use type1_module, only: type1
  type(type1), intent(in) :: t1_inst1
  integer:: ierr
  ierr=0
end function func1

end module module1

!----------------------------------------------------------

module module2

 use module1, only: msg_len

! if the following 2 lines are activated -> no error
 !  private
  ! public msg

 character(len=msg_len) :: msg

end module module2

!----------------------------------------------------------

program main

  use type1_module, only: type1
  use module2, only: msg

  type(type1) :: t1_inst2

  msg='Main running...' !ftn95 v7.20 error: Type TYPE(TYPE1) has been declared but not defined
  write(6,*) msg
  t1_inst2%id=2  !ftn95 v5.40 error: id is not a component of TYPE1


end program main



You will have noticed a few comments. For example, if you delete line 19, the error 144 is gone. This is definitely strange. Please check.

Thank you.

Joerg Kuthe
www.qtsoftware.com
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sat Jul 25, 2015 3:55 am    Post subject: Reply with quote

Changing the order of the USE statements at line 52:53 also removes the problem. .
Code:
 program main

   use module2, only: msg
   use type1_module, only: type1

   type(type1) :: t1_inst2

   msg='Main running...' !ftn95 v7.20 error: Type TYPE(TYPE1) has been declared but not defined
   write(6,*) msg
   t1_inst2%id=2  !ftn95 v5.40 error: id is not a component of TYPE1


 end program main


It looks to me that type1 is becoming private in module1, although %id is being recognised ?

private/public can cause problems I never fully understand, although it does appear to be a bug

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Sat Jul 25, 2015 8:31 am    Post subject: Reply with quote

Joerg

Thank you for your post.

I have logged this as a bug that needs fixing.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Wed Jun 08, 2016 3:31 pm    Post subject: Reply with quote

This has now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group