VariantOverStructTargetNameMismatchFail.yqls 859 B

12345678910111213141516171819202122
  1. # /* custom error:Failed to convert type: Variant<'A':Int32,'C':Int32,'X':Int32> to Variant<'A':Int32,'B':Int32,'C':Int32>*/
  2. (
  3. (let config (DataSource 'config))
  4. (let res_sink (DataSink 'result))
  5. (let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
  6. (let orig (Variant (Int32 '0) 'B origType))
  7. (let testcase (AsList orig))
  8. (let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32)))))
  9. (let testCallableType (CallableType '() '(testType)))
  10. (let testBody (lambda '() (Variant (Int32 '0) 'X testType)))
  11. (let testCallable (Callable testCallableType testBody))
  12. (let test (Apply testCallable))
  13. (let testcase (Append testcase test))
  14. (let world (Write! world res_sink (Key) testcase '('('type))))
  15. (let world (Commit! world res_sink))
  16. (return world)
  17. )