{"action":"created","issue":{"url":"https://api.github.com/repos/jcoplien/trygve/issues/5","labels_url":"https://api.github.com/repos/jcoplien/trygve/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/jcoplien/trygve/issues/5/comments","events_url":"https://api.github.com/repos/jcoplien/trygve/issues/5/events","html_url":"https://github.com/jcoplien/trygve/issues/5","id":121923270,"number":5,"title":"Should simple types be able to play a Role?","user":{"login":"ciscoheat","id":130450,"avatar_url":"https://avatars.githubusercontent.com/u/130450?v=3","gravatar_id":"","url":"https://api.github.com/users/ciscoheat","html_url":"https://github.com/ciscoheat","followers_url":"https://api.github.com/users/ciscoheat/followers","following_url":"https://api.github.com/users/ciscoheat/following{/other_user}","gists_url":"https://api.github.com/users/ciscoheat/gists{/gist_id}","starred_url":"https://api.github.com/users/ciscoheat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciscoheat/subscriptions","organizations_url":"https://api.github.com/users/ciscoheat/orgs","repos_url":"https://api.github.com/users/ciscoheat/repos","events_url":"https://api.github.com/users/ciscoheat/events{/privacy}","received_events_url":"https://api.github.com/users/ciscoheat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-13T14:44:11Z","updated_at":"2015-12-13T17:53:05Z","closed_at":null,"body":"I started to implement the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) for credit card validation in trygve, and I thought that the last digit in the list of integers should play the role of `CheckDigit`.\r\n\r\nI couldn't make this work though, because of the requirement of a RoleObjectInterface for a Role. So is it a mistake to think that `int`, `double` and `boolean` should play a Role in a Context? Here's how I'm thinking:\r\n\r\n```java\r\ncontext CreditCardValidation {\r\n\trole CheckDigit {\r\n\t\t// Compilation error here if no RoleMethods exists.\r\n\t} requires {\r\n\t\t// How to specify int, if possible (and reasonable)?\r\n\t}\r\n\r\n\tpublic CreditCardValidation(CreditCard cc) {\r\n\t\tCheckDigit = cc.number()[15];\r\n\t}\r\n}\r\n```\r\n\r\nI also get a compilation error if no RoleMethods exist, I'd like to know if that's a bug or feature. :)\r\n"},"comment":{"url":"https://api.github.com/repos/jcoplien/trygve/issues/comments/164281825","html_url":"https://github.com/jcoplien/trygve/issues/5#issuecomment-164281825","issue_url":"https://api.github.com/repos/jcoplien/trygve/issues/5","id":164281825,"user":{"login":"jcoplien","id":7209130,"avatar_url":"https://avatars.githubusercontent.com/u/7209130?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoplien","html_url":"https://github.com/jcoplien","followers_url":"https://api.github.com/users/jcoplien/followers","following_url":"https://api.github.com/users/jcoplien/following{/other_user}","gists_url":"https://api.github.com/users/jcoplien/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoplien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoplien/subscriptions","organizations_url":"https://api.github.com/users/jcoplien/orgs","repos_url":"https://api.github.com/users/jcoplien/repos","events_url":"https://api.github.com/users/jcoplien/events{/privacy}","received_events_url":"https://api.github.com/users/jcoplien/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T17:53:05Z","updated_at":"2015-12-13T17:53:05Z","body":"\n> Den 13/12/2015 kl. 15.44 skrev Andreas <notifications@github.com>:\n> \n> I also get a compilation error if no RoleMethods exist, I'd like to know if that's a bug or feature :)\n\nHmmm. I can maybe think of degenerate cases where a methodless role might be useful. Let me think about it. I can’t think of any harm in allowing it."}}