30 lines
781 B
Go
30 lines
781 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual codeFixInferFromUsageRestParam"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCodeFixInferFromUsageRestParam(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @strict: false
|
|
// @noImplicitAny: true
|
|
function f(a: number, [|...rest |]){
|
|
a; rest;
|
|
}
|
|
f(1);
|
|
f(2, "s1");
|
|
f(3, "s1", "s2");
|
|
f(3, "s1", "s2", "s3", "s4");`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyRangeAfterCodeFix(t, `...rest: string[]`, false, 0, 0)
|
|
}
|