Cannot use nominal/brand types in props #13444
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
scope: compiler
scope: sfc
Vue version
3.5.15
Link to minimal reproduction
https://play.vuejs.org/#eNqlkl1v0zAUhv/KkS8ISMXd1E1IIa1E0SSGBEyscIMRypLTkuHYlu2UVlH+O8d2m04T7IY7+3y85zkfPXtjDN92yHJWuMo2xoMs1WYumHeCgUPfmYVQTWu09dDDF4f2uoYB1la3kPHp0paqzl6PIR/2b3VrRnf6hgqZUEJVWjkPXRKZQ3Z+dpZB6Q6yQhXTBEEl6eOxNbL0GH6+SFLhKXweJF42NXEmMcGCY0qRxfRBGptQH1R03Wz4vdOK2uyFAhCsIq1Gov1kfENQguUQPcFXSql/v482bzucHO3VT6x+/cV+73bBJtiNRaLZomCjz5d2gz65r24/4o7eo7PVdScp+gnnZ3RadoExhS07VRP2g7hIex2n36jNyl3tPCp3bCqAhsghxgtGmwhj/FfrJ9wZv4h5Qg00xdMe//NSTldgrDaOjqDGdaPwJvyKA0faaT6exbB4/uLJ43iHNATo++NpDYT9+BBife4dNZAA7oKBAG737Z2WoYJQuIv4fm8QYkKxmsByQVEreHYck8Wy1kru4VuU+J7Dkhgfpx8GMD/oOG9pPRPIkj1LUD+2aMOuCGrGL/n5RbB593W0XvJXfMaGP6MxOio=
Steps to reproduce
For some reason, the sfc playground always throws the error unless you're in
MyComp.vue
's JS tabSwitching between 3.5.14 and 3.5.15 show the type of
userId
prop change fromnull
toObject
What is expected?
No type errors
What is actually happening?
The nominal type is treated as
Object
instead of a string primitiveSystem Info
Any additional comments?
I'm aware TypeScript does not actually have nominal types and this is just a hack to fake it but I think this is a common enough usage in large codebases that it should be accounted for
The text was updated successfully, but these errors were encountered: