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{JsonValue}from"type-fest";declarefunctionidentity(value: JsonValue): JsonValue;interfaceInterfaceObject{origin: string;}constobjectViaInterface: InterfaceObject={origin: 'red'};identity(objectViaInterface);// Argument of type 'InterfaceObject' is not assignable to parameter of type 'JsonValue'.// Type 'InterfaceObject' is not assignable to type 'JsonObject'.// Type 'InterfaceObject' is not assignable to type '{ [x: string]: JsonValue; }'.// Index signature for type 'string' is missing in type 'InterfaceObject'.(2345)typeTypeObject={origin: string;}constobjectViaType: TypeObject={origin: 'red'};identity(objectViaType)// Fine
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbwFIGcIDsBqBDANgVwFMBfOAMyghDgCIYBPMQgWjMJRhoG4AoHgE0IBjXNiiFy+dEJjAMcYIPSyGACgBueIgC44qDDgKEAlLv1YthXj2DLCUMtiESAknYdPCAeQBGAK2F4BB44ULhoYABzW10OKFtI3mI+IQwOcP9AzGBsNxh7R2ddPILPXwCZOABeRBCwiOj0XQBycX5mnmJrRUJlYDUITJls3PdCkz4GJjgAFUZvIfga4LDw+MbYmHj0RM6UtPhBipgRuaZdM4Xj6trVhpi4VsJ2zu6lFXpVI6ycy+MgA
Jsonify
"fixes" the issue in some cases but it breaks in otherGeneric issue for:
JsonValue
should be super set ofPackageJson
#397Upvote & Fund
The text was updated successfully, but these errors were encountered: