8000 NodeSeq ++ results in List[Node] in 2.13 · Issue #392 · scala/scala-xml · GitHub
[go: up one dir, main page]

Skip to content
NodeSeq ++ results in List[Node] in 2.13 #392
@fanf

Description

@fanf

I see the following change in behavior between scala 2.12 and 2.13:
Scala 2.12:

scala> import scala.xml._
import scala.xml._

scala> val a: NodeSeq = <a>Hello</a>
a: scala.xml.NodeSeq = <a>Hello</a>

scala> a ++ <b>hi</b>
res0: scala.xml.NodeSeq = NodeSeq(<a>Hello</a>, <b>hi</b>)

Scala 2.13:

scala> a ++ <b>hi</b>
res0: Seq[scala.xml.Node] = List(<a>Hello</a>, <b>hi</b>)

That change has a very deep reach for us, because Liftweb doesn't interpret both type in the same way: it applies template transformation one time for a NodeSeq (it's only one template), and N times for List[Node] (it's a list of template). Our web application is totally broken, and it's almost impossible to find all places which would need a type ascription (and it would bloat a lot the resulting code.

Is there a way to get back the old behavior? Perhaps we are missing a new implicit? Perhaps the implicit precedence in NodeSeq changed and it could be adpated?
Any insight would be appreciated.

< 52B4 /div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0