GitHub PullRequestReviewCommentEvent at 2014-08-12 17:45:54
Repository: TypeScript
Actor: JsonFreeman
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/16129566","id":16129566,"diff_hunk":"@@ -3711,11 +3780,11 @@ module ts {\n         }\r\n \r\n         function getDeclarationKindFromSymbol(s: Symbol) {\r\n-            return s.flags & SymbolFlags.Prototype ? SyntaxKind.Property : s.valueDeclaration.kind;\r\n+            return s.valueDeclaration ? s.valueDeclaration.kind : SyntaxKind.Property;\r","path":"src/compiler/checker.ts","position":254,"original_position":244,"commit_id":"3b1dbadb88b8d30c741c4a1cf482e46a64dfb5cc","original_commit_id":"5b255243c995baaff5a4011238034925be4acce9","user":{"login":"JsonFreeman","id":8052525,"avatar_url":"https://avatars.githubusercontent.com/u/8052525?v=2","gravatar_id":"861d215ba1bf64bf4d78bd15dd9dfd30","url":"https://api.github.com/users/JsonFreeman","html_url":"https://github.com/JsonFreeman","followers_url":"https://api.github.com/users/JsonFreeman/followers","following_url":"https://api.github.com/users/JsonFreeman/following{/other_user}","gists_url":"https://api.github.com/users/JsonFreeman/gists{/gist_id}","starred_url":"https://api.github.com/users/JsonFreeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JsonFreeman/subscriptions","organizations_url":"https://api.github.com/users/JsonFreeman/orgs","repos_url":"https://api.github.com/users/JsonFreeman/repos","events_url":"https://api.github.com/users/JsonFreeman/events{/privacy}","received_events_url":"https://api.github.com/users/JsonFreeman/received_events","type":"User","site_admin":false},"body":"Definitely agree with Cyrus here","created_at":"2014-08-12T17:45:54Z","updated_at":"2014-08-12T17:45:54Z","html_url":"https://github.com/Microsoft/TypeScript/pull/428#discussion_r16129566","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/16129566"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/428#discussion_r16129566"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428","id":19623356,"html_url":"https://github.com/Microsoft/TypeScript/pull/428","diff_url":"https://github.com/Microsoft/TypeScript/pull/428.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/428.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/428","number":428,"state":"open","title":"Adding support for tuple types (e.g. [number, string])","user":{"login":"ahejlsberg","id":4226954,"avatar_url":"https://avatars.githubusercontent.com/u/4226954?v=2","gravatar_id":"822469a87883aae8493f4579c2641bc6","url":"https://api.github.com/users/ahejlsberg","html_url":"https://github.com/ahejlsberg","followers_url":"https://api.github.com/users/ahejlsberg/followers","following_url":"https://api.github.com/users/ahejlsberg/following{/other_user}","gists_url":"https://api.github.com/users/ahejlsberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ahejlsberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahejlsberg/subscriptions","organizations_url":"https://api.github.com/users/ahejlsberg/orgs","repos_url":"https://api.github.com/users/ahejlsberg/repos","events_url":"https://api.github.com/users/ahejlsberg/events{/privacy}","received_events_url":"https://api.github.com/users/ahejlsberg/received_events","type":"User","site_admin":false},"body":"This commit adds support for typle types. A tuple type is written as a comma separated sequence of types enclosed in square brackets:\r\n```typescript\r\n[T0, T1, ... , Tn]\r\n```\r\nA tuple type corresponds to an object type that extends `Array<T>`, where `T` is the best common type of the tuple element types, with a sequence of numerically named members:\r\n```typescript\r\n{\r\n    0: T0;\r\n    1: T1;\r\n    ...\r\n    n: Tn;\r\n}\r\n```\r\nWhen an array literal is contextually typed by a tuple type, each of the array literal expressions are contextually typed by the corresponding tuple element type, and the result is a tuple type:\r\n```typescript\r\nvar t: [number, string] = [1, \"hello\"];\r\nt = [];                 // Error\r\nt = [1];                // Error\r\nt = [2, \"test\"];        // Ok\r\nt = [\"test\", 2];        // Error\r\nt = [2, \"test\", true];  // Ok\r\n```\r\nWhen a value of a tuple type is indexed with a numeric constant, the resulting type is that of the corresponding type element. For example:\r\n```typescript\r\nvar x: [number, string] = [1, \"hello\"];\r\nvar x0 = x[0];  // Type number\r\nvar x1 = x[1];  // Type string\r\nvar x2 = x[2];  // Type {}\r\n```\r\nA tuple type is assignable to a compatible array type. For example:\r\n```typescript\r\nvar a1: number[];\r\nvar a2: {}[];\r\nvar t1: [number, string];\r\nvar t2: [number, number];\r\na1 = t1;  // Error\r\na1 = t2;  // Ok\r\na2 = t1;  // Ok\r\na2 = t2;  // Ok\r\n```\r\nType inference works as expected for tuple types:\r\n```typescript\r\nfunction tuple2<T0, T1>(item0: T0, item1: T1): [T0, T1] {\r\n    return [item0, item1];\r\n}\r\nvar t = tuple2(\"test\", true);\r\nvar t0 = t[0];  // string\r\nvar t1 = t[1];  // boolean\r\n```\r\nNext step is to support EcmaScript 6 style destructuring of objects, arrays, and tuples.","created_at":"2014-08-11T19:54:13Z","updated_at":"2014-08-12T17:45:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6587176855b0e8455129594ad55e6de83c283f9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/428/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/3b1dbadb88b8d30c741c4a1cf482e46a64dfb5cc","head":{"label":"Microsoft:tupleTypes","ref":"tupleTypes","sha":"3b1dbadb88b8d30c741c4a1cf482e46a64dfb5cc","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-08-12T17:41:08Z","pushed_at":"2014-08-12T05:57:37Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":55088,"stargazers_count":1883,"watchers_count":1883,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":116,"mirror_url":null,"open_issues_count":185,"forks":116,"open_issues":185,"watchers":1883,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"851e3358cee1b91cc02243320be8848d711032e5","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-08-12T17:41:08Z","pushed_at":"2014-08-12T05:57:37Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":55088,"stargazers_count":1883,"watchers_count":1883,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":116,"mirror_url":null,"open_issues_count":185,"forks":116,"open_issues":185,"watchers":1883,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/428"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/428"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/428/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/428/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/3b1dbadb88b8d30c741c4a1cf482e46a64dfb5cc"}}}}