Open XadillaX opened 1 year ago
Did you try:
expectAssignable<RGBColor>({r: 0, g: 0, b: 0} as const);
expectAssignable<RGBColor>({r: 0, g: 0, b: 256} as const);
expectNotAssignable<RGBColor>({r: 0, g: 0, b: 0} as const);
expectNotAssignable<RGBColor>({r: 0, g: 0, b: 256} as const);
Because:
But:
Did you try:
expectAssignable<RGBColor>({r: 0, g: 0, b: 0} as const); expectAssignable<RGBColor>({r: 0, g: 0, b: 256} as const); expectNotAssignable<RGBColor>({r: 0, g: 0, b: 0} as const); expectNotAssignable<RGBColor>({r: 0, g: 0, b: 256} as const);
Because:
But:
It works after I adding as const
.
I have an interface like this:
Then I test:
It seems
expectNotAssignable<RGBColor>({ r: 0, g: 0, b: 0 })
not work correctly.