ImplicitEqualsOverOptional.yqls 1003 B

1234567891011121314151617181920212223242526272829
  1. (
  2. (let config (DataSource 'config))
  3. (let res_sink (DataSink 'result))
  4. # result is true for all tests below
  5. # Int32 -> Uint64?? (false)
  6. (let value (Int32 '"-1"))
  7. (let commonType (OptionalType (OptionalType (DataType 'Uint64))))
  8. (let imlicitEqualsResult (Exists (StrictCast value commonType)))
  9. (let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
  10. # Just(Int32) -> Uint64?? (false)
  11. (let value (Just (Int32 '"-1")))
  12. (let commonType (OptionalType (OptionalType (DataType 'Uint64))))
  13. (let imlicitEqualsResult (Exists (StrictCast value commonType)))
  14. (let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
  15. # Nothing(Int32)? -> Uint64?? (true)
  16. (let value (Just (Nothing (OptionalType (DataType 'Int32)))))
  17. (let commonType (OptionalType (OptionalType (DataType 'Uint64))))
  18. (let imlicitEqualsResult (Exists (StrictCast value commonType)))
  19. (let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))
  20. (let world (Commit! world res_sink))
  21. (return world)
  22. )