Test that type-checking works with generic functions