{"action":"closed","issue":{"url":"https://api.github.com/repos/alecthomas/participle/issues/62","repository_url":"https://api.github.com/repos/alecthomas/participle","labels_url":"https://api.github.com/repos/alecthomas/participle/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/alecthomas/participle/issues/62/comments","events_url":"https://api.github.com/repos/alecthomas/participle/issues/62/events","html_url":"https://github.com/alecthomas/participle/issues/62","id":452744015,"node_id":"MDU6SXNzdWU0NTI3NDQwMTU=","number":62,"title":"Error parsing into slice of Parseable","user":{"login":"sleepinggenius2","id":24281183,"node_id":"MDQ6VXNlcjI0MjgxMTgz","avatar_url":"https://avatars3.githubusercontent.com/u/24281183?v=4","gravatar_id":"","url":"https://api.github.com/users/sleepinggenius2","html_url":"https://github.com/sleepinggenius2","followers_url":"https://api.github.com/users/sleepinggenius2/followers","following_url":"https://api.github.com/users/sleepinggenius2/following{/other_user}","gists_url":"https://api.github.com/users/sleepinggenius2/gists{/gist_id}","starred_url":"https://api.github.com/users/sleepinggenius2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleepinggenius2/subscriptions","organizations_url":"https://api.github.com/users/sleepinggenius2/orgs","repos_url":"https://api.github.com/users/sleepinggenius2/repos","events_url":"https://api.github.com/users/sleepinggenius2/events{/privacy}","received_events_url":"https://api.github.com/users/sleepinggenius2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-06-05T22:23:22Z","updated_at":"2019-06-08T11:13:21Z","closed_at":"2019-06-08T11:13:21Z","author_association":"CONTRIBUTOR","body":"I've run into an issue trying to parse into a slice of Parseable.\r\n\r\nIn the code below, the checks are against `rt`, but if you change them to `t`, then it works as expected.  I have tested this with a Parseable string type and a Parseable struct type, as well as running the full test suite, and everything passes.  Given the explicit `rt := t` line though, I figured there might be some history to check with you on before submitting a PR.\r\n\r\nhttps://github.com/alecthomas/participle/blob/ed80074ea4ccfd35a6a7d8afd487ad0318faf6b8/grammar.go#L26-L37\r\n\r\n## Test Code\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"strconv\"\r\n\r\n\t\"github.com/alecthomas/participle\"\r\n\t\"github.com/alecthomas/participle/lexer\"\r\n)\r\n\r\ntype Bar struct {\r\n\tA int\r\n}\r\n\r\nfunc (x *Bar) Parse(lex lexer.PeekingLexer) error {\r\n\ttoken, err := lex.Next()\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tx.A, err = strconv.Atoi(token.Value)\r\n\treturn err\r\n}\r\n\r\ntype Foo struct {\r\n\tBars []Bar `parser:\"@@+\"`\r\n}\r\n\r\nfunc main() {\r\n\tfoo := &Foo{}\r\n\tparser := participle.MustBuild(foo)\r\n\r\n\terr := parser.ParseString(\"1 2 3\", foo)\r\n\tfmt.Printf(\"Got error=%v value=%+v\", err, foo)\r\n}\r\n```\r\n\r\n## Results\r\n### Expected\r\n`Got error=<nil> value=&{Bars:[{A:1} {A:2} {A:3}]}`\r\n\r\n### Actual\r\n`panic: Bars: can not parse into empty struct main.Bar`"}}
{"actor":{"display_login":"alecthomas"}}