Skip to content

runtime prop type of keyof SomeInterface['property'] resolves to ObjectΒ #11580

@jacekkarczmarczyk

Description

@jacekkarczmarczyk

Vue version

3.4.24

Link to minimal reproduction

https://play.vuejs.org/#eNp9kcFOwzAMhl8lygWQRgcaXKoyCdAOcIAJdiMIhdYt2VInSpyxadq7k6Za4YAm5eDYf/58tnf81tpsHYDnvPClU5aYBwqWaYnNjeDkBZ8KVEjgalkCW2wtsJ1AxioAm/chY7UxOZO47W57gfEIrKBWCHNnrC+SzJlAkLMVbE2djN5OOpOT9/hgenomsBj3DPHHeCForZYE02I8hAL5KEKVBmvVZEtvMJInc8FL01qlwT1bUgYj+EAnuNTafD+mHLkAo0O+/IJy9U9+6TddTvC5Aw9uDYIPNZKuAerLs9cn2MR4KLamCjqqjxRfwBsdOsZedhewith/dIn2obXGkcJm4WcbAvSHpjrQNOekFzyu7/5I67+4k+zqsJ84xY81uM4zDnCSXWcX559AMrvk+x/cJLBV

Steps to reproduce

interface Type {
  deep: {
    foo: any
  }
}

defineProps<{
  route: keyof Type['deep']
}>()

What is expected?

const __sfc__ = /*#__PURE__*/_defineComponent({
  __name: 'App',
  props: {
    route: { type: String, required: true }
  },

What is actually happening?

const __sfc__ = /*#__PURE__*/_defineComponent({
  __name: 'App',
  props: {
    route: { type: Object, required: true }
  },

System Info

No response

Any additional comments?

Last working version: 3.4.23
Possibly related:
5cef52a#diff-8d5ec7c83895d7e238b2db7d7ac5dca5470cfdde52e432d693c390cc52978d15R1643
#11132

Was broken in 3.4.24, since 3.4.27 works fine with the code below

defineProps<{
  route: keyof Type
}>()

but doesn't work with keyof Type['deep']

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