fix type guard semantic: pointer type is checked for pointer variable and record type for record variable.