After receiving the update "Ambiguous Implicit Values" Error

I am trying to update my playback app to version 2.3.

I wrote my own html helper:

@(field: play.api.data.Field, options: Seq[(String,String)], args: (Symbol,Any)*)(implicit handler:  views.html.helper.FieldConstructor, lang: play.api.i18n.Lang)

@input(field, args:_*) { (id, name, value, htmlArgs) =>
    @options.map { v =>
        <label class="radio inline">
            <input type="radio" id="@(id)_@v._1" name="@name" value="@v._1" @(if(value == Some(v._1)) "checked" else "") @toHtmlArgs(htmlArgs)> <span>@v._2</span>
        </label>
    }
}

      

The error I am getting:

both implicitJavaLang methods on PlayMagicForJava object of type => play.api.i18n.Lang and lang value of type play.api.i18n.Lang match expected type play.api.i18n.Lang               ambiguous implicit values

I do not understand what the problem is. To remove the implicit language is not an option for me in some html helpers. Also I don't want lang to be a "real" parameter. I want to take advantage of implicits.

Is there a solution for this?

Any help would be great :)

Thank you in advance

+3


source to share


2 answers


you can safely remove the implicit lang parameter because Play 2.3 already has one in its implicit context.



+2


source


Parameters - either remove where the implicit language is declared (check the import, it may import play.core.j.PlayMagicForJava._

exist), or explicitly pass the value. Implicit arguments in the second argument list can still be passed explicitly.



0


source







All Articles