File: incrementalResolveFunctionPropertyAssignment.ts

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (27 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference path="fourslash.ts" />

////function bar(indexer: { getLength(): number; getTypeAtIndex(index: number): string; }): string {
////    return indexer.getTypeAtIndex(indexer.getLength() - 1);
////}
////function foo(a: string[]) {
////    return bar({
////        getLength(): number {
////            return "a.length";
////        },
////        getTypeAtIndex(index: number) {
////            switch (index) {
////                case 0: return a[0];
////                case 1: return a[1];
////                case 2: return a[2];
////                default: return "invalid";
////            }
////        }
////    });
////}
////var val = foo(["myString1", "myString2"]);
/////*1*/val;

verify.quickInfoAt("1", "var val: string");

// TypeCheck
verify.numberOfErrorsInCurrentFile(1);