A heart-shaped lollipop is not a confession. The same candy can suggest a crush when it arrives with a personal note, yet feel entirely friendly when it is handed out to a group. The shape supplies a hint, not a verdict, and the person giving it may simply like a cheerful design.
Context does the heavy lifting. A gift exchanged on a romantic occasion, especially alongside an invitation to spend time alone, may carry a different message from candy shared at a party. Your existing relationship matters too: a close friend might use hearts freely, while someone who has been flirting could mean more. Still, none of those signs proves intent. A handwritten message can be affectionate without being romantic, and a shy giver may say very little. Watch the whole exchange, not just the wrapper.
Asking beats guessing. You can keep it light: "That's sweet. Did you mean it as a friendly gift?" If the answer is awkward or uncertain, give the other person room to explain rather than treating the candy as a promise. The same courtesy applies when you are giving one: a short note can make your intention clear without putting pressure on the recipient. And if you received a candy heart, would you ask what it meant?