{"action":"created","comment":{"url":"https://api.github.com/repos/racket/typed-racket/pulls/comments/69023686","id":69023686,"diff_hunk":"@@ -44,31 +44,49 @@\n   (: b1 : (Boxof Integer))\n   (define b1 (box 42))\n   (define b2 (cast b1 (Boxof String)))\n+  (define b3 (ann b1 BoxTop))\n+  (define b4 (cast b3 (Boxof (U Integer String))))\n   (check-equal? (unbox b1) 42)\n+  (check-equal? (unbox b4) 42)\n   (check-exn #rx\"expected: Integer\\n *given: \\\"hi\\\"\"\n              (λ () (set-box! b2 \"hi\")))\n   (check-equal? (unbox b1) 42\n-                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\"))\n+                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\")\n+  (check-exn #rx\"Attempted to use a higher-order value passed as `Any`\"\n+             (λ () (set-box! b4 \"hello\")))\n+  (check-equal? (unbox b1) 42))\n \n (test-case \"cast on mutable vectors\"\n   (: v1 : (Vectorof Integer))\n   (define v1 (vector 42))\n   (define v2 (cast v1 (Vectorof String)))\n+  (define v3 (ann v1 VectorTop))\n+  (define v4 (cast v3 (Vectorof (U Integer String))))\n   (check-equal? (vector-ref v1 0) 42)\n+  (check-equal? (vector-ref v4 0) 42)\n   (check-exn #rx\"expected: Integer\\n *given: \\\"hi\\\"\"\n              (λ () (vector-set! v2 0 \"hi\")))\n   (check-equal? (vector-ref v1 0) 42\n-                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\"))\n+                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\")\n+  (check-exn #rx\"Attempted to use a higher-order value passed as `Any`\"\n+             (λ () (vector-set! v4 0 \"hello\")))\n+  (check-equal? (vector-ref v1 0) 42))\n \n ;; Struct definitions need to be at the module level for some reason.\n (struct (X) s ([i : X]) #:mutable)\n (test-case \"cast on mutable structs\"\n   (: s1 : (s Integer))\n   (define s1 (s 42))\n   (define s2 (cast s1 (s String)))\n+  (define s3 (ann s1 Any))\n+  (define s4 (cast s3 (s (U Integer String))))\n   (check-equal? (s-i s1) 42)\n+  (check-equal? (s-i s4) 42)\n   (check-exn #rx\"expected: Integer\\n *given: \\\"hi\\\"\"\n              (λ () (set-s-i! s2 \"hi\")))\n   (check-equal? (s-i s1) 42\n-                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\"))\n+                \"if the previous test hadn't errored, this would be \\\"hi\\\" with type Integer\")\n+  (check-exn #rx\"Attempted to use a higher-order value passed as `Any`\"\n+             (λ () (set-s-i! s4 \"hello\")))","path":"typed-racket-test/succeed/cast-mod.rkt","position":51,"original_position":50,"commit_id":"456d225f5bf9ee144f4e008b86b98e1ca5469c78","original_commit_id":"8477bcc3e13b888adbf182a88c62cb868284a71f","user":{"login":"AlexKnauth","id":6600123,"avatar_url":"https://avatars.githubusercontent.com/u/6600123?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKnauth","html_url":"https://github.com/AlexKnauth","followers_url":"https://api.github.com/users/AlexKnauth/followers","following_url":"https://api.github.com/users/AlexKnauth/following{/other_user}","gists_url":"https://api.github.com/users/AlexKnauth/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKnauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKnauth/subscriptions","organizations_url":"https://api.github.com/users/AlexKnauth/orgs","repos_url":"https://api.github.com/users/AlexKnauth/repos","events_url":"https://api.github.com/users/AlexKnauth/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKnauth/received_events","type":"User","site_admin":false},"body":"Yes:\r\n```racket\r\n#lang typed/racket\r\n(struct (X) s ([i : X]) #:mutable)\r\n(: s1 : (s Integer))\r\n(define s1 (s 42))\r\n(define s2 (ann s1 Any))\r\n(define s3 (cast s2 (s (U Integer String))))\r\n(set-s-i! s3 \"unsound!\")\r\n(s-i s1) ; the string \"unsound!\" with the type Integer\r\n```","created_at":"2016-06-29T20:43:12Z","updated_at":"2016-06-29T20:43:12Z","html_url":"https://github.com/racket/typed-racket/pull/377#discussion_r69023686","pull_request_url":"https://api.github.com/repos/racket/typed-racket/pulls/377","_links":{"self":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/comments/69023686"},"html":{"href":"https://github.com/racket/typed-racket/pull/377#discussion_r69023686"},"pull_request":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/377"}}},"pull_request":{"url":"https://api.github.com/repos/racket/typed-racket/pulls/377","id":75219263,"html_url":"https://github.com/racket/typed-racket/pull/377","diff_url":"https://github.com/racket/typed-racket/pull/377.diff","patch_url":"https://github.com/racket/typed-racket/pull/377.patch","issue_url":"https://api.github.com/repos/racket/typed-racket/issues/377","number":377,"state":"open","locked":false,"title":"add (and/c vector? any-wrap/c) -like contracts","user":{"login":"AlexKnauth","id":6600123,"avatar_url":"https://avatars.githubusercontent.com/u/6600123?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKnauth","html_url":"https://github.com/AlexKnauth","followers_url":"https://api.github.com/users/AlexKnauth/followers","following_url":"https://api.github.com/users/AlexKnauth/following{/other_user}","gists_url":"https://api.github.com/users/AlexKnauth/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKnauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKnauth/subscriptions","organizations_url":"https://api.github.com/users/AlexKnauth/orgs","repos_url":"https://api.github.com/users/AlexKnauth/repos","events_url":"https://api.github.com/users/AlexKnauth/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKnauth/received_events","type":"User","site_admin":false},"body":"For `VectorTop`, `HashTableTop`, etc. going from typed to untyped.\r\n\r\nThis fixes examples like\r\n```racket\r\n#lang typed/racket\r\n(define v (ann (vector 1) VectorTop))\r\n(cast v Any)\r\n```\r\nTo generate `(and/c vector? any-wrap/c)` contracts instead of raising a compile-time contract-generation error. This reduces some of the backwards-incompatibility from the `cast` soundness fix.\r\n\r\nThis fixes some of the problems in https://github.com/racket/typed-racket/issues/375, although parts of ~~both measures-with-dimensions and~~ `wrap` are still failing for other reasons.","created_at":"2016-06-26T02:02:05Z","updated_at":"2016-06-29T20:43:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d71719c7645639078a2e51f37397f0a81218defe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/racket/typed-racket/pulls/377/commits","review_comments_url":"https://api.github.com/repos/racket/typed-racket/pulls/377/comments","review_comment_url":"https://api.github.com/repos/racket/typed-racket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/racket/typed-racket/issues/377/comments","statuses_url":"https://api.github.com/repos/racket/typed-racket/statuses/456d225f5bf9ee144f4e008b86b98e1ca5469c78","head":{"label":"AlexKnauth:vector-top-etc-contract","ref":"vector-top-etc-contract","sha":"456d225f5bf9ee144f4e008b86b98e1ca5469c78","user":{"login":"AlexKnauth","id":6600123,"avatar_url":"https://avatars.githubusercontent.com/u/6600123?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKnauth","html_url":"https://github.com/AlexKnauth","followers_url":"https://api.github.com/users/AlexKnauth/followers","following_url":"https://api.github.com/users/AlexKnauth/following{/other_user}","gists_url":"https://api.github.com/users/AlexKnauth/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKnauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKnauth/subscriptions","organizations_url":"https://api.github.com/users/AlexKnauth/orgs","repos_url":"https://api.github.com/users/AlexKnauth/repos","events_url":"https://api.github.com/users/AlexKnauth/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKnauth/received_events","type":"User","site_admin":false},"repo":{"id":29779436,"name":"typed-racket","full_name":"AlexKnauth/typed-racket","owner":{"login":"AlexKnauth","id":6600123,"avatar_url":"https://avatars.githubusercontent.com/u/6600123?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexKnauth","html_url":"https://github.com/AlexKnauth","followers_url":"https://api.github.com/users/AlexKnauth/followers","following_url":"https://api.github.com/users/AlexKnauth/following{/other_user}","gists_url":"https://api.github.com/users/AlexKnauth/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKnauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKnauth/subscriptions","organizations_url":"https://api.github.com/users/AlexKnauth/orgs","repos_url":"https://api.github.com/users/AlexKnauth/repos","events_url":"https://api.github.com/users/AlexKnauth/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKnauth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexKnauth/typed-racket","description":null,"fork":true,"url":"https://api.github.com/repos/AlexKnauth/typed-racket","forks_url":"https://api.github.com/repos/AlexKnauth/typed-racket/forks","keys_url":"https://api.github.com/repos/AlexKnauth/typed-racket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexKnauth/typed-racket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexKnauth/typed-racket/teams","hooks_url":"https://api.github.com/repos/AlexKnauth/typed-racket/hooks","issue_events_url":"https://api.github.com/repos/AlexKnauth/typed-racket/issues/events{/number}","events_url":"https://api.github.com/repos/AlexKnauth/typed-racket/events","assignees_url":"https://api.github.com/repos/AlexKnauth/typed-racket/assignees{/user}","branches_url":"https://api.github.com/repos/AlexKnauth/typed-racket/branches{/branch}","tags_url":"https://api.github.com/repos/AlexKnauth/typed-racket/tags","blobs_url":"https://api.github.com/repos/AlexKnauth/typed-racket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexKnauth/typed-racket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexKnauth/typed-racket/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexKnauth/typed-racket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexKnauth/typed-racket/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexKnauth/typed-racket/languages","stargazers_url":"https://api.github.com/repos/AlexKnauth/typed-racket/stargazers","contributors_url":"https://api.github.com/repos/AlexKnauth/typed-racket/contributors","subscribers_url":"https://api.github.com/repos/AlexKnauth/typed-racket/subscribers","subscription_url":"https://api.github.com/repos/AlexKnauth/typed-racket/subscription","commits_url":"https://api.github.com/repos/AlexKnauth/typed-racket/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexKnauth/typed-racket/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexKnauth/typed-racket/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexKnauth/typed-racket/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexKnauth/typed-racket/contents/{+path}","compare_url":"https://api.github.com/repos/AlexKnauth/typed-racket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexKnauth/typed-racket/merges","archive_url":"https://api.github.com/repos/AlexKnauth/typed-racket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexKnauth/typed-racket/downloads","issues_url":"https://api.github.com/repos/AlexKnauth/typed-racket/issues{/number}","pulls_url":"https://api.github.com/repos/AlexKnauth/typed-racket/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexKnauth/typed-racket/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexKnauth/typed-racket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexKnauth/typed-racket/labels{/name}","releases_url":"https://api.github.com/repos/AlexKnauth/typed-racket/releases{/id}","deployments_url":"https://api.github.com/repos/AlexKnauth/typed-racket/deployments","created_at":"2015-01-24T14:41:25Z","updated_at":"2016-01-30T00:40:58Z","pushed_at":"2016-06-29T20:40:07Z","git_url":"git://github.com/AlexKnauth/typed-racket.git","ssh_url":"git@github.com:AlexKnauth/typed-racket.git","clone_url":"https://github.com/AlexKnauth/typed-racket.git","svn_url":"https://github.com/AlexKnauth/typed-racket","homepage":null,"size":6795,"stargazers_count":0,"watchers_count":0,"language":"Racket","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":"racket:master","ref":"master","sha":"a10fd9ef45a3fd2bd9b1b5955ec3d39b2d751851","user":{"login":"racket","id":232371,"avatar_url":"https://avatars.githubusercontent.com/u/232371?v=3","gravatar_id":"","url":"https://api.github.com/users/racket","html_url":"https://github.com/racket","followers_url":"https://api.github.com/users/racket/followers","following_url":"https://api.github.com/users/racket/following{/other_user}","gists_url":"https://api.github.com/users/racket/gists{/gist_id}","starred_url":"https://api.github.com/users/racket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racket/subscriptions","organizations_url":"https://api.github.com/users/racket/orgs","repos_url":"https://api.github.com/users/racket/repos","events_url":"https://api.github.com/users/racket/events{/privacy}","received_events_url":"https://api.github.com/users/racket/received_events","type":"Organization","site_admin":false},"repo":{"id":27412259,"name":"typed-racket","full_name":"racket/typed-racket","owner":{"login":"racket","id":232371,"avatar_url":"https://avatars.githubusercontent.com/u/232371?v=3","gravatar_id":"","url":"https://api.github.com/users/racket","html_url":"https://github.com/racket","followers_url":"https://api.github.com/users/racket/followers","following_url":"https://api.github.com/users/racket/following{/other_user}","gists_url":"https://api.github.com/users/racket/gists{/gist_id}","starred_url":"https://api.github.com/users/racket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racket/subscriptions","organizations_url":"https://api.github.com/users/racket/orgs","repos_url":"https://api.github.com/users/racket/repos","events_url":"https://api.github.com/users/racket/events{/privacy}","received_events_url":"https://api.github.com/users/racket/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/racket/typed-racket","description":"Typed Racket","fork":false,"url":"https://api.github.com/repos/racket/typed-racket","forks_url":"https://api.github.com/repos/racket/typed-racket/forks","keys_url":"https://api.github.com/repos/racket/typed-racket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/racket/typed-racket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/racket/typed-racket/teams","hooks_url":"https://api.github.com/repos/racket/typed-racket/hooks","issue_events_url":"https://api.github.com/repos/racket/typed-racket/issues/events{/number}","events_url":"https://api.github.com/repos/racket/typed-racket/events","assignees_url":"https://api.github.com/repos/racket/typed-racket/assignees{/user}","branches_url":"https://api.github.com/repos/racket/typed-racket/branches{/branch}","tags_url":"https://api.github.com/repos/racket/typed-racket/tags","blobs_url":"https://api.github.com/repos/racket/typed-racket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/racket/typed-racket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/racket/typed-racket/git/refs{/sha}","trees_url":"https://api.github.com/repos/racket/typed-racket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/racket/typed-racket/statuses/{sha}","languages_url":"https://api.github.com/repos/racket/typed-racket/languages","stargazers_url":"https://api.github.com/repos/racket/typed-racket/stargazers","contributors_url":"https://api.github.com/repos/racket/typed-racket/contributors","subscribers_url":"https://api.github.com/repos/racket/typed-racket/subscribers","subscription_url":"https://api.github.com/repos/racket/typed-racket/subscription","commits_url":"https://api.github.com/repos/racket/typed-racket/commits{/sha}","git_commits_url":"https://api.github.com/repos/racket/typed-racket/git/commits{/sha}","comments_url":"https://api.github.com/repos/racket/typed-racket/comments{/number}","issue_comment_url":"https://api.github.com/repos/racket/typed-racket/issues/comments{/number}","contents_url":"https://api.github.com/repos/racket/typed-racket/contents/{+path}","compare_url":"https://api.github.com/repos/racket/typed-racket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/racket/typed-racket/merges","archive_url":"https://api.github.com/repos/racket/typed-racket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/racket/typed-racket/downloads","issues_url":"https://api.github.com/repos/racket/typed-racket/issues{/number}","pulls_url":"https://api.github.com/repos/racket/typed-racket/pulls{/number}","milestones_url":"https://api.github.com/repos/racket/typed-racket/milestones{/number}","notifications_url":"https://api.github.com/repos/racket/typed-racket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/racket/typed-racket/labels{/name}","releases_url":"https://api.github.com/repos/racket/typed-racket/releases{/id}","deployments_url":"https://api.github.com/repos/racket/typed-racket/deployments","created_at":"2014-12-02T03:00:29Z","updated_at":"2016-06-23T19:43:26Z","pushed_at":"2016-06-29T20:40:08Z","git_url":"git://github.com/racket/typed-racket.git","ssh_url":"git@github.com:racket/typed-racket.git","clone_url":"https://github.com/racket/typed-racket.git","svn_url":"https://github.com/racket/typed-racket","homepage":"","size":7497,"stargazers_count":83,"watchers_count":83,"language":"Racket","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":115,"forks":28,"open_issues":115,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/377"},"html":{"href":"https://github.com/racket/typed-racket/pull/377"},"issue":{"href":"https://api.github.com/repos/racket/typed-racket/issues/377"},"comments":{"href":"https://api.github.com/repos/racket/typed-racket/issues/377/comments"},"review_comments":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/377/comments"},"review_comment":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/racket/typed-racket/pulls/377/commits"},"statuses":{"href":"https://api.github.com/repos/racket/typed-racket/statuses/456d225f5bf9ee144f4e008b86b98e1ca5469c78"}}}}
{"actor":{"display_login":"AlexKnauth"}}