From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB9D33861036; Sat, 20 Feb 2021 20:06:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB9D33861036 From: "drikosev at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99183] New: Incompatible Runtime types Date: Sat, 20 Feb 2021 20:06:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: drikosev at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2021 20:06:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99183 Bug ID: 99183 Summary: Incompatible Runtime types Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: drikosev at gmail dot com Target Milestone: --- Having post a question in c.l.f I was informed that the program below is invalid but gfortran accepts it (several versions). This is the question: https://groups.google.com/g/comp.lang.fortran/c/jWHX3kJMeYY/m/4IMgy19hDgAJ Hope it isn't a duplicate! $ gfortran8 dream-casting.f90 && ./a.out allocated x =3D d1(ind=3D1,i=3D1) allocated v =3D d2(ind=3D2,j=3D2) assigned v =3D x, now v%ind=3D 1 j=3D 1 $ cat dream-casting.f90 program test implicit none type :: d0 integer :: ind end type d0 type, extends(d0) :: d1 integer :: i end type d1 type, extends(d0) :: d2 integer :: j end type d2 class(d1), allocatable :: x class(d2), allocatable :: v allocate ( x , source =3D d1(1,1)) print *, "allocated x =3D d1(ind=3D1,i=3D1)" allocate ( v , source =3D d2(2,2)) print *, "allocated v =3D d2(ind=3D2,j=3D2)" v =3D x print *, "assigned v =3D x, now v%ind=3D", v%ind, "j=3D", v%j end program test=