Serializable being inferred instead of String where Modifier is needed

430 views
Skip to first unread message

Stewart Stewart

unread,
Feb 4, 2015, 5:40:04 PM2/4/15
to scal...@googlegroups.com
So, the following results in a type error:

import scalatags.Text.all._
div
(Some("string").getOrElse("string"))

<console>:13: error: type mismatch;
 found   : java.io.Serializable
 required: scalatags.Text.Modifier
 
To get around this, I either have to

div(Some("string").getOrElse[String]("string"))

or

div(Some("string").getOrElse("string"): String)

Is there an easy way to eliminate the need for type anotations? If notcould someone explain to me why?

Stewart Stewart

unread,
May 8, 2015, 3:30:11 AM5/8/15
to scal...@googlegroups.com
For reference, this is discussed in issue#16 in the github. TLDR; there's nothing we can do about it.
Reply all
Reply to author
Forward
0 new messages