add tests for generic type

add regression tests for #246