{"action":"created","issue":{"url":"https://api.github.com/repos/QuantStack/xtensor/issues/1248","repository_url":"https://api.github.com/repos/QuantStack/xtensor","labels_url":"https://api.github.com/repos/QuantStack/xtensor/issues/1248/labels{/name}","comments_url":"https://api.github.com/repos/QuantStack/xtensor/issues/1248/comments","events_url":"https://api.github.com/repos/QuantStack/xtensor/issues/1248/events","html_url":"https://github.com/QuantStack/xtensor/issues/1248","id":380902520,"node_id":"MDU6SXNzdWUzODA5MDI1MjA=","number":1248,"title":"Invalid assignment to xt::view of xt::view","user":{"login":"potpath","id":8481150,"node_id":"MDQ6VXNlcjg0ODExNTA=","avatar_url":"https://avatars1.githubusercontent.com/u/8481150?v=4","gravatar_id":"","url":"https://api.github.com/users/potpath","html_url":"https://github.com/potpath","followers_url":"https://api.github.com/users/potpath/followers","following_url":"https://api.github.com/users/potpath/following{/other_user}","gists_url":"https://api.github.com/users/potpath/gists{/gist_id}","starred_url":"https://api.github.com/users/potpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/potpath/subscriptions","organizations_url":"https://api.github.com/users/potpath/orgs","repos_url":"https://api.github.com/users/potpath/repos","events_url":"https://api.github.com/users/potpath/events{/privacy}","received_events_url":"https://api.github.com/users/potpath/received_events","type":"User","site_admin":false},"labels":[{"id":471671004,"node_id":"MDU6TGFiZWw0NzE2NzEwMDQ=","url":"https://api.github.com/repos/QuantStack/xtensor/labels/Bug","name":"Bug","color":"ee0701","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-14T21:51:29Z","updated_at":"2018-11-14T23:43:04Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This only happens if the first index is not `0`.\r\n\r\n```c++\r\n#include <iostream>\r\n\r\n#include \"xtensor/xarray.hpp\"\r\n#include \"xtensor/xio.hpp\"\r\n#include \"xtensor/xview.hpp\"\r\n\r\nint main()\r\n{\r\n        xt::xarray<double> arr\r\n          {{0., 1., 2.},\r\n           {3., 4., 5.},\r\n           {6., 7., 8.}};\r\n\r\n        std::cout << xt::view(arr, 1, 0) << '\\n';  // 3, ok\r\n        std::cout << xt::view(xt::view(arr, 1), 0) << '\\n';  // 3, ok\r\n\r\n        xt::view(arr, 1, 0) = -1;\r\n        std::cout << xt::view(arr, 1, 0) << '\\n';  // -1, ok\r\n\r\n        xt::view(xt::view(arr, 1), 0) = -2;\r\n        std::cout << xt::view(xt::view(arr, 1), 0) << '\\n';  // -1, expected -2\r\n\r\n        std::cout << arr << '\\n';  // -2 is assigned to arr[2, 0] instead of arr[1, 0]\r\n        /* {{ 0.,  1.,  2.},\r\n         * {-1.,  4.,  5.},\r\n         * {-2.,  7.,  8.}}\r\n         */\r\n\r\n\r\n        // No problem if the first index is 0\r\n        xt::view(arr, 0, 1) = -3;\r\n        std::cout << xt::view(arr, 0, 1) << '\\n';  // -3, ok\r\n\r\n        xt::view(xt::view(arr, 0), 1) = -4;\r\n        std::cout << xt::view(xt::view(arr, 0), 1) << '\\n';  // -4, ok\r\n\r\n        std::cout << arr << '\\n';  // ok\r\n        /*{{ 0., -4.,  2.},\r\n         * {-1.,  4.,  5.},\r\n         * {-2.,  7.,  8.}}\r\n         */\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/QuantStack/xtensor/issues/comments/438860745","html_url":"https://github.com/QuantStack/xtensor/issues/1248#issuecomment-438860745","issue_url":"https://api.github.com/repos/QuantStack/xtensor/issues/1248","id":438860745,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODg2MDc0NQ==","user":{"login":"SylvainCorlay","id":2397974,"node_id":"MDQ6VXNlcjIzOTc5NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2397974?v=4","gravatar_id":"","url":"https://api.github.com/users/SylvainCorlay","html_url":"https://github.com/SylvainCorlay","followers_url":"https://api.github.com/users/SylvainCorlay/followers","following_url":"https://api.github.com/users/SylvainCorlay/following{/other_user}","gists_url":"https://api.github.com/users/SylvainCorlay/gists{/gist_id}","starred_url":"https://api.github.com/users/SylvainCorlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SylvainCorlay/subscriptions","organizations_url":"https://api.github.com/users/SylvainCorlay/orgs","repos_url":"https://api.github.com/users/SylvainCorlay/repos","events_url":"https://api.github.com/users/SylvainCorlay/events{/privacy}","received_events_url":"https://api.github.com/users/SylvainCorlay/received_events","type":"User","site_admin":false},"created_at":"2018-11-14T23:43:04Z","updated_at":"2018-11-14T23:43:04Z","author_association":"MEMBER","body":"Thanks @potpath for reporting. PR is open. Will merge soon, just in time for tomorrow's planned release."}}
{"actor":{"display_login":"SylvainCorlay"}}