{"action":"opened","issue":{"url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/745","repository_url":"https://api.github.com/repos/joel-costigliola/assertj-core","labels_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/745/labels{/name}","comments_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/745/comments","events_url":"https://api.github.com/repos/joel-costigliola/assertj-core/issues/745/events","html_url":"https://github.com/joel-costigliola/assertj-core/issues/745","id":172457526,"number":745,"title":"[java8] assertThat is ambiguous for Comparable","user":{"login":"grzechol","id":4052869,"avatar_url":"https://avatars.githubusercontent.com/u/4052869?v=3","gravatar_id":"","url":"https://api.github.com/users/grzechol","html_url":"https://github.com/grzechol","followers_url":"https://api.github.com/users/grzechol/followers","following_url":"https://api.github.com/users/grzechol/following{/other_user}","gists_url":"https://api.github.com/users/grzechol/gists{/gist_id}","starred_url":"https://api.github.com/users/grzechol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grzechol/subscriptions","organizations_url":"https://api.github.com/users/grzechol/orgs","repos_url":"https://api.github.com/users/grzechol/repos","events_url":"https://api.github.com/users/grzechol/events{/privacy}","received_events_url":"https://api.github.com/users/grzechol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T13:51:15Z","updated_at":"2016-08-22T13:51:15Z","closed_at":null,"body":"#### Summary\r\nCustom assertion for class implementing Comparable causes compilation errors under Java 8. This happens only when Comparable class is parametrized.\r\n\r\n#### Example\r\n\r\n```java\r\npublic class MyClass<T> implements Comparable<MyClass<T>> {\r\n    @Override\r\n    public int compareTo(MyClass<T> o) {\r\n        return 0;\r\n    }\r\n}\r\npublic class MyClassAssert extends AbstractAssert<MyClassAssert, MyClass<?>> {\r\n    public MyClassAssert(MyClass<?> actual) {\r\n        super(actual, MyClassAssert.class);\r\n    }\r\n}\r\npublic class MyAssert extends org.assertj.core.api.Assertions {\r\n    public static MyClassAssert assertThat(MyClass<?> myClass) {\r\n        return new MyClassAssert(myClass);\r\n    }\r\n}\r\n\r\nimport static MyAssert.assertThat;\r\npublic class MyClassTest {\r\n    public static void test() {\r\n        assertThat(\"abc\").isEqualTo(\"abc\");\r\n        MyClass<String> myObj = new MyClass<>();\r\n        assertThat(myObj).isEqualTo(myObj);\r\n    }\r\n\r\n```\r\n[ERROR] MyClassTest.java:[6,9] reference to assertThat is ambiguous\r\n[ERROR] both method assertThat(MyClass<?>) in MyAssert and method <T>assertThat(T) in org.assertj.core.api.Assertions match\r\n\r\n#### Java 8 specific ?\r\nYES : create Pull Request from the `master` branch\r\n"}}
{"actor":{"display_login":"grzechol"}}