mbeckerle commented on a change in pull request #259: Incremental progress on
schema compilation space/speed issue.
URL: https://github.com/apache/incubator-daffodil/pull/259#discussion_r301868226
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dpath/Expression.scala
##########
@@ -943,155 +950,148 @@ sealed abstract class StepExpression(val step: String,
val pred: Option[Predicat
NodeInfo.ArrayIndex
}
+}
+
+sealed abstract class DownStepExpression(s: String, predArg:
Option[PredicateExpression])
+ extends StepExpression(s, predArg) {
+
override lazy val inherentType: NodeInfo.Kind = {
if (!isLastStep) NodeInfo.Complex
else {
- if (stepElement.optPrimType.isDefined) {
+ if (stepElements.head.optPrimType.isDefined) {
Review comment:
Ah. There are lots of polymorphic possibilities.
fn:count(pathToArray) cares only that the path is to an array, but does not
care if in some cases the path is an array of simple type, another case path is
an array of complex type.
There are functions where only the node matters, not its type. E.g.,
fn:local-name(path) or fn:namespace-uri(path) which work for any node at all.
Or fn:nilled(path) which works for either simple or complex type elements
since both can be nillable.
Also functions dfdl:contentLength(path, units) and dfdl:valueLength(path,
units) are both potentially polymorphic in that they measure size, but don't
care what the thing actually is.
dfdl:checkConstraints(path) works for any simple type element.
fn:exists(node) only cares about the node existing, doesn't care about the
type.
So really to check consistency we have to do this in a function-specific
manner, or we can insist on uniformity even when the functions being used don't
strictly speaking require it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services