You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Brandon Sloane (Jira)" <ji...@apache.org> on 2019/12/18 21:28:00 UTC

[jira] [Resolved] (DAFFODIL-2169) Add type safety to DPath variables

     [ https://issues.apache.org/jira/browse/DAFFODIL-2169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Sloane resolved DAFFODIL-2169.
--------------------------------------
    Resolution: Fixed

Fixed in eb7e0403baa097328c7f75eabaef292ac0092bcc

> 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
>            Assignee: Brandon Sloane
>            Priority: Major
>          Time Spent: 18h 40m
>  Remaining Estimate: 0h
>
> 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
(v8.3.4#803005)