{"action":"created","issue":{"url":"https://api.github.com/repos/racket/typed-racket/issues/763","repository_url":"https://api.github.com/repos/racket/typed-racket","labels_url":"https://api.github.com/repos/racket/typed-racket/issues/763/labels{/name}","comments_url":"https://api.github.com/repos/racket/typed-racket/issues/763/comments","events_url":"https://api.github.com/repos/racket/typed-racket/issues/763/events","html_url":"https://github.com/racket/typed-racket/issues/763","id":353055994,"node_id":"MDU6SXNzdWUzNTMwNTU5OTQ=","number":763,"title":"Downcasting from Procedure does not seem to work","user":{"login":"lexi-lambda","id":759911,"node_id":"MDQ6VXNlcjc1OTkxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/759911?v=4","gravatar_id":"","url":"https://api.github.com/users/lexi-lambda","html_url":"https://github.com/lexi-lambda","followers_url":"https://api.github.com/users/lexi-lambda/followers","following_url":"https://api.github.com/users/lexi-lambda/following{/other_user}","gists_url":"https://api.github.com/users/lexi-lambda/gists{/gist_id}","starred_url":"https://api.github.com/users/lexi-lambda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexi-lambda/subscriptions","organizations_url":"https://api.github.com/users/lexi-lambda/orgs","repos_url":"https://api.github.com/users/lexi-lambda/repos","events_url":"https://api.github.com/users/lexi-lambda/events{/privacy}","received_events_url":"https://api.github.com/users/lexi-lambda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-22T17:42:50Z","updated_at":"2018-08-22T17:51:52Z","closed_at":null,"author_association":"MEMBER","body":"I think this program should work, but it doesn’t:\r\n\r\n```racket\r\n#lang typed/racket\r\n(define (g [x : Number]) (- x 100))\r\n(define f : Procedure g)\r\n((cast f (-> Number Number)) 50)\r\n```\r\n\r\nInstead, it fails with the following error:\r\n\r\n```racket\r\ng8: arity mismatch;\r\n the expected number of arguments does not match the given number\r\n  given: 1\r\n  arguments...:\r\n   50\r\n```\r\n\r\nThe error occurs both on HEAD and Racket v6.12. I have not tested other versions."},"comment":{"url":"https://api.github.com/repos/racket/typed-racket/issues/comments/415120660","html_url":"https://github.com/racket/typed-racket/issues/763#issuecomment-415120660","issue_url":"https://api.github.com/repos/racket/typed-racket/issues/763","id":415120660,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTEyMDY2MA==","user":{"login":"samth","id":244723,"node_id":"MDQ6VXNlcjI0NDcyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/244723?v=4","gravatar_id":"","url":"https://api.github.com/users/samth","html_url":"https://github.com/samth","followers_url":"https://api.github.com/users/samth/followers","following_url":"https://api.github.com/users/samth/following{/other_user}","gists_url":"https://api.github.com/users/samth/gists{/gist_id}","starred_url":"https://api.github.com/users/samth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samth/subscriptions","organizations_url":"https://api.github.com/users/samth/orgs","repos_url":"https://api.github.com/users/samth/repos","events_url":"https://api.github.com/users/samth/events{/privacy}","received_events_url":"https://api.github.com/users/samth/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T17:51:52Z","updated_at":"2018-08-22T17:51:52Z","author_association":"MEMBER","body":"That program is not intended to work. The `cast` form checks the source as well as the destination type, and the contract for `Procedure` is a function that can never be called. If you change `g` to be `(lambda ([x : String]) (string-length x))` then it's hopefully clearer why this is needed."}}
{"actor":{"display_login":"samth"}}