Take Crobat, for example. It's Poison and Flying. Poison's weakness is Ground, and Flying is invulnerable to Ground attacks. So if a Ground-type attacked Crobat with Earthquake, would it do damage?
No, it would not.