Possible answer to the Heaven Hell Door riddle

There is a fairly common riddle

You're standing between the door to heaven and the door to hell. A guard stands by each door. One guard always tells the truth, and the other always lies. You don't know which guard is which. What one question can you ask a guard to find out which door leads to heaven?

I came up with

Are you capable of speaking the statement 'This is the door to heaven'

Does this work?

For reference the standard answer to this riddle is

Which door would the other guard say goes to heaven?

Seems like this depends on what "capable" is taken to mean. Suppose you're talking to the lying guard.

He might consider

that he isn't capable of saying "This is the door to heaven", because that's a true statement and he never tells the truth. So the truthful answer to your question would be no, and he'll say yes.

Or he might consider

that he is capable of saying that, even though he would never say it if you asked him about this particular door. So the truthful answer to your question would be yes, and he'll say no.

But it's not hard to patch this loophole and get something like

If I asked you whether this is the door to heaven, would you say yes?

and that is in fact another "standard" solution to the puzzle.

• I see, so the basic premise answer is fine but it does snag on what you consider to be the meaning of 'capable'. However, we can reduce that particular answer to the one you stated above, which is loophole free? – ManavM Mar 11 at 14:06
• That's how it seems to me. (Well, nothing is ever completely loophole-free. But as loophole-free as it's reasonable to ask for.) – Gareth McCaughan Mar 11 at 14:14
• I see...thanks a lot for the explanation :) – ManavM Mar 11 at 14:22