{"action":"created","issue":{"url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/78","labels_url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/78/comments","events_url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/78/events","html_url":"https://github.com/HPI-SWA-Lab/RSqueak/issues/78","id":85223761,"number":78,"title":"Creating negative-sized collections should fail","user":{"login":"matthias-springer","id":2033320,"avatar_url":"https://avatars.githubusercontent.com/u/2033320?v=3","gravatar_id":"","url":"https://api.github.com/users/matthias-springer","html_url":"https://github.com/matthias-springer","followers_url":"https://api.github.com/users/matthias-springer/followers","following_url":"https://api.github.com/users/matthias-springer/following{/other_user}","gists_url":"https://api.github.com/users/matthias-springer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-springer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-springer/subscriptions","organizations_url":"https://api.github.com/users/matthias-springer/orgs","repos_url":"https://api.github.com/users/matthias-springer/repos","events_url":"https://api.github.com/users/matthias-springer/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-springer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"matthias-springer","id":2033320,"avatar_url":"https://avatars.githubusercontent.com/u/2033320?v=3","gravatar_id":"","url":"https://api.github.com/users/matthias-springer","html_url":"https://github.com/matthias-springer","followers_url":"https://api.github.com/users/matthias-springer/followers","following_url":"https://api.github.com/users/matthias-springer/following{/other_user}","gists_url":"https://api.github.com/users/matthias-springer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-springer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-springer/subscriptions","organizations_url":"https://api.github.com/users/matthias-springer/orgs","repos_url":"https://api.github.com/users/matthias-springer/repos","events_url":"https://api.github.com/users/matthias-springer/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-springer/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-06-04T18:44:01Z","updated_at":"2015-06-09T13:29:42Z","closed_at":null,"body":"This should fail: `WordArray new: -2`.\r\n\r\nThis is the corresponding primitive code:\r\n```python\r\n@expose_primitive(NEW_WITH_ARG, unwrap_spec=[object, int])\r\ndef func(interp, s_frame, w_cls, size):\r\n    w_cls = assert_pointers(w_cls)\r\n    s_class = w_cls.as_class_get_shadow(interp.space)\r\n    if not s_class.isvariable() and size != 0:\r\n        raise PrimitiveFailedError()\r\n    try:\r\n        return s_class.new(size)\r\n    except MemoryError:\r\n        raise PrimitiveFailedError\r\n```\r\n\r\nIt is unclear to me why we have the check `size != 0`. Would it be OK to ensure that `size >= 0` regardless of whether it is a variableSubclass?"},"comment":{"url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/comments/110357489","html_url":"https://github.com/HPI-SWA-Lab/RSqueak/issues/78#issuecomment-110357489","issue_url":"https://api.github.com/repos/HPI-SWA-Lab/RSqueak/issues/78","id":110357489,"user":{"login":"matthias-springer","id":2033320,"avatar_url":"https://avatars.githubusercontent.com/u/2033320?v=3","gravatar_id":"","url":"https://api.github.com/users/matthias-springer","html_url":"https://github.com/matthias-springer","followers_url":"https://api.github.com/users/matthias-springer/followers","following_url":"https://api.github.com/users/matthias-springer/following{/other_user}","gists_url":"https://api.github.com/users/matthias-springer/gists{/gist_id}","starred_url":"https://api.github.com/users/matthias-springer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthias-springer/subscriptions","organizations_url":"https://api.github.com/users/matthias-springer/orgs","repos_url":"https://api.github.com/users/matthias-springer/repos","events_url":"https://api.github.com/users/matthias-springer/events{/privacy}","received_events_url":"https://api.github.com/users/matthias-springer/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T13:29:42Z","updated_at":"2015-06-09T13:29:42Z","body":"The comment talks about \"indexable\" classes. I guess that's different from variable classes?\r\n\r\nAlso this works in COG: `ArrayedCollection new: 0` and `ArrayedCollection` is not a variable subclass."}}