The I7 compiler is able to deduce the kind of something previously unmentioned when it is involved in a relation. The following causes no issues:
A race car is a kind of vehicle.
Driving relates one person (called the driver) to various race cars. [compiler informed of required kinds]
The Speedster is driven by Mr Speedy. [deduces kinds for both Speedster and Speedy]
However, the compiler is not able to deduce the kind of something previously-unmentioned when it is assigned as a property. The last statement of the following triggers a Problem message:
A race car is a kind of vehicle.
A race car has a person called the driver. [compiler informed of required kind]
The Speedster is a race car. The driver of the Speedster is Mr Speedy. [can't deduce that Speedy is a person]
The Problem message resulting seems like the compiler is trying to make a deduction about Mr Speedy
but is getting no farther than deciding it must be an object
.
Problem. In the sentence âThe driver of the Speedster is Mr Speedyâ , it looks as if you intend âThe driver of the Speedster is Mr Speedyâ to be asserting something, but that tries to set the value of the âdriverâ property to an object - which must be wrong because this property has to be a person.
Type information is available to the compiler â the Problem message even indicates an awareness of the required type! Why doesnât it make the same kind of deduction as it does for relations? Is this something that could be implemented?