The expression <T>expr tells the type system to treat expr as type T, even though it might have been computed as a different type. This is called a type claim, because we’re claiming that expr is of type T. (We say “claim” instead of “assert”, which is an unrelated concept.)
The expression
<T>expr
tells the type system to treatexpr
as typeT
, even though it might have been computed as a different type. This is called a type claim, because we’re claiming thatexpr
is of typeT
. (We say “claim” instead of “assert”, which is an unrelated concept.)