use statically known length when accessing length field of inlined array (closes #2568)
consider type parameters for generic paths (closes #2576)