{"action":"opened","issue":{"url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/194","repository_url":"https://api.github.com/repos/scoverage/sbt-scoverage","labels_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/194/comments","events_url":"https://api.github.com/repos/scoverage/sbt-scoverage/issues/194/events","html_url":"https://github.com/scoverage/sbt-scoverage/issues/194","id":180867354,"number":194,"title":"Scala 2.11 type mismatch with implicit class and parameterless function","user":{"login":"hhomar","id":203584,"avatar_url":"https://avatars.githubusercontent.com/u/203584?v=3","gravatar_id":"","url":"https://api.github.com/users/hhomar","html_url":"https://github.com/hhomar","followers_url":"https://api.github.com/users/hhomar/followers","following_url":"https://api.github.com/users/hhomar/following{/other_user}","gists_url":"https://api.github.com/users/hhomar/gists{/gist_id}","starred_url":"https://api.github.com/users/hhomar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhomar/subscriptions","organizations_url":"https://api.github.com/users/hhomar/orgs","repos_url":"https://api.github.com/users/hhomar/repos","events_url":"https://api.github.com/users/hhomar/events{/privacy}","received_events_url":"https://api.github.com/users/hhomar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-04T11:25:14Z","updated_at":"2016-10-04T11:25:14Z","closed_at":null,"body":"We've recently migrated to Scala 2.11 and noticed that when we run `sbt coverage run`, we would get the following error:\r\n\r\n```\r\n[error]  TestApp.scala:19: type mismatch;\r\n[error]  found   : scala.collection.immutable.Set[Int]\r\n[error]  required: Int\r\n[error]  println(s\"Result: ${Result(5).fun(genMismatch)}\")\r\n```\r\n\r\nWith `sbt run` it would compile and build fine. We managed to reproduce it to a small test case below. Using genMismatch as the parameter to Result.fun will cause the error, but using gen it will compile and execute fine. The issue seems to be not explicitly defining an empty argument list for genMismatch as is the case for gen.\r\n\r\nbuild.sbt:\r\n```\r\nname := \"TestApp\"\r\n//scalaVersion := \"2.10.6\"\r\nscalaVersion := \"2.11.8\"\r\nscalacOptions := Seq(\r\n    \"-deprecation\",\r\n    \"-unchecked\",\r\n    \"-feature\",\r\n    \"-Xlint\",\r\n    \"-language:reflectiveCalls\",\r\n    \"-Xmax-classfile-name\", \"128\"\r\n)\r\n```\r\n\r\nTestApp.scala:\r\n```\r\ncase class Result(x: Int) {\r\n  def toInt = x\r\n  def fun(a: Int) = x + a\r\n}\r\n\r\nobject Helpers {\r\n  implicit class ImplicitResult(x: Result) {\r\n    def fun(s: Set[Int]) = s.toSeq.sum + x.toInt\r\n  }\r\n}\r\n\r\nimport Helpers._\r\n\r\nobject TestApp extends App {\r\n  def gen()(implicit a: Int) = Set(1, 2) + a\r\n  def genMismatch(implicit a: Int) = Set(1, 2) + a // type mismatch\r\n\r\n  implicit val a: Int = 3\r\n  println(s\"Result: ${Result(5).fun(genMismatch)}\") // type mismatch\r\n  //println(s\"Result: ${Result(5).fun(gen)}\")\r\n}\r\n```"}}
{"actor":{"display_login":"hhomar"}}