Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type assertions in setup are not narrowed in template #4391

Open
minht11 opened this issue May 16, 2024 · 0 comments
Open

Type assertions in setup are not narrowed in template #4391

minht11 opened this issue May 16, 2024 · 0 comments

Comments

@minht11
Copy link

minht11 commented May 16, 2024

After upgrading to vue-tsc 2.0.19 previous code no longer works:

const value: number | undefined = 1

if (!value) {
	throw new Error('Undefined')
}
<Component must-be-number={value} />

I get error

'__VLS_ctx.value' is possibly 'undefined'.

Verified working version 2.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant