{"action":"created","issue":{"url":"https://api.github.com/repos/racket/typed-racket/issues/205","labels_url":"https://api.github.com/repos/racket/typed-racket/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/racket/typed-racket/issues/205/comments","events_url":"https://api.github.com/repos/racket/typed-racket/issues/205/events","html_url":"https://github.com/racket/typed-racket/issues/205","id":109187756,"number":205,"title":"Misprediction of predicate on substruct","user":{"login":"samth","id":244723,"avatar_url":"https://avatars.githubusercontent.com/u/244723?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-30T21:57:23Z","updated_at":"2015-10-02T19:06:23Z","closed_at":null,"body":"```\r\n#lang typed/racket #:no-optimize\r\n\r\n(struct (A) foo ([x : A]))\r\n\r\n(struct (A) baz foo ())\r\n\r\n(define (f [i : Integer]) : (foo Integer)\r\n  (baz i))\r\n\r\n(if (baz? (f 1)) 1 2)\r\n```\r\n\r\nBehaves differently under optimization. Reported by Antonio Menezes Leitao on the mailing list."},"comment":{"url":"https://api.github.com/repos/racket/typed-racket/issues/comments/145127849","html_url":"https://github.com/racket/typed-racket/issues/205#issuecomment-145127849","issue_url":"https://api.github.com/repos/racket/typed-racket/issues/205","id":145127849,"user":{"login":"takikawa","id":64192,"avatar_url":"https://avatars.githubusercontent.com/u/64192?v=3","gravatar_id":"","url":"https://api.github.com/users/takikawa","html_url":"https://github.com/takikawa","followers_url":"https://api.github.com/users/takikawa/followers","following_url":"https://api.github.com/users/takikawa/following{/other_user}","gists_url":"https://api.github.com/users/takikawa/gists{/gist_id}","starred_url":"https://api.github.com/users/takikawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takikawa/subscriptions","organizations_url":"https://api.github.com/users/takikawa/orgs","repos_url":"https://api.github.com/users/takikawa/repos","events_url":"https://api.github.com/users/takikawa/events{/privacy}","received_events_url":"https://api.github.com/users/takikawa/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T19:06:23Z","updated_at":"2015-10-02T19:06:23Z","body":"A variation on this program illustrates some unsound behavior (without the TR optimizer on even)\r\n\r\n````\r\n#lang typed/racket #:no-optimize\r\n\r\n(struct (A) foo ([x : A]) #:mutable)\r\n\r\n(struct (A) baz foo ())\r\n\r\n(define (f [i : Integer]) : (foo Integer)\r\n  (baz i))\r\n\r\n(: x (foo Integer))\r\n(define x (f 1))\r\n\r\n(: y Any)\r\n(define y x)\r\n\r\n(if (baz? y) (set-foo-x! y \"foo\") 2)\r\n(foo-x x)\r\n````\r\n\r\nNote that the result doesn't change with the optimizer on."}}