Salty and sweet are distinct tastes which our taste buds are usually able to detect. However, if you add salt to some foods, they do not taste salty, but become sweeter tasting. This is because salt is not just a taste, it is also a taste enhancer.
Bitter and sweet cancel each other out to some degree. Think of
adding sugar to naturally bitter coffee and you get the idea. It
cancels/masks the bitterness. Some people add a bit of salt to the
grounds before making coffee, for the same reason.
Pineapples are sweet, but also have some bitterness to them. If
you neutralize the bitterness, it should taste sweeter. Adding
salt can do this. When salt mixes with the pineapple, the salt
splits up into sodium and chloride ions. The chloride is tasteless
and our tongues ignore it. The sodium bonds with the acids in the
pineapple and forms a similarly tasteless salt, but the bitterness
effectively disappears. What remains is the sweetness of the
pineapple. Add a little bit of salt to your fresh pineapple and
enjoy the enhanced sweetness. It also works with watermelon,
oranges, grapefruit, dark chocolate and other foods that are both
bitter and sweet. Perhaps this is one reason why it is said that
bacon is the food that makes other foods taste better. My father
always salted apples before eating and usually paired with extra
sharp cheddar cheese.
Adding salt works less well with canned or other processed
fruits as many are already artificially sweetened.