Skip to content

defineProps generates unnecessary array of same types #4352

Closed
@hkk12369

Description

@hkk12369

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]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions