{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/15384","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/15384/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/15384/comments","events_url":"https://api.github.com/repos/golang/go/issues/15384/events","html_url":"https://github.com/golang/go/issues/15384","id":149748795,"number":15384,"title":"spec: conversion of constant string to []byte not allowed by spec but accepted by the compiler","user":{"login":"cznic","id":729580,"avatar_url":"https://avatars.githubusercontent.com/u/729580?v=3","gravatar_id":"","url":"https://api.github.com/users/cznic","html_url":"https://github.com/cznic","followers_url":"https://api.github.com/users/cznic/followers","following_url":"https://api.github.com/users/cznic/following{/other_user}","gists_url":"https://api.github.com/users/cznic/gists{/gist_id}","starred_url":"https://api.github.com/users/cznic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cznic/subscriptions","organizations_url":"https://api.github.com/users/cznic/orgs","repos_url":"https://api.github.com/users/cznic/repos","events_url":"https://api.github.com/users/cznic/events{/privacy}","received_events_url":"https://api.github.com/users/cznic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1328,"closed_issues":362,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2016-04-20T12:55:43Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":1,"created_at":"2016-04-20T12:04:22Z","updated_at":"2016-04-20T13:08:19Z","closed_at":null,"body":"The specs might be missing a piece of information(?).\r\n\r\nIn [Conversions](http://tip.golang.org/ref/spec#Conversions):\r\n> A constant value x can be converted to type T in any of these cases:\r\n>\r\n> - x is representable by a value of type T.\r\n> - x is a floating-point constant, T is a floating-point type, and x is representable by a value of type T after rounding using IEEE 754 round-to-even rules, but with an IEEE -0.0 further rounded to an unsigned 0.0. The constant T(x) is the rounded value.\r\n> - x is an integer constant and T is a string type. The same rule as for non-constant x applies in this case.\r\n\r\nThe compiler [accepts](http://play.golang.org/p/dWk9Bsaj5M) conversions like `[]byte(\"foo\")`. The converted expression in this case *is* a 'constant value', but it's none of the above quoted legal cases.\r\n\r\nFTR: Later on the section says:\r\n\r\n> A non-constant value x can be converted to type T in any of these cases:\r\n> ...\r\n>  - x is a string and T is a slice of bytes or runes.\r\n\r\nHowever, `\"foo\"` is not a 'non-constant value'."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/212416672","html_url":"https://github.com/golang/go/issues/15384#issuecomment-212416672","issue_url":"https://api.github.com/repos/golang/go/issues/15384","id":212416672,"user":{"login":"davecheney","id":7171,"avatar_url":"https://avatars.githubusercontent.com/u/7171?v=3","gravatar_id":"","url":"https://api.github.com/users/davecheney","html_url":"https://github.com/davecheney","followers_url":"https://api.github.com/users/davecheney/followers","following_url":"https://api.github.com/users/davecheney/following{/other_user}","gists_url":"https://api.github.com/users/davecheney/gists{/gist_id}","starred_url":"https://api.github.com/users/davecheney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecheney/subscriptions","organizations_url":"https://api.github.com/users/davecheney/orgs","repos_url":"https://api.github.com/users/davecheney/repos","events_url":"https://api.github.com/users/davecheney/events{/privacy}","received_events_url":"https://api.github.com/users/davecheney/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T13:08:19Z","updated_at":"2016-04-20T13:08:19Z","body":"> The converted expression in this case is a 'constant value',\r\n\r\nI'm not sure that is true, http://play.golang.org/p/Cj7sRWifuf. Maybe I misunderstood."}}