[source]

compiler/basicTypes/FieldLabel.hs

Note [Why selector names include data constructors]

[note link]

As explained above, a selector name includes the name of the first data constructor in the type, so that the same label can appear multiple times in the same module. (This is irrespective of whether the first constructor has that field, for simplicity.)

We use a data constructor name, rather than the type constructor name, because data family instances do not have a representation type constructor name generated until relatively late in the typechecking process.

Of course, datatypes with no constructors cannot have any fields.