diff --git a/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala b/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala index fef41e7a6c..d49e416cd3 100644 --- a/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala +++ b/daffodil-core/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala @@ -297,29 +297,32 @@ object NodeInfo extends Enum { /** * Nothing is the bottom of the type lattice. * - * It is the return type of the dfdlx:error() function. It's a subtype of + * It is the return type of the fn:error() function. It's a subtype of * every type (except some special singletons like ArrayType). */ - lazy val Nothing = new TypeNode( - Seq( - Boolean, - Complex, - Array, - ArrayIndex, - Double, - Float, - Date, - Time, - DateTime, - UnsignedByte, - Byte, - HexBinary, - AnyURI, - String, - NonEmptyString - ), - Nil - ) with Boolean.Kind + protected sealed trait NothingKind extends NodeInfo.Kind + case object Nothing + extends TypeNode( + Seq( + Boolean, + Complex, + Array, + ArrayIndex, + Double, + Float, + Date, + Time, + DateTime, + UnsignedByte, + Byte, + HexBinary, + AnyURI, + String, + NonEmptyString + ), + Nil + ) + with Boolean.Kind with Complex.Kind with Array.Kind with ArrayIndex.Kind @@ -332,7 +335,9 @@ object NodeInfo extends Enum { with Byte.Kind with HexBinary.Kind with NonEmptyString.Kind - with AnyURI.Kind + with AnyURI.Kind { + sealed trait Kind extends NothingKind + } /** * All complex types are represented by this one type object. diff --git a/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc.tdml b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc.tdml index a379d3a3ca..c15cb31188 100644 --- a/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc.tdml +++ b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc.tdml @@ -315,6 +315,15 @@ + + + + + + + + @@ -766,6 +775,26 @@ + + + + + a + + + + + + + Unparse Error + This is the error string + + + + diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala index d6387d96be..a0ec423f76 100644 --- a/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala +++ b/daffodil-test/src/test/scala/org/apache/daffodil/section17/calc_value_properties/TestOutputValueCalc.scala @@ -58,6 +58,7 @@ class TestOutputValueCalc1 extends TdmlTests { @Test def errorOneArg = test @Test def errorTwoArg = test @Test def errorThreeArg = test + @Test def errorInRoundHalfToEven = test // DAFFODIL-1701 @Test def refSimpleTypeElemWithOvc = test