// Code generated by convertFourslash; DO NOT EDIT. // To modify this test, run "npm run makemanual partialUnionPropertyCacheInconsistentErrors" package fourslash_test import ( "testing" "github.com/microsoft/typescript-go/internal/fourslash" "github.com/microsoft/typescript-go/internal/testutil" ) func TestPartialUnionPropertyCacheInconsistentErrors(t *testing.T) { fourslash.SkipIfFailing(t) t.Parallel() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @strict: true // @lib: esnext interface ComponentOptions { setup?: (props: Props) => void; name?: string; } interface FunctionalComponent

{ (props: P): void; } type ConcreteComponent = | ComponentOptions | FunctionalComponent; type Component = ConcreteComponent; type WithInstallPlugin = { _prefix?: string }; /**/ export function withInstall( component: C | C[], target?: T, ): string { const componentWithInstall = (target ?? component) as T; const components = Array.isArray(component) ? component : [component]; const { name } = components[0]; if (name) { return name; } return ""; }` f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) defer done() f.VerifyNoErrors(t) f.GoToMarker(t, "") f.Insert(t, "type C = Component['name']") f.VerifyNoErrors(t) }