In cases where memory is of less of a concern (e.g. small attributes where all instances have to be distinct by definition), using DistinctAttr with a unit attribute is a useful and conscious way of generating deterministic unique IDs.
The syntax as is however, makes them less useful to use, as it 1) always prints <unit> at the back and 2) always aliases them leading to not very useful #distinct = distinct[n]<unit> lines in the printer output.
This patch fixes that by special casing UnitAttr to simply elide the <unit> attribute in the back and not printing it as alias in that case.
getUnitAttr isn't "free", please do this in a else branch