Verification type compatibility is defined in terms of assignment compatibility (see §I.8.7).
A type Q
is verifier-assignable-to R
(sometimes written R
:= Q
) if and only if T
is the verification type of Q
, and U
is the verification type of R
, and at least one of the following holds:
-
T
is identical toU
. [Note: this is reflexivity for verification type compatibility.] -
There exists some
V
such thatT
is verifier-assignable-toV
andV
is verifier-assignable-toU
. [Note: this is transitivity for verification type compatibility.] -
T
is assignable-toU
according to the rules in §I.8.7.3. -
T
is a controlled-mutability managed pointer type to typeV
andU
is a controlled-mutability managed pointer type to typeW
andV
is pointer-element-assignable-toW
. -
T
is a managed pointer typeV&
andU
is a controlled-mutability managed pointer type to typeW
andV
is pointer-element-assignable-toW
. -
T
is boxedV
andU
is the immediate base class ofV
. -
T
is boxedV
andU
is an interface directly implemented byV
. -
T
is boxedX
for a generic parameterX
andV
is a generic constraint declared on parameterX
. -
T
is the null type, andU
is a reference type.
[Note: verifier-assignable-to extends assignable-to to deal with types that can occur only on the stack, namely boxed types, controlled-mutability managed pointer types, and the null type. end note]
In the remainder of Partition III, the use of the notation "U
:= T
" is sometimes used to mean T
is verifier-assignable-to U
.