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
import { RecordOf } from 'immutable';
export type Id = {};
type A = RecordOf<{ id: Id, param: boolean }>;
type B = RecordOf<{ id: Id}>;
const a: A = null as any;
const b: B = a;
errors with
Type 'A' is not assignable to type 'B'.
Type 'A' is not assignable to type 'Record<{ id: Id; }>'.
Types of property 'has' are incompatible.
Type '(key: string) => key is "id" | "param"' is not assignable to type '(key: string) => key is "id"'.
Type predicate 'key is "id" | "param"' is not assignable to 'key is "id"'.
Type '"id" | "param"' is not assignable to type '"id"'.
Type '"param"' is not assignable to type '"id"'.
errors with
Originally posted by @thatsmydoing in #1930 (comment)
This should work as it does work with plain objects as B is a subset of A: https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBDAnmYcCSATOBeOBvOANwC44BnGKASwDsBzOAXwG4AoVpFOAQR3zioZSmADRwwAQygSAtqQBGECABtgEmnCYdkqAEJ8Cg4VkbsAxhBoU4E0r1yGh-EnADkARldMxk6XIRQAK6oLKwWVvDypPq4EsxAA
The text was updated successfully, but these errors were encountered: