length with type annotation