{"action":"closed","issue":{"url":"https://api.github.com/repos/jcoplien/trygve/issues/99","repository_url":"https://api.github.com/repos/jcoplien/trygve","labels_url":"https://api.github.com/repos/jcoplien/trygve/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/jcoplien/trygve/issues/99/comments","events_url":"https://api.github.com/repos/jcoplien/trygve/issues/99/events","html_url":"https://github.com/jcoplien/trygve/issues/99","id":142242574,"number":99,"title":"Role vector silently fails for some out-of-range indexes","user":{"login":"hvaldecantos","id":2617944,"avatar_url":"https://avatars.githubusercontent.com/u/2617944?v=3","gravatar_id":"","url":"https://api.github.com/users/hvaldecantos","html_url":"https://github.com/hvaldecantos","followers_url":"https://api.github.com/users/hvaldecantos/followers","following_url":"https://api.github.com/users/hvaldecantos/following{/other_user}","gists_url":"https://api.github.com/users/hvaldecantos/gists{/gist_id}","starred_url":"https://api.github.com/users/hvaldecantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvaldecantos/subscriptions","organizations_url":"https://api.github.com/users/hvaldecantos/orgs","repos_url":"https://api.github.com/users/hvaldecantos/repos","events_url":"https://api.github.com/users/hvaldecantos/events{/privacy}","received_events_url":"https://api.github.com/users/hvaldecantos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-21T03:07:33Z","updated_at":"2016-03-21T16:28:00Z","closed_at":"2016-03-21T16:28:00Z","body":"It seems that role vectors are not raising \"indexed out-of-range\" runtime exceptions for negative numbers and first upper out-of-range index.\r\n\r\n```trygve\r\ncontext Context {\r\n    public Context() {\r\n        List<String> ls = new List<String>();\r\n        ls.add(\"1\"); ls .add(\"22\"); ls .add(\"333\");\r\n        Listing = ls;\r\n    } \r\n\r\n    role [] Listing {\r\n        public void prints_lengths() {\r\n            // System.out.println(Listing[-2].length()); // silently fails\r\n            // System.out.println(Listing[-1].length()); // silently fails\r\n            System.out.println(Listing[0].length());\r\n            System.out.println(Listing[1].length());\r\n            System.out.println(Listing[2].length());\r\n            System.out.println(Listing[3].length()); // silently fails\r\n            System.out.println(Listing[4].length()); // raises \"out-of-range at index 4\" exception.\r\n        }\r\n    } requires {\r\n        public int length() const;\r\n    }\r\n    public void run() {\r\n        Listing.prints_lengths()\r\n    }\r\n}\r\n{\r\n    Context c1 = new Context()\r\n    c1.run()\r\n    System.out.println(\"End\")\r\n}\r\n```\r\nI ran it using trygve 1.6.13"}}