Why do I get a [Some] Object instead of a [String] Object?
The Some object won’t work as a String Parameter in a method call.
The config def returns a String so I expect the type to be String.
But when I type “Hello” Scala get’s it correct.
Code
def config(s: String) = Play.current.configuration.getString(s).toString()
Logger.info(config("recaptcha.publicKey"))
Logger.info("Hello")
Output
[info] application - Some(6LeDMdASAAAAAC4CFIDY-5M7NEZ_WnO0NO9CSdtj)
[info] application - Hello
You are unnecessarily calling
toString()onOption[String](whichPlay.current.configuration.getString()returns), try this:or
maybepreferably: