mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add test + reshuffle/rename new code
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noImplicitAny: true
|
||||
//// function foo([|a, m |]) {
|
||||
//// return a + m
|
||||
//// }
|
||||
|
||||
verify.rangeAfterCodeFix("a: any, m: any", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noImplicitAny: true
|
||||
//// function foo([|p, a, b, c, d, e |]) {
|
||||
//// var x: string = a.pop()
|
||||
//// b.reverse()
|
||||
//// var rr: boolean[] = c.reverse()
|
||||
//// d.some(t => t > 1); // can't infer from callbacks right now
|
||||
//// var y = e.concat(12); // can't infer from overloaded functions right now
|
||||
//// return p.push(12)
|
||||
//// }
|
||||
|
||||
verify.rangeAfterCodeFix("p: number[], a: string[], b: any[], c: boolean[], d: any[], e: number[]", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noImplicitAny: true
|
||||
//// function foo([|a, m |]) {
|
||||
//// a = 'hi'
|
||||
//// m = 1
|
||||
//// }
|
||||
|
||||
verify.rangeAfterCodeFix("a: string, m: number", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noImplicitAny: true
|
||||
//// function foo([|p |]) {
|
||||
//// return p.then((x: string[]) => x[0])
|
||||
//// }
|
||||
|
||||
verify.rangeAfterCodeFix("p: Promise<string[]>", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noImplicitAny: true
|
||||
//// function foo([|p, a, b, c, d |]) {
|
||||
//// var x
|
||||
//// p.charAt(x)
|
||||
//// a.charAt(0)
|
||||
//// b.concat('hi')
|
||||
//// }
|
||||
|
||||
verify.rangeAfterCodeFix("p: string, a: string, b: string | string[]", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, /*index*/0);
|
||||
|
||||
Reference in New Issue
Block a user