web-component-analyzer icon indicating copy to clipboard operation
web-component-analyzer copied to clipboard

Members' `type` functions now accept an optional descendant context declaration.

Open bicknellr opened this issue 1 year ago • 0 comments

Component members are discovered within the context of some declaration associated with a single AST node. If that declaration has free type parameters, then asking the type checker for that declaration's AST node's type will return a type that still contains those free type parameters. Further, different choices for those type parameters in descendant component declarations may cause the type of the member to vary.

To allow a member to return its type with all type arguments substituted, members' type functions can now optionally be passed a component declaration that (inclusively) descends from the member's declaration. The type returned will be the type of this member for an instance of the given declaration.

bicknellr avatar Jan 04 '23 22:01 bicknellr