Subscribe on changes!

defineProps generates unnecessary array of same types

avatar
Aug 16th 2021

Version

3.2.2

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuXHQ8ZGl2IDpjbGFzcz1cImBkZXB0aC0ke2RlcHRofWBcIj5cbiAgICA8c2xvdCAvPlxuICA8L2Rpdj5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQgc2V0dXAgbGFuZz1cInRzXCI+XG5kZWZpbmVQcm9wczx7XG5cdGRlcHRoPzogMSB8IDIgfCAzIHwgNCB8IDUsXG59PigpO1xuPC9zY3JpcHQ+XG4ifQ==

Steps to reproduce

Use any prop with multiple values of same type. eg.

defineProps<{
    depth?: 1 | 2 | 3 | 4 | 5,
}>();

What is expected?

depth should have type Number

What is actually happening?

depth has type [Number, Number, Number, Number, Number]