-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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
Property 'b' is not branded 'FileName'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request