Brandon Sloane created DAFFODIL-2169:
----------------------------------------

             Summary: Add type safety to DPath variables
                 Key: DAFFODIL-2169
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2169
             Project: Daffodil
          Issue Type: Improvement
          Components: Clean Ups
            Reporter: Brandon Sloane


Currently our DPath runtime (and, I believe, main infoset) pass around values 
of type AnyRef, which affords almost no protection through the Scala type 
system.

This was done to avoid the boxing overhead normaly associated with creating 
case classes. However, it should be possible to create an unboxed type that can 
provide some level of type safety. 

Simmilar to our current Maybe type, can can create a new value type that wraps 
AnyRef. Being a value type, it will not require boxing. We can then make the 
main constructor hidden, and provide constructors only for those types that we 
want to allow as DPath variables.

This should provide us type safty in assiging to DPath variables. Reading the 
values will still involve dealing with AnyRef however.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to