Prompted by this question about Sneak Attack and Immunities, it seems a character can hit (although for 0 damage) with a weapon which deals damage to which the target is immune.
What would be the result if a Paladin rolled a 20 (with a non-magical slashing weapon), attacking a creature immune to non-magical slashing damage, if the Paladin casts Divine Smite?
Note: I specify a natural 20 in the actual question to avoid discussion about armor class when considering the result.