37 lines
955 B
Go
37 lines
955 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual codeFixInferFromFunctionThisUsageObjectPropertyShorthand"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCodeFixInferFromFunctionThisUsageObjectPropertyShorthand(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @noImplicitThis: true
|
|
function returnThisMember([| |]) {
|
|
return this.member;
|
|
}
|
|
|
|
interface Container {
|
|
member: string;
|
|
returnThisMember(): string;
|
|
}
|
|
|
|
const container: Container = {
|
|
member: "sample",
|
|
returnThisMember,
|
|
};
|
|
|
|
container.returnThisMember();`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyRangeAfterCodeFix(t, `this: Container`, false, 0, 0)
|
|
}
|