I've just got the ACCOUNT old sample and write some code with the STRING owner's type:
class
ACCOUNT
create
make
feature
balance: INTEGER
owner: STRING
make
do
create owner.make_empty
end
minimum_balance: INTEGER = 1000
open (who: STRING)
do
owner := who
end
The application's code is:
acc: ACCOUNT
make
do
create acc.make
acc.open ("Jill")
...
It is compiled and works. After I want to change owner type to a PERSON
owner: PERSON
...
open (who: PERSON)
do
owner := who
end
and I created the PERSON class just as an extension to the STRING class:
class
PERSON
inherit
STRING
end
I believe this can work in every language but seems not in Eiffel. The code fails to compile with VGCC(6) and VEVI errors. Any ideas?