Add function to test the type of a variant