-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Labels
Description
Consider the following code:
type Base
integer :: i /-1/
end type
type, extends(Base) :: Child
integer :: j /-3/
end type
type(Child) :: c1 = Child(1000)
print*, c1%i
print*, c1%j
end
Flang complains:
./t.f:10:24: error: Structure constructor lacks a value for component 'j'
type(Child) :: c1 = Child(1000)
^^^^^
./t.f:7:18: Declaration of 'j'
integer :: j /-3/
^
It works if I use integer :: i = -1
instead.
It also works if I use "empty" constructor as type(child) :: c1