You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.tsimport{defineComponent,PropType}from"vue";exportenumValidSize{sm="sm",}exporttypeValidSizeType=keyoftypeofValidSize;exportfunctionsizeProp<TextendsValidSize>(defaultSize?: T){return{size: {type: StringasPropType<ValidSizeType>,default: defaultSize,validator: (value: ValidSize)=>{if(value===null)returntrue;return!!ValidSize[value];},},};}constComp=defineComponent({props: {
...sizeProp(ValidSize.sm),},setup(){return{size: 1,// if you comment this, it works};},});typeCompType=InstanceType<typeofComp>;// never
LinusBorg
changed the title
Type is lost when returning a same name property on the setup.
Type is lost when returning a property from setup that uses the name of a prop.
May 10, 2022
Version
3.2.33
Reproduction link
www.typescriptlang.org/play
Steps to reproduce
What is expected?
Comp
to not benever
What is actually happening?
Comp should keep the correct type
vuejs/language-tools#1275
The text was updated successfully, but these errors were encountered: