{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/playframework/issues/3876","labels_url":"https://api.github.com/repos/playframework/playframework/issues/3876/labels{/name}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/3876/comments","events_url":"https://api.github.com/repos/playframework/playframework/issues/3876/events","html_url":"https://github.com/playframework/playframework/issues/3876","id":56110217,"number":3876,"title":"Defining helpers in html package object leads to NoSuchMethodError","user":{"login":"wsargent","id":71236,"avatar_url":"https://avatars.githubusercontent.com/u/71236?v=3","gravatar_id":"","url":"https://api.github.com/users/wsargent","html_url":"https://github.com/wsargent","followers_url":"https://api.github.com/users/wsargent/followers","following_url":"https://api.github.com/users/wsargent/following{/other_user}","gists_url":"https://api.github.com/users/wsargent/gists{/gist_id}","starred_url":"https://api.github.com/users/wsargent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsargent/subscriptions","organizations_url":"https://api.github.com/users/wsargent/orgs","repos_url":"https://api.github.com/users/wsargent/repos","events_url":"https://api.github.com/users/wsargent/events{/privacy}","received_events_url":"https://api.github.com/users/wsargent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-31T03:15:08Z","updated_at":"2015-02-02T04:39:48Z","closed_at":null,"body":"When defining a helper method in app/views/package.scala\r\n\r\n```\r\npackage views\r\n\r\npackage object html {\r\n  case class PresentationElement(first: String, index: Int, second: String)\r\n\r\n  def helperMethod(list: Seq[String], stringMap: Map[String, String]): Seq[PresentationElement] = {\r\n    val listBuffer = scala.collection.mutable.ListBuffer[PresentationElement]()\r\n    for ((el, index) <- list.view.zipWithIndex) {\r\n      listBuffer += PresentationElement(el, index, stringMap(el))\r\n    }\r\n    listBuffer.toSeq\r\n  }\r\n}\r\n```\r\n\r\nAnd calling it in a page with:\r\n\r\n```\r\n  @defining(List(\"one\", \"two\", \"three\")) { list =>\r\n    @defining(Map(\"one\" -> \"uno\", \"two\" -> \"deux\", \"three\" -> \"tres\")) { stringMap =>\r\n      @for(el:PresentationElement <- helperMethod(list, stringMap)) {\r\n        <p>element @{el.first}, index @{el.index}, second el @{el.second}</p>\r\n      }\r\n    }\r\n  }\r\n```\r\n\r\nThe code will compile fine... but then when running will show the following error message:\r\n\r\n```\r\nplay.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.NoSuchMethodError: views.html.package$.helperMethod(Lscala/collection/Seq;Lscala/collection/immutable/Map;)Lscala/collection/Seq;]]\r\n\tat play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [play_2.11-2.3.7.jar:2.3.7]\r\n\tat scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) [scala-library-2.11.1.jar:na]\r\nCaused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: views.html.package$.helperMethod(Lscala/collection/Seq;Lscala/collection/immutable/Map;)Lscala/collection/Seq;\r\n\tat play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:523) ~[play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) ~[play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:130) ~[play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.utils.Threads$.withContextClassLoader(Threads.scala:21) ~[play_2.11-2.3.7.jar:2.3.7]\r\n\tat play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:129) ~[play_2.11-2.3.7.jar:2.3.7]\r\nCaused by: java.lang.NoSuchMethodError: views.html.package$.helperMethod(Lscala/collection/Seq;Lscala/collection/immutable/Map;)Lscala/collection/Seq;\r\n\tat views.html.index$$anonfun$apply$1$$anonfun$apply$2.apply(index.template.scala:28) ~[classes/:na]\r\n\tat views.html.index$$anonfun$apply$1$$anonfun$apply$2.apply(index.template.scala:27) ~[classes/:na]\r\n\tat play.twirl.api.TemplateMagic$.defining(TemplateMagic.scala:13) ~[twirl-api_2.11-1.0.2.jar:1.0.2]\r\n\tat views.html.index$$anonfun$apply$1.apply(index.template.scala:27) ~[classes/:na]\r\n\tat views.html.index$$anonfun$apply$1.apply(index.template.scala:26) ~[classes/:na]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/playframework/playframework/issues/comments/72405616","html_url":"https://github.com/playframework/playframework/issues/3876#issuecomment-72405616","issue_url":"https://api.github.com/repos/playframework/playframework/issues/3876","id":72405616,"user":{"login":"wsargent","id":71236,"avatar_url":"https://avatars.githubusercontent.com/u/71236?v=3","gravatar_id":"","url":"https://api.github.com/users/wsargent","html_url":"https://github.com/wsargent","followers_url":"https://api.github.com/users/wsargent/followers","following_url":"https://api.github.com/users/wsargent/following{/other_user}","gists_url":"https://api.github.com/users/wsargent/gists{/gist_id}","starred_url":"https://api.github.com/users/wsargent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsargent/subscriptions","organizations_url":"https://api.github.com/users/wsargent/orgs","repos_url":"https://api.github.com/users/wsargent/repos","events_url":"https://api.github.com/users/wsargent/events{/privacy}","received_events_url":"https://api.github.com/users/wsargent/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T04:39:48Z","updated_at":"2015-02-02T04:39:48Z","body":"play-bootstrap3, for example https://github.com/adrianhurt/play-bootstrap3/blob/master/module/app/views/b3/package.scala"}}