You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we use readonly array for choices, it causes type mismatch.
import{define}from'gunshi'constchoices=['a','b']asconst;constcommand=define({options: {foo: {type: 'enum',
choices,// ^ The type 'readonly ["a", "b"]' is 'readonly' and cannot be assigned to the mutable type 'string[]'.(4104)}},run(){}})
Describe the bug
When we use readonly array for
choices
, it causes type mismatch.Reproduction
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgEwKYDNgDtVwL5zpQQhwDkA5gK5YDOAFsGQFDMDGEd8b9EwbqWnAC8cANpkAhmQA05AEZkAunElCOXANysNtbiRCSsyESgzZUACgTM4duBDAxgnWgC5Et+9-QQIHm28g+xgATzBUDzJULCoQWS9g7x4+AVoZRKC8TLwM7ygaSwBKBGy8IuYgA
Issue Runtime
Node.js
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: