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

(let res_sink (DataSink 'result))

# List<Uint16> -> List<Int16> (false)
(let value (AsList (Uint16 '32767)))
(let value (Append value (Uint16 '32768)))
(let commonType (ListType (DataType 'Int16)))
(let imlicitEqualsResult (Exists (StrictCast value commonType)))
(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))

# List<Uint16> -> List<UInt32> (true)
(let value (AsList (Uint16 '32767)))
(let value (Append value (Uint16 '32768)))
(let commonType (ListType (DataType 'Uint32)))
(let imlicitEqualsResult (Exists (StrictCast value commonType)))
(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type))))

(let world (Commit! world res_sink))
(return world)

)