{"action":"created","issue":{"url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/32","repository_url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen","labels_url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/32/comments","events_url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/32/events","html_url":"https://github.com/kornilova-l/scala-native-bindgen/issues/32","id":329146587,"node_id":"MDU6SXNzdWUzMjkxNDY1ODc=","number":32,"title":"Replace scala native imports with explicit references","user":{"login":"jonas","id":8417,"node_id":"MDQ6VXNlcjg0MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8417?v=4","gravatar_id":"","url":"https://api.github.com/users/jonas","html_url":"https://github.com/jonas","followers_url":"https://api.github.com/users/jonas/followers","following_url":"https://api.github.com/users/jonas/following{/other_user}","gists_url":"https://api.github.com/users/jonas/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas/subscriptions","organizations_url":"https://api.github.com/users/jonas/orgs","repos_url":"https://api.github.com/users/jonas/repos","events_url":"https://api.github.com/users/jonas/events{/privacy}","received_events_url":"https://api.github.com/users/jonas/received_events","type":"User","site_admin":false},"labels":[{"id":943335285,"node_id":"MDU6TGFiZWw5NDMzMzUyODU=","url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-04T17:23:02Z","updated_at":"2018-06-10T09:22:11Z","closed_at":null,"author_association":"COLLABORATOR","body":"Right now the generated code has these three imports:\r\n\r\n```scala\r\nimport scala.scalanative._\r\nimport scala.scalanative.native._\r\nimport scala.scalanative.native.Nat._\r\n```\r\n\r\nThis may lead to issues if a binding uses the name `native` or one of the natural number symbols like `_1`. In order to avoid such conflicts we need to be more explicit in the generated code, like prefixing everything with `scalanative.native.CInt`.\r\n\r\nAlternatively we need to document limitations of what names are not allowed."},"comment":{"url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/comments/396034175","html_url":"https://github.com/kornilova-l/scala-native-bindgen/issues/32#issuecomment-396034175","issue_url":"https://api.github.com/repos/kornilova-l/scala-native-bindgen/issues/32","id":396034175,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjAzNDE3NQ==","user":{"login":"kornilova-l","id":23450724,"node_id":"MDQ6VXNlcjIzNDUwNzI0","avatar_url":"https://avatars2.githubusercontent.com/u/23450724?v=4","gravatar_id":"","url":"https://api.github.com/users/kornilova-l","html_url":"https://github.com/kornilova-l","followers_url":"https://api.github.com/users/kornilova-l/followers","following_url":"https://api.github.com/users/kornilova-l/following{/other_user}","gists_url":"https://api.github.com/users/kornilova-l/gists{/gist_id}","starred_url":"https://api.github.com/users/kornilova-l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kornilova-l/subscriptions","organizations_url":"https://api.github.com/users/kornilova-l/orgs","repos_url":"https://api.github.com/users/kornilova-l/repos","events_url":"https://api.github.com/users/kornilova-l/events{/privacy}","received_events_url":"https://api.github.com/users/kornilova-l/received_events","type":"User","site_admin":false},"created_at":"2018-06-10T09:22:11Z","updated_at":"2018-06-10T09:22:11Z","author_association":"OWNER","body":"We can use `native.Nat._1` instead of  `_1` :+1:\r\nI do not want to add `scalanative` prefix everywhere because it will make a file less readable.\r\n\r\nLets try to list all the cases that we need to avoid and see whether we can solve them without using `scalanative` prefix:\r\n* lib object cannot be named `native`.\r\n  Here we can use annotation `@name(\"native\")` and rename the object.\r\n* functions cannot be named `native`.\r\n  Again we can use the annotation\r\n\r\nAnything else? Type named `native` seems to work fine.\r\n\r\nAlso I found one problem related to naming\r\nIf a struct field has name `_1`..`_22` then there will be helper method with similar name, but the helper method will be shadowed by the method from `Ptr.scala` which is confusing.\r\nIt seems to be really special case and I am not sure that it is worth spending time"}}
{"actor":{"display_login":"kornilova-l"}}