{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/Tweaks/issues/84","labels_url":"https://api.github.com/repos/facebook/Tweaks/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/facebook/Tweaks/issues/84/comments","events_url":"https://api.github.com/repos/facebook/Tweaks/issues/84/events","html_url":"https://github.com/facebook/Tweaks/issues/84","id":75515552,"number":84,"title":"bad receiver type 'const char *' when compiling ObjC++","user":{"login":"itsthejb","id":557391,"avatar_url":"https://avatars.githubusercontent.com/u/557391?v=3","gravatar_id":"","url":"https://api.github.com/users/itsthejb","html_url":"https://github.com/itsthejb","followers_url":"https://api.github.com/users/itsthejb/followers","following_url":"https://api.github.com/users/itsthejb/following{/other_user}","gists_url":"https://api.github.com/users/itsthejb/gists{/gist_id}","starred_url":"https://api.github.com/users/itsthejb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsthejb/subscriptions","organizations_url":"https://api.github.com/users/itsthejb/orgs","repos_url":"https://api.github.com/users/itsthejb/repos","events_url":"https://api.github.com/users/itsthejb/events{/privacy}","received_events_url":"https://api.github.com/users/itsthejb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T08:25:14Z","updated_at":"2015-07-01T01:12:26Z","closed_at":null,"body":"Hi guys,\r\n\r\nSo, I'm writing a Tweak for an animation curve in an ObjC++ file (ComponentKit :wink:), using the dictionary method. It's basically this:\r\n\r\n```\r\n[FBTweakValue(@\"a\", @\"b\", @\"c\",\r\n\t\t\t\t  @(UIViewAnimationOptionCurveEaseInOut),\r\n\t\t\t\t  (@{\r\n\t\t\t\t\t @(UIViewAnimationOptionCurveEaseInOut) : @\"Ease In-Out\",\r\n\t\t\t\t\t @(UIViewAnimationOptionCurveEaseIn) : @\"Ease In\",\r\n\t\t\t\t\t @(UIViewAnimationOptionCurveEaseOut) : @\"Ease Out\",\r\n\t\t\t\t\t @(UIViewAnimationOptionCurveLinear) : @\"Linear\"\r\n\t\t\t\t\t })) unsignedIntegerValue]\r\n```\r\n\r\nHowever, this won't compile in an ObjC++ file with the following error:\r\n\r\n```\r\n<redacted>: error: bad receiver type 'const char *'\r\n                FBTweakAnimationCurve(@\"foo\", @\"Bar\", @\"Cheese\");\r\n                ^\r\nIn file included from <built-in>:351:\r\nIn file included from <command line>:26:\r\nIn file included from <redacted>:\r\n<redacted>:18:2: note: expanded from macro 'FBTweakAnimationCurve'\r\n[FBTweakValue(category_, collection_, name_, \\\r\n ^\r\nIn file included from <built-in>:351:\r\nIn file included from <command line>:26:\r\nIn file included from  <redacted>:39:\r\nIn file included from  <redacted>:10:\r\n <redacted>/Headers/Public/Tweaks/FBTweakInline.h:38:58: note: expanded from macro 'FBTweakValue'\r\n#define FBTweakValue(category_, collection_, name_, ...) _FBTweakValue(category_, collection_, name_, __VA_ARGS__)\r\n                                                         ^\r\nIn file included from <built-in>:351:\r\nIn file included from <command line>:26:\r\nIn file included from  <redacted>:39:\r\nIn file included from  <redacted>:10:\r\nIn file included from  <redacted>/Headers/Public/Tweaks/FBTweakInline.h:10:\r\n <redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:159:127: note: expanded from macro '_FBTweakValue'\r\n#define _FBTweakValue(category_, collection_, name_, ...) _FBTweakDispatch(_FBTweakValueWithoutRange, _FBTweakValueWithRange, _FBTweakValueWithPossible, __VA_ARGS__)(category_, collection_, name_, __VA_ARGS__)\r\n                                                                                                                              ^\r\n <redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:67:174: note: expanded from macro '_FBTweakDispatch'\r\n#define _FBTweakDispatch(__withoutRange, __withRange, __withPossible, ...) __FBTweakConcat(__FBTweakDispatch, __FBTweakIndexCount(__VA_ARGS__))(__withoutRange, __withRange, __withPossible)\r\n                                                                                                                                                                             ^\r\n <redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:65:78: note: expanded from macro '__FBTweakDispatch2'\r\n#define __FBTweakDispatch2(__withoutRange, __withRange, __withPossible, ...) __withPossible\r\n                                                                             ^\r\n <redacted>/Headers/Public/Tweaks/FBTweakInlineInternal.h:154:87: note: expanded from macro '_FBTweakValueWithPossible'\r\n#define _FBTweakValueWithPossible(category_, collection_, name_, default_, possible_) \\\r\n                                                                                      ^\r\n1 error generated.\r\n```\r\n\r\nIt's possible to test this by pasting the macro into a plain ObjC file, then changing the type to ObjC++ or renaming to `.mm`. Since this works, I'm fairly sure this isn't my error...?\r\n\r\nOf course, it's possible to work around this by returning the value from a function in an `.h/.m` helper pair, but raising here in case this is something that could be fixed.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/facebook/Tweaks/issues/comments/117383978","html_url":"https://github.com/facebook/Tweaks/issues/84#issuecomment-117383978","issue_url":"https://api.github.com/repos/facebook/Tweaks/issues/84","id":117383978,"user":{"login":"ashoemaker","id":685147,"avatar_url":"https://avatars.githubusercontent.com/u/685147?v=3","gravatar_id":"","url":"https://api.github.com/users/ashoemaker","html_url":"https://github.com/ashoemaker","followers_url":"https://api.github.com/users/ashoemaker/followers","following_url":"https://api.github.com/users/ashoemaker/following{/other_user}","gists_url":"https://api.github.com/users/ashoemaker/gists{/gist_id}","starred_url":"https://api.github.com/users/ashoemaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashoemaker/subscriptions","organizations_url":"https://api.github.com/users/ashoemaker/orgs","repos_url":"https://api.github.com/users/ashoemaker/repos","events_url":"https://api.github.com/users/ashoemaker/events{/privacy}","received_events_url":"https://api.github.com/users/ashoemaker/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T01:12:26Z","updated_at":"2015-07-01T01:12:26Z","body":":+1: "}}