bsloane1650 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_r301750798
##########
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:
What if the elements have a different primType. At the moment, I believe we
allow for inherentType to be pretty much anything, and just have the compiler
add a cast if needed. Eg. if we have { ../foo + 1 }, where foo is a string
type, I believe we would cast ../foo to some numeric type. We could have a
scenerio where ../foo is a string in one context, but an int in another
context. For a more reasonable example, we might have ../foo have primType
decimal in one context and primType double in another (and, perhaps, primType
float in yet another).
----------------------------------------------------------------
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