google / google/vim-maktaba

matkaba#value#TypeMatches and friends should support recursively checking nested list element types

Open
#256 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
588
Forks
41
PR merge metrics
No merged PRs in 30d

Description

When checking collection types, it would be handy if `maktaba#value#TypeMatches` (and `#TypeMatchesOneOf` and their `maktaba#ensure#` variants) would recursively consider nested types to simplify checking for types like list-of-strings:
```vim
:echo maktaba#value#TypeMatches([1], [''])
0
```
```vim
:echo maktaba#ensure#TypeMatchesOneOf([''], [ 0, [[]] ])
```
`E605: Exception not caught: ERROR(WrongType): Expected a number or list of lists. Got a list.`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.