allow usage of generic type parameters in expressions (closes #2038)