You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/02/14 15:00:18 UTC

[GitHub] stevedlawrence commented on a change in pull request #183: Fix type coerceion between signed/unsigned types

stevedlawrence commented on a change in pull request #183: Fix type coerceion between signed/unsigned types
URL: https://github.com/apache/incubator-daffodil/pull/183#discussion_r256868746
 
 

 ##########
 File path: daffodil-core/src/main/scala/org/apache/daffodil/dpath/NodeInfoUtils.scala
 ##########
 @@ -113,24 +113,34 @@ object NodeInfoUtils {
       case (Float, _) => (Float, Float)
       case (_, Integer) => (Integer, Integer)
       case (Integer, _) => (Integer, Integer)
+      case (lat, NonNegativeInteger) if (lat.isInstanceOf[SignedInteger.Kind]) => (Integer, Integer)
 
 Review comment:
   Is there a way to remove the asInstanceOf stuff? I think you might need to use parenthesis to match the instance instead of the companion object?
   ```scala
   case (SignedInteger(), NonNegativeInteger) => ...
   ```
   Or maybe you needs to be bound to a variable?
   ```scala
   case (_: SignedInteger, NonNegativeInteger) => ...
   ```
   I need to reference myself of scala pattern matching.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services