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
functionisObject(o: unknown): o is Record<string,any>{returntrue;}functionassertObject(o: unknown): asserts o is Record<string,any>{}letvalue: {}=null!;if(isObject(value)){value.aything// error since 4.8.0-dev.20220716}assertObject(value)value.aything// error since 4.8.0-dev.20220716
π Actual behavior
value.aything is an error even after the custom type assertions/guards. value still apears as {} instead of Record<string, any>
π Expected behavior
Should be able to access value.aything after custom assertion/guard and value should be of type Record<string, any> in if, after assertion.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
narrow {} custom type guard type assertion Record<string,any>
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
value.aything
is an error even after the custom type assertions/guards.value
still apears as{}
instead ofRecord<string, any>
π Expected behavior
Should be able to access
value.aything
after custom assertion/guard andvalue
should be of typeRecord<string, any>
inif
, after assertion.The text was updated successfully, but these errors were encountered: