tests for #381
fix #381
pass type arguments to dynamic check #381