// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual codeFixClassImplementInterfaceTypeLiterals"

package fourslash_test

import (
	"testing"

	"github.com/microsoft/typescript-go/internal/fourslash"
	"github.com/microsoft/typescript-go/internal/testutil"
)

func TestCodeFixClassImplementInterfaceTypeLiterals(t *testing.T) {
	fourslash.SkipIfFailing(t)
	t.Parallel()
	defer testutil.RecoverAndFail(t, "Panic on fourslash test")
	const content = `type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;

export type DeepPartial<T> = T extends Builtin ? T :
    T extends Array<infer U> ? Array<DeepPartial<U>> :
        T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> :
            T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> } : Partial<T>;

export interface Nested {
    field: string;
}

interface Foo {
    request(): DeepPartial<{ nested1: Nested; test2: Nested }>;
}
[|export class C implements Foo {}|]`
	f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
	defer done()
	f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
		Description: "Implement interface 'Foo'",
		NewRangeContent: `export class C implements Foo {
    request(): DeepPartial<{ nested1: Nested; test2: Nested; }> {
        throw new Error("Method not implemented.");
    }
}`,
		Index: 0,
	})
}
