replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Incorrect use of derived type
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 

Incorrect use of derived type

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



Joined: 05 Jul 2006
Posts: 299

PostPosted: Tue Aug 27, 2013 2:46 am    Post subject: Incorrect use of derived type Reply with quote

The following program attempts to increment an integer component of a derived type, but in line 14 incorrectly refers to u%j%i instead of u%t%i.

Code:

MODULE m
  TYPE t1
    INTEGER :: i=0
  END TYPE t1
  TYPE t2
    INTEGER :: j=0
    TYPE(t1) :: t
  END TYPE t2
END MODULE m
!
PROGRAM p
  USE m
  TYPE(t2) :: u
  PRINT *, u%j%i+1
END PROGRAM p


The compiler, appropriately, generates an error message, but seems to imply that u is integer. Is it possible for the compiler to indicate that u%j is INTEGER(KIND=3) rather than u?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Aug 27, 2013 7:05 am    Post subject: Reply with quote

I have logged this. It could be that the compiler is looking at J rather than U.

Chances are the error report is generally correct and this is an exception so these things are not necessarily easy to fix.
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Tue Aug 27, 2013 8:52 am    Post subject: Reply with quote

Hello,

This is the same BUG I refer to in the post below. See message of 31 July for the simplest example.

http://forums.silverfrost.com/viewtopic.php?t=2474

I am still hoping that this can be fixed at some point, because at the momement derived types with default initialization are not usable with the compiler.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Aug 27, 2013 11:34 am    Post subject: Reply with quote

This is simply an unnecessary (and incorrectly phrased) error report which I have now suppressed.

It does not bear any relation to other bugs which we aim to fix in due course.
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