[
https://issues.apache.org/jira/browse/DAFFODIL-2065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Josh Adams resolved DAFFODIL-2065.
----------------------------------
Resolution: Fixed
Assignee: Dave Thompson (was: Josh Adams)
Fix Version/s: 2.4.0
This has been fixed in commit 316ba512719b033b67590a6c7320f68ab566d9e6
> Incorrectly attempting to cast signed to unsigned type
> ------------------------------------------------------
>
> Key: DAFFODIL-2065
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2065
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 2.2.0
> Environment: Ubuntu 18.04.1 LTS
> Reporter: Brandon Sloane
> Assignee: Dave Thompson
> Priority: Major
> Fix For: 2.4.0
>
> Attachments: test.dfdl.xsd
>
>
> When adding a signed and unsigned type, Daffodil attempts to cast the signed
> value to unsigned. The correct behaviour would be to cast the unsigned to
> signed.
> When running the attached schema on an empty file, the following error is
> produced:
> {quote}[error] Schema Definition Error: Cannot convert '-1' from Long type to
> UnsignedInt (Negative value -1 cannot be converted to an unsigned int.).
> Schema context: element reference tns:x Location line 3 in
> file:/home/bsloane/Documents/incubator-daffodil/test/test.dfdl.xsd
> The relevent piece of schema is:
> <xs:element name="x" type="xs:int" dfdl:inputValueCalc="\{ xs:unsignedInt(1)
> + (-1) }" />
> {quote}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)