(vec Any)
| 210 | } |
| 211 | |
| 212 | func Opt(vec Any) Any { |
| 213 | switch vec := vec.(type) { |
| 214 | case *Optional: |
| 215 | return vec.Dynamic |
| 216 | case *None: |
| 217 | return vec.Error |
| 218 | } |
| 219 | return vec |
| 220 | } |
| 221 | |
| 222 | // OptType returns the type of `v` preventing None values from expressing |
| 223 | // themselves as missing and instead retuning the type bound to that None. |