{"action":"created","issue":{"url":"https://api.github.com/repos/josefs/Gradualizer/issues/7","repository_url":"https://api.github.com/repos/josefs/Gradualizer","labels_url":"https://api.github.com/repos/josefs/Gradualizer/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/josefs/Gradualizer/issues/7/comments","events_url":"https://api.github.com/repos/josefs/Gradualizer/issues/7/events","html_url":"https://github.com/josefs/Gradualizer/issues/7","id":329417887,"node_id":"MDU6SXNzdWUzMjk0MTc4ODc=","number":7,"title":"ability to use with Elixir-compiled BEAM files","user":{"login":"tim2CF","id":33688567,"node_id":"MDQ6VXNlcjMzNjg4NTY3","avatar_url":"https://avatars1.githubusercontent.com/u/33688567?v=4","gravatar_id":"","url":"https://api.github.com/users/tim2CF","html_url":"https://github.com/tim2CF","followers_url":"https://api.github.com/users/tim2CF/followers","following_url":"https://api.github.com/users/tim2CF/following{/other_user}","gists_url":"https://api.github.com/users/tim2CF/gists{/gist_id}","starred_url":"https://api.github.com/users/tim2CF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim2CF/subscriptions","organizations_url":"https://api.github.com/users/tim2CF/orgs","repos_url":"https://api.github.com/users/tim2CF/repos","events_url":"https://api.github.com/users/tim2CF/events{/privacy}","received_events_url":"https://api.github.com/users/tim2CF/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-05T11:40:40Z","updated_at":"2018-06-06T08:01:51Z","closed_at":null,"author_association":"NONE","body":"Currently I'm investigating ability of using of this tool to analyze Elixir-compiled BEAM bytecode.\r\nBEAM files compiled with Elixir compiler can be decompiled back to Erlang AST/source code.\r\nExample: this file \r\n\r\nhttps://github.com/coingaming/hm-crypto/blob/17dcf434c75e88506304343aafa9b63106d576a9/lib/hm_crypto/public_key.ex\r\n\r\nCan be decompiled back to \r\n\r\n```\r\n-file(\"/Users/timcf/HTprojects/hm-crypto/lib/hm_cryp\"\r\n      \"to/public_key.ex\",\r\n      1).\r\n\r\n-module('Elixir.HmCrypto.PublicKey').\r\n\r\n-compile(no_auto_import).\r\n\r\n-spec parse_pem(rsa_key()) -> tuple().\r\n\r\n-export_type([rsa_key/0]).\r\n\r\n-type rsa_key() :: binary() | tuple().\r\n\r\n-export(['__info__'/1, parse_pem/1]).\r\n\r\n-spec '__info__'(attributes | compile | functions |\r\n                 macros | md5 | module | deprecated) -> any().\r\n\r\n'__info__'(module) -> 'Elixir.HmCrypto.PublicKey';\r\n'__info__'(functions) -> [{parse_pem, 1}];\r\n'__info__'(macros) -> [];\r\n'__info__'(attributes) ->\r\n    erlang:get_module_info('Elixir.HmCrypto.PublicKey',\r\n                           attributes);\r\n'__info__'(compile) ->\r\n    erlang:get_module_info('Elixir.HmCrypto.PublicKey',\r\n                           compile);\r\n'__info__'(md5) ->\r\n    erlang:get_module_info('Elixir.HmCrypto.PublicKey',\r\n                           md5);\r\n'__info__'(deprecated) -> [].\r\n\r\nparse_pem(Vpem_string@1)\r\n    when erlang:is_binary(Vpem_string@1) andalso\r\n           Vpem_string@1 /= <<>> ->\r\n    [Vpem_entry@1] = public_key:pem_decode(Vpem_string@1),\r\n    public_key:pem_entry_decode(Vpem_entry@1);\r\nparse_pem(Vpem@1) when erlang:is_tuple(Vpem@1) ->\r\n    Vpem@1.\r\n```\r\n\r\nWhen I'm trying to apply Gradualizer to this file, first thing I get is error\r\n\r\n```\r\nThe atom 'Elixir.HmCrypto.PublicKey' on line 24 does not have type Module\r\n```\r\n\r\nI'm not expert in pure Erlang standards, but isn't this atom a valid module name? If I run `erl` shell with loaded BEAM files of application - it works without any issues as module name:\r\n\r\n```\r\nEshell V9.3.1  (abort with ^G)\r\n1> 'Elixir.HmCrypto.PublicKey':parse_pem({hello, world}).\r\n{hello,world}\r\n2>\r\n```\r\nAny ideas about it?"},"comment":{"url":"https://api.github.com/repos/josefs/Gradualizer/issues/comments/394978862","html_url":"https://github.com/josefs/Gradualizer/issues/7#issuecomment-394978862","issue_url":"https://api.github.com/repos/josefs/Gradualizer/issues/7","id":394978862,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDk3ODg2Mg==","user":{"login":"tim2CF","id":33688567,"node_id":"MDQ6VXNlcjMzNjg4NTY3","avatar_url":"https://avatars1.githubusercontent.com/u/33688567?v=4","gravatar_id":"","url":"https://api.github.com/users/tim2CF","html_url":"https://github.com/tim2CF","followers_url":"https://api.github.com/users/tim2CF/followers","following_url":"https://api.github.com/users/tim2CF/following{/other_user}","gists_url":"https://api.github.com/users/tim2CF/gists{/gist_id}","starred_url":"https://api.github.com/users/tim2CF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim2CF/subscriptions","organizations_url":"https://api.github.com/users/tim2CF/orgs","repos_url":"https://api.github.com/users/tim2CF/repos","events_url":"https://api.github.com/users/tim2CF/events{/privacy}","received_events_url":"https://api.github.com/users/tim2CF/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T08:01:51Z","updated_at":"2018-06-06T08:01:51Z","author_association":"NONE","body":"thanks!"}}
{"actor":{"display_login":"tim2CF"}}