For example, the error message here doesn't point you towards needing a branded type
type FileName = string & {__brand: 'FN'};
type Errs = Record<FileName, string>;
const foo: Errs = {
['a' as 'a' & {__brand: 'FN'}]: 1,
b: 1
}
Type '{ [x: string]: number; b: number; }' is not assignable to type 'Errs'.
Object literal may only specify known properties, and 'b' does not exist in type 'Errs'.(2322)
It should be fairly easy to detect the branded type key and report something like
For example, the error message here doesn't point you towards needing a branded type
It should be fairly easy to detect the branded type key and report something like