Skip to content

fix: support generic Asset<K> type in attribute parsing - #74

Closed
shin1244 wants to merge 1 commit into
playcanvas:mainfrom
shin1244:fix/generic-asset-attribute
Closed

shin1244 wants to merge 1 commit into
playcanvas:mainfrom
shin1244:fix/generic-asset-attribute

Conversation

@shin1244

Copy link
Copy Markdown

Description

Since engine 2.23 (playcanvas/engine#9403), Asset is declared as a generic class:

declare class Asset<K extends AssetType | (string & {}) = string> extends EventHandler

@type {Asset} now resolves to the instantiation Asset<string>, which is a different ts.Type from the class declaration type stored in allSupportedTypesSet. As a result every ESM Asset attribute fails to parse:

@kpal81xd

Copy link
Copy Markdown
Collaborator

Thanks @shin1244 for tracking this down! The same fix landed in #76 (resolving generic class instances like Asset<string> to their declared class type in getType), so I'm closing this as superseded. Appreciate the contribution.

@kpal81xd kpal81xd closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants