C++: Fix the XMLParent Constructor.

This commit is contained in:
Geoffrey White
2019-12-16 11:06:40 +00:00
parent a6407f00a7
commit f990634481
2 changed files with 10 additions and 4 deletions

View File

@@ -31,6 +31,12 @@ abstract class XMLLocatable extends @xmllocatable {
* both of which can contain other elements.
*/
class XMLParent extends @xmlparent {
XMLParent() {
// explicitly restrict `this` to be either an `XMLElement` or an `XMLFile`;
// the type `@xmlparent` currently also includes non-XML files
this instanceof @xmlelement or xmlEncoding(this, _)
}
/**
* Gets a printable representation of this XML parent.
* (Intended to be overridden in subclasses.)

View File

@@ -1,4 +1,4 @@
| c.c | library-tests/files/c.c | CFile, MetricFile | C, XMLParent | | |
| files1.cpp | library-tests/files/files1.cpp | CppFile, MetricFile | C++, XMLParent | swap | t |
| files1.h | library-tests/files/files1.h | HeaderFile, MetricFile | XMLParent | swap | |
| files2.cpp | library-tests/files/files2.cpp | CppFile, MetricFile | C++, XMLParent | g | x, y |
| c.c | library-tests/files/c.c | CFile, MetricFile | C | | |
| files1.cpp | library-tests/files/files1.cpp | CppFile, MetricFile | C++ | swap | t |
| files1.h | library-tests/files/files1.h | HeaderFile, MetricFile | | swap | |
| files2.cpp | library-tests/files/files2.cpp | CppFile, MetricFile | C++ | g | x, y |