-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
TypeScript Version: 3.8.3 or earlier
Search Terms: Exclude
, Conditional Types
Code
type Foo = Exclude<string, "bar">;
// this should cause an error.
const baz: Foo = "bar";
Expected behavior:
"bar"
is not assignable to baz
.
Actual behavior:
"bar"
is assignable to baz
without any errors.
Playground Link: https://www.typescriptlang.org/play/#code/FAFwngDgpgBAYgewTAvDAogDwMYBsCuAJlADwDOIATgJYB2A5gDQwBEARgIaUsB8A3MGDYEtCjE4AvAFzwkqVp24ChIsglxQAdLgT0AFJICUAoA
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed