{"action":"created","issue":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/2159","repository_url":"https://api.github.com/repos/typetools/checker-framework","labels_url":"https://api.github.com/repos/typetools/checker-framework/issues/2159/labels{/name}","comments_url":"https://api.github.com/repos/typetools/checker-framework/issues/2159/comments","events_url":"https://api.github.com/repos/typetools/checker-framework/issues/2159/events","html_url":"https://github.com/typetools/checker-framework/issues/2159","id":358405878,"node_id":"MDU6SXNzdWUzNTg0MDU4Nzg=","number":2159,"title":"Locally created Polymorphic Object incorrectly resolves to default type qualifier.","user":{"login":"t-rasmud","id":13974807,"node_id":"MDQ6VXNlcjEzOTc0ODA3","avatar_url":"https://avatars0.githubusercontent.com/u/13974807?v=4","gravatar_id":"","url":"https://api.github.com/users/t-rasmud","html_url":"https://github.com/t-rasmud","followers_url":"https://api.github.com/users/t-rasmud/followers","following_url":"https://api.github.com/users/t-rasmud/following{/other_user}","gists_url":"https://api.github.com/users/t-rasmud/gists{/gist_id}","starred_url":"https://api.github.com/users/t-rasmud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-rasmud/subscriptions","organizations_url":"https://api.github.com/users/t-rasmud/orgs","repos_url":"https://api.github.com/users/t-rasmud/repos","events_url":"https://api.github.com/users/t-rasmud/events{/privacy}","received_events_url":"https://api.github.com/users/t-rasmud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-09T19:46:14Z","updated_at":"2018-09-11T17:56:12Z","closed_at":null,"author_association":"NONE","body":"When a new polymorphic object is created locally inside a method, the checker framework incorrectly annotates it with the default type in the qualifier hierarchy. Consider the following example which exposes this problem with the tainting checker. \r\n\r\n```\r\nimport org.checkerframework.checker.tainting.qual.*;\r\nclass TestLocalPoly {\r\n    void testPolyTaintedLocal(@PolyTainted Object input){\r\n        @PolyTainted Object local = new @PolyTainted Object();\r\n    }\r\n}\r\n```\r\nWe expect the above code to type check without any errors. But, running the tainting checker on this example (`javac -processor tainting TestLocalPoly.java`) gives the following error:\r\n\r\n```\r\n./checker/tests/determinism/TestLocalPoly.java:14: error: [assignment.type.incompatible] incompatible types in assignment.\r\n        @PolyTainted Object local = new @PolyTainted Object();\r\n                                    ^\r\n  found   : @Tainted Object\r\n  required: @PolyTainted Object\r\n1 error\r\n```\r\nThis shows that the checker framework annotates `new Object` with the default annotation (`@Tainted`) instead of  the desired `@PolyTainted` annotation.\r\n"},"comment":{"url":"https://api.github.com/repos/typetools/checker-framework/issues/comments/420363414","html_url":"https://github.com/typetools/checker-framework/issues/2159#issuecomment-420363414","issue_url":"https://api.github.com/repos/typetools/checker-framework/issues/2159","id":420363414,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDM2MzQxNA==","user":{"login":"mernst","id":121025,"node_id":"MDQ6VXNlcjEyMTAyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/121025?v=4","gravatar_id":"","url":"https://api.github.com/users/mernst","html_url":"https://github.com/mernst","followers_url":"https://api.github.com/users/mernst/followers","following_url":"https://api.github.com/users/mernst/following{/other_user}","gists_url":"https://api.github.com/users/mernst/gists{/gist_id}","starred_url":"https://api.github.com/users/mernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mernst/subscriptions","organizations_url":"https://api.github.com/users/mernst/orgs","repos_url":"https://api.github.com/users/mernst/repos","events_url":"https://api.github.com/users/mernst/events{/privacy}","received_events_url":"https://api.github.com/users/mernst/received_events","type":"User","site_admin":false},"created_at":"2018-09-11T17:56:12Z","updated_at":"2018-09-11T17:56:12Z","author_association":"MEMBER","body":"@t-rasmud Section 2.4.5 of the manual says that these should be the same:\r\n```\r\nnew @PolyTainted Object()\r\n(@PolyTainted Date) new Object()\r\n```\r\nCan you check whether that produces the same problem?  That will help with debugging."}}
{"actor":{"display_login":"mernst"}}