Open sebcode opened 3 weeks ago
Self-isolated repro (workbench):
// @strictNullChecks: false
// @declaration: true
// @emitDeclarationOnly: true
// @filename: createApi.ts
type Id<T> = {
[K in keyof T]: T[K];
} & {};
export declare function createApi<Definitions>(_: { endpoints: Definitions }): {
[K in keyof Definitions as `use${Capitalize<K & string>}Query`]: () => Id<{
status: "uninitialized";
originalArgs?: undefined;
}>;
};
// @filename: index.ts
import { createApi } from "./createApi";
const slice = createApi({
endpoints: {
test: {
url: `/user`,
},
},
});
export const { useTestQuery } = slice;
🔎 Search Terms
Error: Debug Failure. False expression. at getOptionalType
🕗 Version & Regression Information
Crashes with
5.6.3
andnext
, but works fine with previous release5.5.4
.⏯ Playground Link
Couldn't get it to work in the playground. Instead, see below for a repro.
💻 Code
🙁 Actual behavior
Crash
🙂 Expected behavior
No crash.
Additional information about the issue
Repro: