The error says that the attribute `name` should be set after the object creation, because its type is attached. There are several ways to solve the issue:
1. Mark all reference attributes as detachable:
class PERSON
name: detachable STRING
age: INTEGER
end
2. Mark the class as deferred, so that no instances of it could be created:
deferred class PERSON
name: STRING
age: INTEGER
end
3. Add a default creation procedure that initializes the attribute:
class PERSON inherit ANY redefine default_create end feature
default_create do name := "" end
name: STRING
age: INTEGER
end
4. Add a creation procedure that will be used to initialize the object:
class PERSON create make feature
make (n: like name; y: like age)
do
name := n
age := y
end
name: STRING
age: INTEGER
end