import compilation error upgrading from play 2.5.14 to play 2.6.7

18 views
Skip to first unread message

Gary Malouf

unread,
Nov 9, 2017, 9:48:12 AM11/9/17
to Play Framework
I've scoured the migration docs and examples trying to find an explanation, but have failed thus far.  We have a few form helper files we generate internally in a parent play project that get used across multiple sub-projects that are not compiling under play 2.6.7.

Example:

checkboxFormHelper.scala.html

@(elements: helper.FieldElements)

<div class="form-group checkbox-group @if(elements.hasErrors) {error}">
@elements.input
<label for="@elements.id" class="checkbox">@elements.label</label>
<span class="errors">@elements.errors.mkString(", ")</span>
</div>


Compilation Error:

[error] /Users/gary/coriander/app/com/offerlogic/coriander/infrastructure/display/checkboxFormHelper.scala.html:1: Unused import

[error] @(elements: helper.FieldElements)


This error is repeated for other template files - not really sure what changed to cause this.

Gary Malouf

unread,
Nov 9, 2017, 10:02:36 AM11/9/17
to Play Framework
Removing the scalac option '-Xfatal-warnings’ lets compilation pass, but I’m still unclear why these are now considered unused imports when that was not an issue in play 2.5

Gary Malouf

unread,
Nov 9, 2017, 2:20:11 PM11/9/17
to Play Framework
From further research - this issue appears with scala 2.12.2 (and onward).  Disabling -Xlint is what finally gets rid of the errors - though I feel pretty icky about it.
Reply all
Reply to author
Forward
0 new messages