Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Particle.publish with integer should fail #1194

monkbroc opened this issue Dec 2, 2016 · 1 comment


Copy link

commented Dec 2, 2016

Particle.publish should only accept String data and error out when another data type is passed.

int value = 10;
Particle.publish("test", value);

This code compiles when it shouldn't because the int value is passed to the PublishFlag constructor and used in this overloaded method:
inline bool publish(const char *eventName, PublishFlag eventType=PUBLIC)

The solution would be to prohibit implicit calls to the PublishFlag constructor. This should just be the explicit keyword right? Quick fix, but I don't currently have the time to try it out. Sorry.


  • Minimum test case added
  • Device, system and user firmware versions stated (0.6.0)

@suda suda added the bug label Dec 8, 2016

@technobly technobly added this to the 0.7.0 milestone Jan 17, 2017

@sergeuz sergeuz referenced this issue Jan 20, 2017
5 of 7 tasks complete

This comment has been minimized.

Copy link

commented Jul 7, 2017

Fixed by #1236, #1315, released in 0.7.0-rc.1

@avtolstoy avtolstoy closed this Jul 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.