From 39c34b0898d048c368f1258cb5e6a76c5aa553f1 Mon Sep 17 00:00:00 2001 From: halw Date: Fri, 16 Sep 2011 14:15:29 +0000 Subject: [PATCH] Added definition template for "conformance". Author:halw Date:2011-09-16T14:15:29.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@972 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../current/method/eiffel-tutorial-et/et-inheritance.wiki | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki b/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki index c172ea31..8f529a42 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-inheritance.wiki @@ -100,7 +100,10 @@ Besides changing the implementation of a routine, a redefinition can turn an arg The inheritance mechanism is relevant to both roles of classes: module and type. Its application as a mechanism to reuse, adapt and extend features from one class to another, as just seen, covers its role as a '''module extension''' mechanism. But it's also a '''subtyping''' mechanism. To say that D is an heir of A, or more generally a descendant of A, is to express that instances of D can be viewed as instances of A. -'''Polymorphic assignment''' supports this second role. In an assignment x := y, the types of x and y do not have, with inheritance, to be identical; the rule is that the type of y must simply '''conform''' to the type of x. A class D conforms to a class A if and only if it is a descendant of A (which includes the case in which A and D are the same class); if these classes are generic, conformance of D [ U ] to C [ T ] requires in addition that type U conform to type T (through the recursive application of the same rules). +'''Polymorphic assignment''' supports this second role. In an assignment x := y, the types of x and y do not have, with inheritance, to be identical; the rule is that the type of y must simply '''conform''' to the type of x. + + +{{definition|Conformance|A class D conforms to a class A if and only if it is a descendant of A (which includes the case in which A and D are the same class); if these classes are generic, conformance of D [U] to C [T] requires in addition that type U conform to type T (through the recursive application of the same rules). }} {{note|In addition, it will be shown in the discussion of tuples ([[ET: Other Mechanisms#Tuple_types|"Tuple types"]]), that TUPLE [X] conforms to TUPLE, TUPLE [X, Y] to TUPLE [X] and so on. }}