> But this check for null makes sense only for reference types and > nullable value types. For non-nullale value types it is redundant. How > can I check in macro that target filed has a non-nullable value type? You can type expressions and use IsValueType of type. Also you can use ?? operator instead: (someVar ?? someDefault).GetHashCode()