aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql
blob: bd91e105e0ece20acdb867a8fcca167594a345f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))
(let res_sink (DataSink 'result))

(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)))))
(let orig (Variant (Int32 '0) 'B origType))

(let testcase (AsList orig))

(let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32)))))
(let testCallableType (CallableType '() '(testType)))
(let testBody (lambda '() (Variant (Int32 '0) 'X testType)))
(let testCallable (Callable testCallableType testBody))
(let test (Apply testCallable))

(let testcase (Append testcase test))

(let world (Write! world res_sink (Key) testcase '('('type))))
(let world (Commit! world res_sink))
(return world)
)