You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "olabusayoT (via GitHub)" <gi...@apache.org> on 2024/10/10 22:42:02 UTC

[PR] Fix Incorrect Lengths SDEs on Computed Element with LengthKind Implicit [daffodil]

olabusayoT opened a new pull request, #1336:
URL: https://github.com/apache/daffodil/pull/1336

   - add condition that checks for IVC before doing the check
   - add tests
   
   DAFFODIL-2806


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix Incorrect Lengths SDEs on Computed Element with LengthKind Implicit [daffodil]

Posted by "olabusayoT (via GitHub)" <gi...@apache.org>.
olabusayoT merged PR #1336:
URL: https://github.com/apache/daffodil/pull/1336


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix Incorrect Lengths SDEs on Computed Element with LengthKind Implicit [daffodil]

Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence commented on code in PR #1336:
URL: https://github.com/apache/daffodil/pull/1336#discussion_r1797118565


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/dsom/ElementBase.scala:
##########
@@ -1007,13 +1007,19 @@ trait ElementBase
           "The length facet or minLength/maxLength facets are not allowed on types derived from type %s.\nThey are allowed only on types derived from string and hexBinary.",
           pt.name
         )
-        val res = (hasLength, hasMinLength, hasMaxLength, lengthKind) match {
-          case (true, false, false, _) => (r.lengthValue, r.lengthValue)
-          case (true, _, _, _) =>
+        val res = (
+          hasLength,
+          hasMinLength,
+          hasMaxLength,
+          lengthKind,
+          inputValueCalcOption.isDefined

Review Comment:
   It's better to use isRepresented to determine if something is IVC or not.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org