Dramatic irony is perhaps the primary comedic tool employed by Shakespeare in The Comedy of Errors. There is, throughout the entirety of the play, a significant gap between characters’ understanding of their situation and the audience's understanding of the situation. This gap is emphasized at various points in the text, as characters respond with exasperation or fury to the various misunderstandings and mix-ups that drive the plot. Take, for example, this conversation between Antipholus of Syracuse and Dromio of Syracuse in Act 2, Scene 2:
ANTIPHOLUS OF SYRACUSE
How now, sir? Is your merry humor altered?
As you love strokes, so jest with me again.
You know no Centaur? You received no gold?
Your mistress sent to have me home to dinner?
My house was at the Phoenix? Wast thou mad,
That thus so madly thou didst answer me?DROMIO OF SYRACUSE
What answer, sir? When spake I such a word?
Antipholus of Syracuse is furious about what he perceives to be a prank by his slave, Dromio, who is likewise perplexed at his master’s fury. Unlike the characters, the audience knows that these scenes of disorientation stem from the two sets of twins’ unknown proximity to each other. In this case, it was Dromio of Ephesus who, misidentifying Antipholus of Syracuse for his own master, reported to him that he had never received any gold and recommended that he return home for dinner with his wife. Now, though, Antipholus of Syracuse grills Dromio of Syracuse about why he said such things—but Dromio didn't say these things. The stress and confusion that stems from the characters’ ignorance of this situation is the grounds for much of the play's comedy.
In one of the play’s few soliloquies, Antipholus of Syracuse wonders to himself about the strange and inexplicable friendliness he has encountered in Ephesus:
There’s not a man I meet but doth salute me
As if I were their well-acquainted friend,
And everyone doth call me by my name.
Some tender money to me; some invite me; […]
Sure these are but imaginary wiles,
And Lapland sorcerers inhabit here
In this soliloquy, the audience is given a window into Antipholus’s thoughts and feelings at this point in the play. He cannot believe the warmth and kindness with which he has been received by the Ephesians, who salute him as they would an old friend, invite him into their homes, and even somehow refer to him by his own name without ever having been introduced. Dramatic irony pervades the soliloquy, as the audience understands that the Ephesians greet him with such friendliness because they have misidentified him as his twin brother.
The suspicious Antipholus does not trust this warm welcome, speculating that the friendliness of the Ephesians is a strategy for trapping victims on the island. As of this soliloquy, Antipholus of Syracuse still believes that he is in a city populated by supernatural beings like sorcerers and ghosts who trick humans to wicked ends.
In a speech punctuated with dramatic irony, Dromio of Syracuse entreats Antipholus of Syracuse to stay another night in Ephesus on account of the supposedly kind and gentle nature of the Ephesians. He says:
Faith, stay here this night. They
will surely do us no harm. You saw they speak us
fair, give us gold. Methinks they are such a gentle
nation that, but for the mountain of mad flesh that
claims marriage of me, I could find in my heart to
stay here still, and turn witch
The audience knows what Dromio does not: that the seemingly “giving” nature of the Ephesians stems from a case of mistaken identity. The Ephesians are not, as Dromio of Syracuse here supposes, some sort of supernatural race that grants blessings to travelers, and every “gift” the Syracuse twins receive comes, unbeknownst to them, at the expense of their Ephesus counterparts.
Dromio is so moved by what he misidentifies as generosity that he even claims he could “turn witch,” joining the magical residents of Ephesus in their supernatural pursuits, except for the fact that he is not attracted to the woman who believes herself to be his wife, Luce, whom he describes unflatteringly as a “mountain of mad flesh."