Of course, even if the filler cap attachment tells you the car is diesel, it still doesn't prevent you from using the wrong pump. I have once or twice met up with those pumps which advised you that the pump was diesel. Frankly, I think they were a good idea, and should have been widely implemented for all fuel types.
The argument that they aren't used because (some?) drivers thought they insulted ones intelligence, if true, is a daft opinion. Anyone, no matter how intelligent, can have a lapse of concentration when selecting a pump.
I did it (once!) at the end of a long drive to go on holiday. Fortunately, I didn't start the engine, and had the car taken by Green flag to where we were staying, and the owner of the camping site helped me to clean out the tank.
I was lucky; it could have cost me dear.