{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/hil/pulls/comments/91867195","pull_request_review_id":12376649,"id":91867195,"diff_hunk":"@@ -94,7 +94,7 @@ func InterfaceToVariable(input interface{}) (ast.Variable, error) {\n \t\t}\n \n \t\treturn ast.Variable{\n-\t\t\tType:  ast.TypeList,\n+\t\t\tType:  ast.TypeList{ast.TypeAny},","path":"convert.go","position":14,"original_position":14,"commit_id":"b36d0f0aed4b6582ddb8a2caee202af18a03a27b","original_commit_id":"b36d0f0aed4b6582ddb8a2caee202af18a03a27b","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"body":"This function is used heavily in Terraform for converting user input and decoded state values into `ast.Variable`.","created_at":"2016-12-11T22:25:54Z","updated_at":"2016-12-11T22:25:55Z","html_url":"https://github.com/hashicorp/hil/pull/42#discussion_r91867195","pull_request_url":"https://api.github.com/repos/hashicorp/hil/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/comments/91867195"},"html":{"href":"https://github.com/hashicorp/hil/pull/42#discussion_r91867195"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/hil/pulls/42","id":97444998,"html_url":"https://github.com/hashicorp/hil/pull/42","diff_url":"https://github.com/hashicorp/hil/pull/42.diff","patch_url":"https://github.com/hashicorp/hil/pull/42.patch","issue_url":"https://api.github.com/repos/hashicorp/hil/issues/42","number":42,"state":"open","locked":false,"title":"Type system to support list and map element types","user":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"body":"---\r\n\r\n**THIS IS A BREAKING CHANGE**\r\n\r\n---\r\n\r\nThus far the HIL type system has been able to represent lists and maps as if they were primitive types, with no means to represent the *element* types of these composites. This is problematic for accurately type checking an expression that applies the indexing operator `[ ... ]` to an expression whose value isn't known:\r\n\r\n* `somefunc()[0]` - can't know what element type `somefunc` will return until it is executed\r\n* `somevar[0][1]` - this was actually checkable before but not supported by the parser\r\n\r\nThis set of changes retools the HIL type system so that it can capture the element types of lists and maps, thus allowing static type checking of indexing when applied to non-variable expressions. It also adjusts the parser to treat indexing as a standalone operator rather than as a part of variable parsing.\r\n\r\nThe new Go types representing HIL types are carefully designed so that the convenience of being able to compare HIL types using Go `==` is preserved, and so for most cases this is not a breaking change for callers that directly refer to only the primitive types. However, since the representation of list and map types has changed, this *is* a breaking change for callers that directly refer to `ast.TypeList` and `ast.TypeMap` as if they are values, since they are now types.\r\n\r\nIt is also, more subtly, a breaking change for callers that are not able to provide accurate element type information for lists and maps. Callers must be adjusted to correctly specify the element type, or else evaluation is likely to crash on an invalid type assertion.\r\n\r\nThe full changeset for this PR is rather noisy due to all the updates to convert `TypeList` and `TypeMap` references to be struct literals rather than mere identifiers; the individual commits will likely be easier to follow. `ast/type.go` is probably where a reviewer would want to start, to see how the type system is now represented.\r\n","created_at":"2016-12-11T01:42:26Z","updated_at":"2016-12-11T22:25:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"618deaf1b08a60deb8273a188b48797c6e69e87c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/hil/pulls/42/commits","review_comments_url":"https://api.github.com/repos/hashicorp/hil/pulls/42/comments","review_comment_url":"https://api.github.com/repos/hashicorp/hil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/hil/issues/42/comments","statuses_url":"https://api.github.com/repos/hashicorp/hil/statuses/b36d0f0aed4b6582ddb8a2caee202af18a03a27b","head":{"label":"apparentlymart:composite-types","ref":"composite-types","sha":"b36d0f0aed4b6582ddb8a2caee202af18a03a27b","user":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"repo":{"id":72964643,"name":"hil","full_name":"apparentlymart/hil","owner":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apparentlymart/hil","description":"HIL is a small embedded language for string interpolations.","fork":true,"url":"https://api.github.com/repos/apparentlymart/hil","forks_url":"https://api.github.com/repos/apparentlymart/hil/forks","keys_url":"https://api.github.com/repos/apparentlymart/hil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apparentlymart/hil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apparentlymart/hil/teams","hooks_url":"https://api.github.com/repos/apparentlymart/hil/hooks","issue_events_url":"https://api.github.com/repos/apparentlymart/hil/issues/events{/number}","events_url":"https://api.github.com/repos/apparentlymart/hil/events","assignees_url":"https://api.github.com/repos/apparentlymart/hil/assignees{/user}","branches_url":"https://api.github.com/repos/apparentlymart/hil/branches{/branch}","tags_url":"https://api.github.com/repos/apparentlymart/hil/tags","blobs_url":"https://api.github.com/repos/apparentlymart/hil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apparentlymart/hil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apparentlymart/hil/git/refs{/sha}","trees_url":"https://api.github.com/repos/apparentlymart/hil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apparentlymart/hil/statuses/{sha}","languages_url":"https://api.github.com/repos/apparentlymart/hil/languages","stargazers_url":"https://api.github.com/repos/apparentlymart/hil/stargazers","contributors_url":"https://api.github.com/repos/apparentlymart/hil/contributors","subscribers_url":"https://api.github.com/repos/apparentlymart/hil/subscribers","subscription_url":"https://api.github.com/repos/apparentlymart/hil/subscription","commits_url":"https://api.github.com/repos/apparentlymart/hil/commits{/sha}","git_commits_url":"https://api.github.com/repos/apparentlymart/hil/git/commits{/sha}","comments_url":"https://api.github.com/repos/apparentlymart/hil/comments{/number}","issue_comment_url":"https://api.github.com/repos/apparentlymart/hil/issues/comments{/number}","contents_url":"https://api.github.com/repos/apparentlymart/hil/contents/{+path}","compare_url":"https://api.github.com/repos/apparentlymart/hil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apparentlymart/hil/merges","archive_url":"https://api.github.com/repos/apparentlymart/hil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apparentlymart/hil/downloads","issues_url":"https://api.github.com/repos/apparentlymart/hil/issues{/number}","pulls_url":"https://api.github.com/repos/apparentlymart/hil/pulls{/number}","milestones_url":"https://api.github.com/repos/apparentlymart/hil/milestones{/number}","notifications_url":"https://api.github.com/repos/apparentlymart/hil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apparentlymart/hil/labels{/name}","releases_url":"https://api.github.com/repos/apparentlymart/hil/releases{/id}","deployments_url":"https://api.github.com/repos/apparentlymart/hil/deployments","created_at":"2016-11-06T02:04:25Z","updated_at":"2016-11-11T21:13:19Z","pushed_at":"2016-12-11T01:32:22Z","git_url":"git://github.com/apparentlymart/hil.git","ssh_url":"git@github.com:apparentlymart/hil.git","clone_url":"https://github.com/apparentlymart/hil.git","svn_url":"https://github.com/apparentlymart/hil","homepage":"","size":201,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"543808c44b249df579868afe2cc0692a02bf0478","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":50733765,"name":"hil","full_name":"hashicorp/hil","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/hil","description":"HIL is a small embedded language for string interpolations.","fork":false,"url":"https://api.github.com/repos/hashicorp/hil","forks_url":"https://api.github.com/repos/hashicorp/hil/forks","keys_url":"https://api.github.com/repos/hashicorp/hil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/hil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/hil/teams","hooks_url":"https://api.github.com/repos/hashicorp/hil/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/hil/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/hil/events","assignees_url":"https://api.github.com/repos/hashicorp/hil/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/hil/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/hil/tags","blobs_url":"https://api.github.com/repos/hashicorp/hil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/hil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/hil/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/hil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/hil/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/hil/languages","stargazers_url":"https://api.github.com/repos/hashicorp/hil/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/hil/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/hil/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/hil/subscription","commits_url":"https://api.github.com/repos/hashicorp/hil/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/hil/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/hil/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/hil/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/hil/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/hil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/hil/merges","archive_url":"https://api.github.com/repos/hashicorp/hil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/hil/downloads","issues_url":"https://api.github.com/repos/hashicorp/hil/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/hil/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/hil/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/hil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/hil/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/hil/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/hil/deployments","created_at":"2016-01-30T16:42:44Z","updated_at":"2016-12-11T14:10:09Z","pushed_at":"2016-12-11T01:42:27Z","git_url":"git://github.com/hashicorp/hil.git","ssh_url":"git@github.com:hashicorp/hil.git","clone_url":"https://github.com/hashicorp/hil.git","svn_url":"https://github.com/hashicorp/hil","homepage":"","size":185,"stargazers_count":169,"watchers_count":169,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":4,"forks":15,"open_issues":4,"watchers":169,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/42"},"html":{"href":"https://github.com/hashicorp/hil/pull/42"},"issue":{"href":"https://api.github.com/repos/hashicorp/hil/issues/42"},"comments":{"href":"https://api.github.com/repos/hashicorp/hil/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/hil/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/hil/statuses/b36d0f0aed4b6582ddb8a2caee202af18a03a27b"}}}}
{"actor":{"display_login":"mitchellh"}}