Commit 775bdc7
committed
sem/eval: fix TestCastMap properly for AnyTuple
`TestCastMap` iterates over `types.OidToType` map to find all
interesting pairs to perform the cast between. One of the representative
types in the map is `types.AnyTuple` that is actually not a valid
execution-time type (it's a wildcard used only during static analysis).
Previously we could crash in the test if we happen to pick a float value
as the element corresponding to the single Any type element (because
float width is 0 there). This commit fixes the test by effectively
"resolving" `AnyTuple` type to a concrete tuple type with a single
random type as the element.
Release note: None1 parent 45e8f5c commit 775bdc7
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
| |||
0 commit comments