{"action":"created","issue":{"url":"https://api.github.com/repos/scalatest/scalatest/issues/764","labels_url":"https://api.github.com/repos/scalatest/scalatest/issues/764/labels{/name}","comments_url":"https://api.github.com/repos/scalatest/scalatest/issues/764/comments","events_url":"https://api.github.com/repos/scalatest/scalatest/issues/764/events","html_url":"https://github.com/scalatest/scalatest/issues/764","id":115116984,"number":764,"title":"`thrownBy` results in \"discarded non-Unit value\" warnings","user":{"login":"jawshooah","id":4551271,"avatar_url":"https://avatars.githubusercontent.com/u/4551271?v=3","gravatar_id":"","url":"https://api.github.com/users/jawshooah","html_url":"https://github.com/jawshooah","followers_url":"https://api.github.com/users/jawshooah/followers","following_url":"https://api.github.com/users/jawshooah/following{/other_user}","gists_url":"https://api.github.com/users/jawshooah/gists{/gist_id}","starred_url":"https://api.github.com/users/jawshooah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jawshooah/subscriptions","organizations_url":"https://api.github.com/users/jawshooah/orgs","repos_url":"https://api.github.com/users/jawshooah/repos","events_url":"https://api.github.com/users/jawshooah/events{/privacy}","received_events_url":"https://api.github.com/users/jawshooah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-11-04T18:25:35Z","updated_at":"2015-11-04T22:02:00Z","closed_at":null,"body":"I add `-Ywarn-value-discard` to `scalacOptions` in my projects to help enforce a more explicit and less error-prone coding style.\r\n\r\nUnfortunately, this results in compiler warnings whenever I use the `an [Exception] must be thrownBy { ... }` syntax in my tests. The `thrownBy` method of [ResultOfBeWordForAnType](https://github.com/scalatest/scalatest/blob/release-2.2.4-for-scala-2.11-and-2.10/src/main/scala/org/scalatest/words/ResultOfBeWordForAnType.scala#L38) expects an expression of type `=> Unit` rather than `=> Any`, so in order to suppress these warnings, I have to use syntax like `{ 1 / 0; () }` or `{ val _ = 1 / 0 }`.\r\n\r\nThis could be avoided by changing the method signature of `thrownBy` from `(fun: => Unit): Unit` to `(fun: => Any): Unit`. Interestingly enough, that's exactly the signature of the corresponding method of [ResultOfBeWordForAType](https://github.com/scalatest/scalatest/blob/release-2.2.4-for-scala-2.11-and-2.10/src/main/scala/org/scalatest/words/ResultOfBeWordForAType.scala#L38)."},"comment":{"url":"https://api.github.com/repos/scalatest/scalatest/issues/comments/153882730","html_url":"https://github.com/scalatest/scalatest/issues/764#issuecomment-153882730","issue_url":"https://api.github.com/repos/scalatest/scalatest/issues/764","id":153882730,"user":{"login":"jawshooah","id":4551271,"avatar_url":"https://avatars.githubusercontent.com/u/4551271?v=3","gravatar_id":"","url":"https://api.github.com/users/jawshooah","html_url":"https://github.com/jawshooah","followers_url":"https://api.github.com/users/jawshooah/followers","following_url":"https://api.github.com/users/jawshooah/following{/other_user}","gists_url":"https://api.github.com/users/jawshooah/gists{/gist_id}","starred_url":"https://api.github.com/users/jawshooah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jawshooah/subscriptions","organizations_url":"https://api.github.com/users/jawshooah/orgs","repos_url":"https://api.github.com/users/jawshooah/repos","events_url":"https://api.github.com/users/jawshooah/events{/privacy}","received_events_url":"https://api.github.com/users/jawshooah/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T22:02:00Z","updated_at":"2015-11-04T22:02:00Z","body":"> I think we could make a ScalaTest+Play release.\r\n\r\nAwesome! Will there be a release for Play 2.3.x in addition to 2.4.x? I haven't yet done the refactoring necessary to upgrade.\r\n\r\n> Do you use any other style than WordSpec?\r\n\r\nNot at the moment."}}