@@ -832,13 +832,15 @@ inline bool can_cast_type<array_typet>(const typet &type)
832832inline const array_typet &to_array_type (const typet &type)
833833{
834834 PRECONDITION (can_cast_type<array_typet>(type));
835+ array_typet::check (type);
835836 return static_cast <const array_typet &>(type);
836837}
837838
838839// / \copydoc to_array_type(const typet &)
839840inline array_typet &to_array_type (typet &type)
840841{
841842 PRECONDITION (can_cast_type<array_typet>(type));
843+ array_typet::check (type);
842844 return static_cast <array_typet &>(type);
843845}
844846
@@ -1038,13 +1040,15 @@ inline bool can_cast_type<vector_typet>(const typet &type)
10381040inline const vector_typet &to_vector_type (const typet &type)
10391041{
10401042 PRECONDITION (can_cast_type<vector_typet>(type));
1043+ type_with_subtypet::check (type);
10411044 return static_cast <const vector_typet &>(type);
10421045}
10431046
10441047// / \copydoc to_vector_type(const typet &)
10451048inline vector_typet &to_vector_type (typet &type)
10461049{
10471050 PRECONDITION (can_cast_type<vector_typet>(type));
1051+ type_with_subtypet::check (type);
10481052 return static_cast <vector_typet &>(type);
10491053}
10501054
@@ -1078,13 +1082,15 @@ inline bool can_cast_type<complex_typet>(const typet &type)
10781082inline const complex_typet &to_complex_type (const typet &type)
10791083{
10801084 PRECONDITION (can_cast_type<complex_typet>(type));
1085+ type_with_subtypet::check (type);
10811086 return static_cast <const complex_typet &>(type);
10821087}
10831088
10841089// / \copydoc to_complex_type(const typet &)
10851090inline complex_typet &to_complex_type (typet &type)
10861091{
10871092 PRECONDITION (can_cast_type<complex_typet>(type));
1093+ type_with_subtypet::check (type);
10881094 return static_cast <complex_typet &>(type);
10891095}
10901096
0 commit comments