Skip to content

Type inference failure in defineProps when using generic type aliases for function props #13240

@Yiximail

Description

@Yiximail

Vue version

3.5.13

Link to minimal reproduction

https://play.vuejs.org/#eNqdU8tu2zAQ/BWCl9hAareSTqqsoI8UaA910PbIiyyvHKYUSZCU48DQv3dJRrGMWDn0InB2ZpdDcnSkn7Re7DugOS0ctFpUDkomCSm2fB8WuPyiWk2WZyhv5IcVo/hl1IMkgCSCNIA0giyADEGcUCzj5GI52g+hrQ3XjlhwnSaikjvsc5ZRZHmrlXEkbNwY1ZKrxdIDb/zqI5O1ktYR9EJWZDYnq5I0lbAwYpJJJp1ksldMsYwm0RK9RnOobPhu8WCVxPs7+tMxWqMxLsCsteM4idGcBMZzlRDq8UeoOdPB9VCv76H+e6H+YA++xuidAQtmD4y+cK4yO3CRvv39Ew64fiFbte0Eqt8gf4FVovMeo+xzJ7doe6QLbr+Hu+dy98feHhxIOxzKG/XKPugZxbfwbzJ19JPddJGFPiZ7vMXhHS8GkFj3JACD0GI3l+82yjnV5iR5r/FihkD6PB2P4f37fojXOZNMMukkk50x/xFb96SBfOukzxHHrpzIrt2ACZnaKCWgkpiqQZYU6/IkXU+ofCqDOM4qkRoiq43SFulH7u6/QlN1wtmZ976Fhku483Tx/CB4WTe5H4T9EScRjwdHIr3J37IfRVnszkKhL2fzkIrTZvnzrzSKN255sZperGavqj548/FfSft/9JKE/g==

Steps to reproduce

When defining props using defineProps with function types that utilize generic type aliases, the compiled prop type incorrectly becomes null instead of Function. This occurs specifically when using:

Generic type aliases (Fun2 in reproduction)

Type aliases referencing generic types (Fun4 in reproduction)

Image

Can see that fn2 and fn4 are null in type

What is expected?

All default function should be Function type

What is actually happening?

Image
fn2 and fn4 both became boolean

System Info

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: compilerscope: sfc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy