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
This reveals two locations where glint throws both times the same error:
<Tag and
...attributes
Wit the error message being:
Argument of type 'NonNullable<ElementFromTagName<T>> extends never ? unknown :
ElementFromTagName<T>' is not assignable to parameter of type 'Element'.
Type 'unknown' is not assignable to type 'Element'.glint(2345)
As to my understanding, the types for the signature are correct, but the error message is wrong. The ElementFromTagName will always return a valid type, in either explicit HTMLElementTagNameMap[T] or generic Element which should be accurate inside the component (typing the unknownigly character of @tag).
Is this a valid problem with glint? Or are my typings wrong?
The text was updated successfully, but these errors were encountered:
But I don't have the capacity right now to verify that that doesn't adversely affect some other area of inference, so someone else will need to take a look. We should have decent test coverage for this.
I'm providing glint support for
ember-element-helper
tildeio/ember-element-helper#107Here are the types based on the ones from Dan (in tildeio/ember-element-helper#102):
Using the helper works straight away:
Going a bit more dynamic and allowing a
@tag
to be passed in, works when the type is made explicit:... of course those explicit types do not make sense, when we want to have any element being passed in. Making it generic makes the problem visible:
This reveals two locations where glint throws both times the same error:
<Tag
and...attributes
Wit the error message being:
As to my understanding, the types for the signature are correct, but the error message is wrong. The
ElementFromTagName
will always return a valid type, in either explicitHTMLElementTagNameMap[T]
or genericElement
which should be accurate inside the component (typing the unknownigly character of@tag
).Is this a valid problem with glint? Or are my typings wrong?
The text was updated successfully, but these errors were encountered: