Skip to content

scala.xml.Node toString does not allow extending the Node class #6800

Closed
@scabug

Description

@scabug

With Scala 2.9.2 you could extend a scala.xml.Node and create your own class. When you use toString, the default case would print out the custom Node much like an Elem, since this was the catch all implementation.

Since this commit (see src/library/scala/xml/Utility.scala): scala/scala@e7ea29c

The behavior changed to printing Elem and throwing an exception when it was not one of the known sub-classes of Node.

This means the user can no longer extend the XML hierarchy with his own classes and use toString, since any XML tree that includes custom classes extending Node will throw exceptions on a toString.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions