assert.is_type

Asserts that `actual` is of type `T`.

Reference version

Signature

function assert.is_type<T>(actual: unknown) -> T

Asserts that actual is of type T.

Returns

actual if it is of type T. This can be used to assert the type of a value and use it in further computations.

Panics

  • baml.panics.AssertionFailed when actual is not of type T.

Source:<builtin>/assert/assert.bamlbytes 38454180