mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
31 lines
908 B
Go
31 lines
908 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual contextualTypingGenericFunction1"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestContextualTypingGenericFunction1(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `var obj: { f<T>(x: T): T } = { f: <S>(/*1*/x) => x };
|
|
var obj2: <T>(x: T) => T = <S>(/*2*/x) => x;
|
|
|
|
class C<T> {
|
|
obj: <T>(x: T) => T
|
|
}
|
|
var c = new C();
|
|
c.obj = <S>(/*3*/x) => x;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyQuickInfoAt(t, "1", "(parameter) x: any", "")
|
|
f.VerifyQuickInfoAt(t, "2", "(parameter) x: any", "")
|
|
f.VerifyQuickInfoAt(t, "3", "(parameter) x: any", "")
|
|
}
|