Wilde's wittiest play, The Importance of Being Earnest, dramatizes the varieties of suspense in courtship and resolves them in the end with a brilliant pun. A British law against homosexuality turned the ending of Wilde's own life into a tragedy.