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
exportfunctionisHTMLTable<Textendsobject|null>(table: T): boolean{return!!table&&'html'intable;// Type 'NonNullable<T>' may represent a primitive value, which is not permitted as the right operand of the 'in' operator.(2638)}exportfunctionisHTMLTable2(table: object|null): boolean{return!!table&&'html'intable;// no error}
π Actual behavior
The generic version of this function is reporting an error on the in operator but the non-generic one isn't
Bug Report
π Search Terms
in keyword, narrow, nullable, NonNullable, generic constraint
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The generic version of this function is reporting an error on the
in
operator but the non-generic one isn'tπ Expected behavior
I believe that both of them should not error.
This was originally reported by @jcalz here
The text was updated successfully, but these errors were encountered: