{"action":"created","issue":{"url":"https://api.github.com/repos/tgingold/ghdl/issues/191","repository_url":"https://api.github.com/repos/tgingold/ghdl","labels_url":"https://api.github.com/repos/tgingold/ghdl/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/tgingold/ghdl/issues/191/comments","events_url":"https://api.github.com/repos/tgingold/ghdl/issues/191/events","html_url":"https://github.com/tgingold/ghdl/issues/191","id":188364563,"number":191,"title":"'others' choice not allowed for an aggregate in this context","user":{"login":"Paebbels","id":956109,"avatar_url":"https://avatars.githubusercontent.com/u/956109?v=3","gravatar_id":"","url":"https://api.github.com/users/Paebbels","html_url":"https://github.com/Paebbels","followers_url":"https://api.github.com/users/Paebbels/followers","following_url":"https://api.github.com/users/Paebbels/following{/other_user}","gists_url":"https://api.github.com/users/Paebbels/gists{/gist_id}","starred_url":"https://api.github.com/users/Paebbels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paebbels/subscriptions","organizations_url":"https://api.github.com/users/Paebbels/orgs","repos_url":"https://api.github.com/users/Paebbels/repos","events_url":"https://api.github.com/users/Paebbels/events{/privacy}","received_events_url":"https://api.github.com/users/Paebbels/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-09T22:05:33Z","updated_at":"2016-11-10T04:10:49Z","closed_at":null,"body":"Sorry for writing so many issues tonight :).\r\n\r\nI have this code snippet:\r\n```VHDL\r\nlibrary ieee;\r\nuse      ieee.std_logic_1164.all;\r\n\r\nentity e is\r\nend entity;\r\n\r\narchitecture a of e is\r\n  type t_rec is record\r\n    addr : std_logic_vector;\r\n  end record;\r\n  \r\n  function init_signals(bits : natural) return t_rec is\r\n    variable result : t_rec(addr(bits - 1 downto 0));\r\n  begin\r\n    result.addr   := (others => '0');\r\n    -- result.addr   := (result.addr'range => '0');  -- this works\r\n    return result;\r\n  end function;\r\nbegin\r\nend architecture;\r\n```\r\n\r\nI used this command to analyze:\r\n`ghdl.exe -a .\\cant_use_others_here.vhdl`.\r\n\r\nAs expected the error message(s) is:\r\n> .\\cant_use_others_here.vhdl:9:16: element declaration of unconstrained array type \"std_logic_vector\" is not allowed\r\n> .\\cant_use_others_here.vhdl:15:22: 'others' choice not allowed for an aggregate in this context\r\n\r\nSo yes. the used feature is new to VHDL-2008. So let's enable it:\r\n`ghdl.exe -a --std=08 .\\cant_use_others_here.vhdl`\r\n\r\nBut one error message survives:\r\n> .\\cant_use_others_here.vhdl:15:22: 'others' choice not allowed for an aggregate in this context\r\n\r\nIf I change the `others` keyword to `prefix'range` it's accepted.\r\n[cant_use_others_here.txt](https://github.com/tgingold/ghdl/files/581936/cant_use_others_here.txt)\r\n\r\nSee the attached file for more details and code variations."},"comment":{"url":"https://api.github.com/repos/tgingold/ghdl/issues/comments/259597520","html_url":"https://github.com/tgingold/ghdl/issues/191#issuecomment-259597520","issue_url":"https://api.github.com/repos/tgingold/ghdl/issues/191","id":259597520,"user":{"login":"Paebbels","id":956109,"avatar_url":"https://avatars.githubusercontent.com/u/956109?v=3","gravatar_id":"","url":"https://api.github.com/users/Paebbels","html_url":"https://github.com/Paebbels","followers_url":"https://api.github.com/users/Paebbels/followers","following_url":"https://api.github.com/users/Paebbels/following{/other_user}","gists_url":"https://api.github.com/users/Paebbels/gists{/gist_id}","starred_url":"https://api.github.com/users/Paebbels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Paebbels/subscriptions","organizations_url":"https://api.github.com/users/Paebbels/orgs","repos_url":"https://api.github.com/users/Paebbels/repos","events_url":"https://api.github.com/users/Paebbels/events{/privacy}","received_events_url":"https://api.github.com/users/Paebbels/received_events","type":"User","site_admin":false},"created_at":"2016-11-10T04:10:49Z","updated_at":"2016-11-10T04:10:49Z","body":"OK, but what's the difference between `others` as single keyword and `'range`. It is just the time/phase when the set of zeros is created?\r\n\r\nSo `others` is a keyword and can be used immediately at analysis time and `'range` is an attribute an can be delayed until elaboration time?\r\n"}}
{"actor":{"display_login":"Paebbels"}}