Re: Cannot create deferred object - too restrictive
Peter Gummer <[email protected]> Fri, 2 Dec 2005 23:40:24 +1100
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
left wrote: >>> original: like Current >>> ... >>> ****** Fatal Error: Type A is deferred. (Cannot >>> create object.) >>> Line 498 column 10 in A (.../a.e): >>> create original.make >>> ... >> >> But how do you know that this class will list `make' as >> creation procedure? > > Note this is not what the compiler complains about. And the > error is still the same if class A implements a 'make' procedure. But it is. It says, "Cannot create object." You are right that it doesn't say why it cannot create it, but Eric has indicated the reason: there is no way for the compiler to know whether 'make' is a creation procedure of 'like Current'. Implementing 'make' is not enough; the class must list it as a creation procedure. The compiler does not know which class is being created, so of course it can't know whether 'make' is ok. - Peter Gummer