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

Ref sugar (take2) in Typescript return incorrect type checking #4524

Closed
TrungRueta opened this issue Sep 5, 2021 · 2 comments
Closed

Ref sugar (take2) in Typescript return incorrect type checking #4524

TrungRueta opened this issue Sep 5, 2021 · 2 comments

Comments

@TrungRueta
Copy link

Version

3.2.8

Reproduction link

github.com

Steps to reproduce

  • Please see file App.vue in component folder
  • compare variable [a] with type null | boolean
  • compare variablt [b] with type null | { ok:boolean }

from vscode, ctrl + space at a and b variable to see how it explains type.

What is expected?

ref surgar $ref | $computed should be reference correct type checking in case type is object

What is actually happening?

  • $ref | $computed return correct union type checking in case type is primative but lost type null | undefined in case union type has type object

correct if : $ref<null | boolean> --> refValue<null | boolean>
failed if $ref<null | { ok: boolean }> --> refValue<{ ok : boolean }>

correct variable a with primative
image

incorrect variable b with object
image

@edison1105
Copy link
Member

already fixed via 815bfcf, not release yet.

@yyx990803
Copy link
Member

duplicate of #4499

@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants