This commit is contained in:
Yuichi Nukiyama
2016-12-14 23:55:18 +09:00
parent 7fce634e85
commit ec72ad64b6
245 changed files with 2848 additions and 1284 deletions
@@ -0,0 +1,24 @@
tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts(13,15): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
==== tests/cases/conformance/classes/constructorDeclarations/superCalls/superPropertyInConstructorBeforeSuperCall.ts (2 errors) ====
class B {
constructor(x?: string) {}
x(): string { return ""; }
}
class C1 extends B {
constructor() {
super.x();
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
super();
}
}
class C2 extends B {
constructor() {
super(super.x());
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
}
}
@@ -0,0 +1,46 @@
//// [superPropertyInConstructorBeforeSuperCall.ts]
class B {
constructor(x?: string) {}
x(): string { return ""; }
}
class C1 extends B {
constructor() {
super.x();
super();
}
}
class C2 extends B {
constructor() {
super(super.x());
}
}
//// [superPropertyInConstructorBeforeSuperCall.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var B = (function () {
function B(x) {
}
B.prototype.x = function () { return ""; };
return B;
}());
var C1 = (function (_super) {
__extends(C1, _super);
function C1() {
var _this;
_super.prototype.x.call(_this);
_this = _super.call(this) || this;
return _this;
}
return C1;
}(B));
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {
return _super.call(this, _super.x.call(_this)) || this;
}
return C2;
}(B));
@@ -1,8 +1,9 @@
tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
==== tests/cases/compiler/superWithTypeArgument.ts (2 errors) ====
==== tests/cases/compiler/superWithTypeArgument.ts (3 errors) ====
class C {
}
@@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must
~~~~~~~~~~~~~~~
super<T>();
~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
}
@@ -1,8 +1,9 @@
tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
==== tests/cases/compiler/superWithTypeArgument2.ts (2 errors) ====
==== tests/cases/compiler/superWithTypeArgument2.ts (3 errors) ====
class C<T> {
foo: T;
}
@@ -12,6 +13,8 @@ tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must
~~~~~~~~~~~~~~~~
super<T>(x);
~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
}
@@ -1,8 +1,9 @@
tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/compiler/superWithTypeArgument3.ts(8,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access.
==== tests/cases/compiler/superWithTypeArgument3.ts (2 errors) ====
==== tests/cases/compiler/superWithTypeArgument3.ts (3 errors) ====
class C<T> {
foo: T;
bar<U>(x: U) { }
@@ -13,6 +14,8 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must
~~~~~~~~~~~~~~~
super<T>();
~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~
!!! error TS1034: 'super' must be followed by an argument list or member access.
}
@@ -0,0 +1,18 @@
//// [systemModuleTrailingComments.ts]
export const test = "TEST";
//some comment
//// [systemModuleTrailingComments.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var test;
return {
setters: [],
execute: function () {
exports_1("test", test = "TEST");
//some comment
}
};
});
@@ -0,0 +1,5 @@
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
export const test = "TEST";
>test : Symbol(test, Decl(systemModuleTrailingComments.ts, 0, 12))
//some comment
@@ -0,0 +1,6 @@
=== tests/cases/compiler/systemModuleTrailingComments.ts ===
export const test = "TEST";
>test : "TEST"
>"TEST" : "TEST"
//some comment
@@ -0,0 +1,10 @@
//// [unionTypeWithLeadingOperator.ts]
type A = | string;
type B =
| { type: "INCREMENT" }
| { type: "DECREMENT" };
type C = [| 0 | 1, | "foo" | "bar"];
//// [unionTypeWithLeadingOperator.js]
@@ -0,0 +1,16 @@
=== tests/cases/compiler/unionTypeWithLeadingOperator.ts ===
type A = | string;
>A : Symbol(A, Decl(unionTypeWithLeadingOperator.ts, 0, 0))
type B =
>B : Symbol(B, Decl(unionTypeWithLeadingOperator.ts, 0, 18))
| { type: "INCREMENT" }
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 2, 5))
| { type: "DECREMENT" };
>type : Symbol(type, Decl(unionTypeWithLeadingOperator.ts, 3, 5))
type C = [| 0 | 1, | "foo" | "bar"];
>C : Symbol(C, Decl(unionTypeWithLeadingOperator.ts, 3, 26))
@@ -0,0 +1,16 @@
=== tests/cases/compiler/unionTypeWithLeadingOperator.ts ===
type A = | string;
>A : string
type B =
>B : B
| { type: "INCREMENT" }
>type : "INCREMENT"
| { type: "DECREMENT" };
>type : "DECREMENT"
type C = [| 0 | 1, | "foo" | "bar"];
>C : [0 | 1, "foo" | "bar"]
@@ -0,0 +1,19 @@
/node_modules/augmenter/index.d.ts(3,16): error TS2665: Invalid module name in augmentation. Module 'js' resolves to an untyped module at '/node_modules/js/index.js', which cannot be augmented.
==== /a.ts (0 errors) ====
import { } from "augmenter";
==== /node_modules/augmenter/index.d.ts (1 errors) ====
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
declare module "js" {
~~~~
!!! error TS2665: Invalid module name in augmentation. Module 'js' resolves to an untyped module at '/node_modules/js/index.js', which cannot be augmented.
export const j: number;
}
export {};
==== /node_modules/js/index.js (0 errors) ====
This file is not processed.
@@ -0,0 +1,19 @@
//// [tests/cases/compiler/untypedModuleImport_withAugmentation2.ts] ////
//// [index.d.ts]
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
declare module "js" {
export const j: number;
}
export {};
//// [index.js]
This file is not processed.
//// [a.ts]
import { } from "augmenter";
//// [a.js]
"use strict";
@@ -0,0 +1,40 @@
tests/cases/compiler/unusedLocalsAndObjectSpread.ts(21,18): error TS6133: 'bar' is declared but never used.
tests/cases/compiler/unusedLocalsAndObjectSpread.ts(28,21): error TS6133: 'bar' is declared but never used.
==== tests/cases/compiler/unusedLocalsAndObjectSpread.ts (2 errors) ====
declare var console: { log(a: any): void };
function one() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo;
console.log(bar);
}
function two() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo;
console.log(bar);
}
function three() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo; // bar should be unused
~~~
!!! error TS6133: 'bar' is declared but never used.
//console.log(bar);
}
function four() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo; // bar should be unused
~~~
!!! error TS6133: 'bar' is declared but never used.
//console.log(bar);
}
@@ -0,0 +1,67 @@
//// [unusedLocalsAndObjectSpread.ts]
declare var console: { log(a: any): void };
function one() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo;
console.log(bar);
}
function two() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo;
console.log(bar);
}
function three() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo; // bar should be unused
//console.log(bar);
}
function four() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo; // bar should be unused
//console.log(bar);
}
//// [unusedLocalsAndObjectSpread.js]
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
function one() {
var foo = { a: 1, b: 2 };
// 'a' is declared but never used
var a = foo.a, bar = __rest(foo, ["a"]);
console.log(bar);
}
function two() {
var foo = { a: 1, b: 2 };
// '_' is declared but never used
var _ = foo.a, bar = __rest(foo, ["a"]);
console.log(bar);
}
function three() {
var foo = { a: 1, b: 2 };
// 'a' is declared but never used
var a = foo.a, bar = __rest(foo, ["a"]); // bar should be unused
//console.log(bar);
}
function four() {
var foo = { a: 1, b: 2 };
// '_' is declared but never used
var _ = foo.a, bar = __rest(foo, ["a"]); // bar should be unused
//console.log(bar);
}
@@ -22,38 +22,38 @@ for (var x of Object.values(o)) {
}
var entries = Object.entries(o); // <-- entries: ['a' | 'b', number][]
>entries : ["a" | "b", number][]
>Object.entries(o) : ["a" | "b", number][]
>Object.entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : [string, number][]
>Object.entries(o) : [string, number][]
>Object.entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>Object : ObjectConstructor
>entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>o : { a: number; b: number; }
var entries1 = Object.entries(1); // <-- entries: [string, any][]
>entries1 : [string, any][]
>Object.entries(1) : [string, any][]
>Object.entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>Object.entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>Object : ObjectConstructor
>entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>1 : 1
var entries2 = Object.entries({a: true, b: 2}) // ['a' | 'b', number | boolean][]
>entries2 : ["a" | "b", number | boolean][]
>Object.entries({a: true, b: 2}) : ["a" | "b", number | boolean][]
>Object.entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries2 : [string, number | boolean][]
>Object.entries({a: true, b: 2}) : [string, number | boolean][]
>Object.entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>Object : ObjectConstructor
>entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>{a: true, b: 2} : { a: true; b: number; }
>entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>{a: true, b: 2} : { a: true; b: 2; }
>a : boolean
>true : true
>b : number
>2 : 2
var entries3 = Object.entries({}) // [never, any][]
>entries3 : [never, any][]
>Object.entries({}) : [never, any][]
>Object.entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries3 : [string, {}][]
>Object.entries({}) : [string, {}][]
>Object.entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>Object : ObjectConstructor
>entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>{} : {}
@@ -22,10 +22,10 @@ for (var x of Object.values(o)) {
}
var entries = Object.entries(o);
>entries : ["a" | "b", number][]
>Object.entries(o) : ["a" | "b", number][]
>Object.entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : [string, number][]
>Object.entries(o) : [string, number][]
>Object.entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>Object : ObjectConstructor
>entries : { <T extends { [key: string]: any; }, K extends keyof T>(o: T): [keyof T, T[K]][]; (o: any): [string, any][]; }
>entries : { <T>(o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; }
>o : { a: number; b: number; }
@@ -1,5 +1,4 @@
tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/compiler/widenedTypes.ts(10,14): error TS2695: Left side of comma operator is unused and has no side effects.
@@ -12,7 +11,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
Type 'number' is not assignable to type 'string'.
==== tests/cases/compiler/widenedTypes.ts (9 errors) ====
==== tests/cases/compiler/widenedTypes.ts (8 errors) ====
null instanceof (() => { });
~~~~
@@ -20,8 +19,6 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
({}) instanceof null; // Ok because null is a subtype of function
null in {};
~~~~
!!! error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
"" in null;
~~~~
!!! error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
@@ -0,0 +1,15 @@
// @declaration: true
// @filename: db.d.ts
declare namespace Db {
export import Types = Db;
}
export = Db;
// @filename: app.ts
import * as Db from "./db"
export function foo() {
return new Object()
}
@@ -0,0 +1,5 @@
// @declaration: true
export interface Test {
[index: TypeNotFound]: any;
}
@@ -0,0 +1,42 @@
// @experimentalDecorators: true
// @emitDecoratorMetadata: true
// @target: es5
// @filename: aux.ts
export class SomeClass {
field: string;
}
// @filename: aux1.ts
export class SomeClass1 {
field: string;
}
// @filename: aux2.ts
export class SomeClass2 {
field: string;
}
// @filename: main.ts
import { SomeClass } from './aux';
import { SomeClass1 } from './aux1';
function annotation(): ClassDecorator {
return (target: any): void => { };
}
function annotation1(): MethodDecorator {
return (target: any): void => { };
}
@annotation()
export class ClassA {
array: SomeClass[];
constructor(...init: SomeClass[]) {
this.array = init;
}
@annotation1()
foo(... args: SomeClass1[]) {
}
}
@@ -0,0 +1,18 @@
// @noemithelpers: true
// @experimentaldecorators: true
declare var console : { log(arg: string): void };
function dec(): Function {
return function (target: any, propKey: string, descr: PropertyDescriptor): void {
console.log(target[propKey]);
//logs undefined
//propKey has three underscores as prefix, but the method has only two underscores
};
}
class A {
@dec()
private __foo(bar: string): void {
// do something with bar
}
}
@@ -0,0 +1,18 @@
// @strictNullChecks: true
// Repro from #12529
class A {
readonly kind = "A"; // (property) A.kind: "A"
}
class B {
readonly kind = "B"; // (property) B.kind: "B"
}
function f(value: A | B): number {
switch(value.kind) {
case "A": return 0;
case "B": return 1;
}
}
@@ -0,0 +1,3 @@
// @noImplicitAny: true
({ a: [], ...(null as any) });
let x: any;
@@ -0,0 +1,9 @@
// @importHelpers: true
// @target: es5
// @module: commonjs
// @moduleResolution: classic
// @filename: declaration.d.ts
export declare class D {
}
export declare class E extends D {
}
@@ -57,4 +57,49 @@ function getValueAsString(value: IntersectionFail): string {
return '' + value.num;
}
return value.str;
}
// Repro from #12535
namespace enums {
export const enum A {
a1,
a2,
a3,
// ... elements omitted for the sake of clarity
a75,
a76,
a77,
}
export const enum B {
b1,
b2,
// ... elements omitted for the sake of clarity
b86,
b87,
}
export const enum C {
c1,
c2,
// ... elements omitted for the sake of clarity
c210,
c211,
}
export type Genre = A | B | C;
}
type Foo = {
genreId: enums.Genre;
};
type Bar = {
genreId: enums.Genre;
};
type FooBar = Foo & Bar;
function foo(so: any) {
const val = so as FooBar;
const isGenre = val.genreId;
return isGenre;
}
@@ -0,0 +1,6 @@
type A = & string;
type B =
& { foo: string }
& { bar: number };
type C = [& { foo: 1 } & { bar: 2 }, & { foo: 3 } & { bar: 4 }];
@@ -0,0 +1,4 @@
interface OhNo {
}
declare let y: OhNo.hello;
@@ -0,0 +1,17 @@
//@module: commonjs
//@target: es5
//@jsx: react
//@jsxFactory: skate.h
//@noEmit: false
// @filename: index.tsx
import "./jsx";
var skate: any;
const React = { createElement: skate.h };
class Component {
renderCallback() {
return <div>test</div>;
}
};
@@ -0,0 +1,13 @@
// keyof T is a literal contextual type
function foo<T extends { a: string, b: string }>() {
let a: (keyof T)[] = ["a", "b"];
let b: (keyof T)[] = ["a", "b", "c"];
}
// Repro from #12455
declare function pick<T, K extends keyof T>(obj: T, propNames: K[]): Pick<T, K>;
let x = pick({ a: 10, b: 20, c: 30 }, ["a", "c"]);
let b = x.b; // Error
@@ -0,0 +1,7 @@
// Repro from #12511
type HTML = { [K in 'div']: Block<HTML> };
type Block<P> = <T>(func: HTML) => {};
declare var h: HTML;
h.div(h);
@@ -0,0 +1,14 @@
// @strictNullChecks: true
interface CSSProps {
color?: string
}
interface NestedCSSProps {
nested?: NestedSelector
}
interface NestedSelector {
prop: CSSProps;
}
let stylen: NestedCSSProps = {
nested: { prop: { colour: 'red' } }
}
@@ -0,0 +1,13 @@
// @target: es5
function baz(x: any) {
return [[x, x]];
}
function foo(set: any) {
for (const [value, i] of baz(set.values)) {
const bar: any = [];
(() => bar);
set.values.push(...[]);
}
};
+12
View File
@@ -0,0 +1,12 @@
const f = Object.freeze(function foo(a: number, b: string) { return false; });
f(1, "") === false;
class C { constructor(a: number) { } }
const c = Object.freeze(C);
new c(1);
const a = Object.freeze([1, 2, 3]);
a[0] = a[2].toString();
const o = Object.freeze({ a: 1, b: "string" });
o.b = o.a.toString();
+4
View File
@@ -0,0 +1,4 @@
var intersection: { x: number, y: number } & { w: string, z: string };
var rest1: { y: number, w: string, z: string };
var {x, ...rest1 } = intersection;
@@ -0,0 +1,59 @@
enum E { v1, v2 };
function f<T extends { b: string }>(p1: T, p2: T[]) {
var t: T;
var i: T["b"];
var k: keyof T;
var mapped_generic: {[P in keyof T]: T[P]};
var mapped: {[P in "b"]: T[P]};
var union_generic: T | { a: number };
var union_primitive: { a: number } | number;
var intersection_generic: T & { a: number };
var intersection_premitive: { a: number } | string;
var num: number;
var str: number;
var u: undefined;
var n: null;
var a: any;
var literal_string: "string";
var literal_number: 42;
var e: E;
var {...r1} = p1; // Error, generic type paramterre
var {...r2} = p2; // OK
var {...r3} = t; // Error, generic type paramter
var {...r4} = i; // Error, index access
var {...r5} = k; // Error, index
var {...r6} = mapped_generic; // Error, generic mapped object type
var {...r7} = mapped; // OK, non-generic mapped type
var {...r8} = union_generic; // Error, union with generic type parameter
var {...r9} = union_primitive; // Error, union with generic type parameter
var {...r10} = intersection_generic; // Error, intersection with generic type parameter
var {...r11} = intersection_premitive; // Error, intersection with generic type parameter
var {...r12} = num; // Error
var {...r13} = str; // Error
var {...r14} = u; // OK
var {...r15} = n; // OK
var {...r16} = a; // OK
var {...r17} = literal_string; // Error
var {...r18} = literal_number; // Error
var {...r19} = e; // Error, enum
}
+14
View File
@@ -0,0 +1,14 @@
var union: { a: number, c: boolean } | { a: string, b: string };
var rest1: { c: boolean } | { b: string };
var {a, ...rest1 } = union;
var undefinedUnion: { n: number } | undefined;
var rest2: {};
var {n, ...rest2 } = undefinedUnion;
var nullUnion: { n: number } | null;
var rest3: {};
var {n, ...rest3 } = nullUnion;
+19
View File
@@ -0,0 +1,19 @@
// @strictNullChecks: true
declare const undefinedUnion: { n: number } | undefined;
var rest2: { n: number };
var {...rest2 } = undefinedUnion;
declare const nullUnion: { n: number } | null;
var rest3: { n: number };
var {...rest3 } = nullUnion;
declare const nullAndUndefinedUnion: null | undefined;
var rest4: { };
var {...rest4 } = nullAndUndefinedUnion;
declare const unionWithIntersection: ({ n: number } & { s: string }) & undefined | null;
var rest5: { n: number, s: string };
var {...rest5 } = unionWithIntersection;
@@ -0,0 +1,5 @@
// @noImplicitAny: true
let additional = [];
for (const subcomponent of [1, 2, 3]) {
additional = [...additional, subcomponent];
}
@@ -0,0 +1,7 @@
var intersection: { a: number } & { b: string };
var o1: { a: number, b: string };
var o1 = { ...intersection };
var o2: { a: number, b: string, c: boolean };
var o2 = { ...intersection, c: false };
@@ -0,0 +1,59 @@
enum E { v1, v2 };
function f<T extends { b: string }>(p1: T, p2: T[]) {
var t: T;
var i: T["b"];
var k: keyof T;
var mapped_generic: {[P in keyof T]: T[P]};
var mapped: {[P in "b"]: T[P]};
var union_generic: T | { a: number };
var union_primitive: { a: number } | number;
var intersection_generic: T & { a: number };
var intersection_premitive: { a: number } | string;
var num: number;
var str: number;
var u: undefined;
var n: null;
var a: any;
var literal_string: "string";
var literal_number: 42;
var e: E;
var o1 = { ...p1 }; // Error, generic type paramterre
var o2 = { ...p2 }; // OK
var o3 = { ...t }; // Error, generic type paramter
var o4 = { ...i }; // Error, index access
var o5 = { ...k }; // Error, index
var o6 = { ...mapped_generic }; // Error, generic mapped object type
var o7 = { ...mapped }; // OK, non-generic mapped type
var o8 = { ...union_generic }; // Error, union with generic type parameter
var o9 = { ...union_primitive }; // Error, union with generic type parameter
var o10 = { ...intersection_generic }; // Error, intersection with generic type parameter
var o11 = { ...intersection_premitive }; // Error, intersection with generic type parameter
var o12 = { ...num }; // Error
var o13 = { ...str }; // Error
var o14 = { ...u }; // OK
var o15 = { ...n }; // OK
var o16 = { ...a }; // OK
var o17 = { ...literal_string }; // Error
var o18 = { ...literal_number }; // Error
var o19 = { ...e }; // Error, enum
}
+10
View File
@@ -0,0 +1,10 @@
var union: { a: number } | { b: string };
var o3: { a: number } | { b: string };
var o3 = { ...union };
var o4: { a: boolean } | { b: string , a: boolean};
var o4 = { ...union, a: false };
var o5: { a: number } | { b: string } | { a: number, b: string };
var o5 = { ...union, ...union };
+25
View File
@@ -0,0 +1,25 @@
// @strictNullChecks: true
declare const undefinedUnion: { a: number } | undefined;
declare const nullUnion: { b: number } | null;
declare const nullAndUndefinedUnion: null | undefined;
var o1: { a: number };
var o1 = { ...undefinedUnion };
var o2: { b: number };
var o2 = { ...nullUnion };
var o3: { a: number, b: number };
var o3 = { ...undefinedUnion, ...nullUnion };
var o3 = { ...nullUnion, ...undefinedUnion };
var o4: { a: number };
var o4 = { ...undefinedUnion, ...undefinedUnion };
var o5: { b: number };
var o5 = { ...nullUnion, ...nullUnion };
var o6: { };
var o6 = { ...nullAndUndefinedUnion, ...nullAndUndefinedUnion };
var o6 = { ...nullAndUndefinedUnion };
@@ -0,0 +1,15 @@
class Base {
protected constructor() { }
public instance1 = new Base(); // allowed
}
class Subclass extends Base {
public instance1_1 = new Base(); // allowed
public instance1_2 = new Subclass(); // allowed
}
class SubclassOfSubclass extends Subclass {
public instance2_1 = new Base(); // allowed
public instance2_2 = new Subclass(); // allowed
public instance2_3 = new SubclassOfSubclass(); // allowed
}
@@ -0,0 +1,4 @@
// @module: system
export const test = "TEST";
//some comment
@@ -0,0 +1,6 @@
type A = | string;
type B =
| { type: "INCREMENT" }
| { type: "DECREMENT" };
type C = [| 0 | 1, | "foo" | "bar"];
@@ -0,0 +1,14 @@
// @noImplicitReferences: true
// This tests that augmenting an untyped module is forbidden even in an ambient context. Contrast with `moduleAugmentationInDependency.ts`.
// @Filename: /node_modules/augmenter/index.d.ts
declare module "js" {
export const j: number;
}
export {};
// @Filename: /node_modules/js/index.js
This file is not processed.
// @Filename: /a.ts
import { } from "augmenter";
@@ -0,0 +1,31 @@
//@noUnusedLocals:true
declare var console: { log(a: any): void };
function one() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo;
console.log(bar);
}
function two() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo;
console.log(bar);
}
function three() {
const foo = { a: 1, b: 2 };
// 'a' is declared but never used
const {a, ...bar} = foo; // bar should be unused
//console.log(bar);
}
function four() {
const foo = { a: 1, b: 2 };
// '_' is declared but never used
const {a: _, ...bar} = foo; // bar should be unused
//console.log(bar);
}
@@ -0,0 +1,7 @@
// @target: es2017
// @strictNullChecks: true
interface A extends Promise<string> {}
declare var a: A;
async function f() {
await a;
}
@@ -0,0 +1,8 @@
// @target: es5
abstract class A {
abstract get a();
abstract get aa() { return 1; } // error
abstract set b(x: string);
abstract set bb(x: string) {} // error
}
@@ -0,0 +1,15 @@
class B {
constructor(x?: string) {}
x(): string { return ""; }
}
class C1 extends B {
constructor() {
super.x();
super();
}
}
class C2 extends B {
constructor() {
super(super.x());
}
}
@@ -0,0 +1,34 @@
// @target:es5
// @experimentaldecorators: true
declare function dec1<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
declare function dec2<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
class A {
@dec1 get x() { return 0; }
set x(value: number) { }
}
class B {
get x() { return 0; }
@dec2 set x(value: number) { }
}
class C {
@dec1 set x(value: number) { }
get x() { return 0; }
}
class D {
set x(value: number) { }
@dec2 get x() { return 0; }
}
class E {
@dec1 get x() { return 0; }
@dec2 set x(value: number) { }
}
class F {
@dec1 set x(value: number) { }
@dec2 get x() { return 0; }
}
@@ -0,0 +1,32 @@
// @target:es5
// @experimentaldecorators: true
// @emitdecoratormetadata: true
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
class A {
@dec get x() { return 0; }
set x(value: number) { }
}
class B {
get x() { return 0; }
@dec set x(value: number) { }
}
class C {
@dec set x(value: number) { }
get x() { return 0; }
}
class D {
set x(value: number) { }
@dec get x() { return 0; }
}
class E {
@dec get x() { return 0; }
}
class F {
@dec set x(value: number) { }
}
@@ -0,0 +1,18 @@
// @target: es5
// @module: commonjs
// @experimentaldecorators: true
// @emitdecoratormetadata: true
declare var dec: any;
@dec
class A {
}
@dec
class B {
constructor(x: number) {}
}
@dec
class C extends A {
}
@@ -0,0 +1,31 @@
// @declaration: true
type T1 = {
x: T1["x"]; // Error
};
type T2<K extends "x" | "y"> = {
x: T2<K>[K]; // Error
y: number;
}
declare let x2: T2<"x">;
let x2x = x2.x;
interface T3<T extends T3<T>> {
x: T["x"]; // Error
}
interface T4<T extends T4<T>> {
x: T4<T>["x"]; // Error
}
class C1 {
x: C1["x"]; // Error
}
class C2 {
x: this["y"]; // Error
y: this["z"]; // Error
z: this["x"]; // Error
}
@@ -0,0 +1,36 @@
// @declaration: true
// Repro from #12513
function f1<K extends string, T>(obj: { [P in K]: T }, k: K) {
const b = k in obj;
let k1: K;
for (k1 in obj) {
let x1 = obj[k1];
}
for (let k2 in obj) {
let x2 = obj[k2];
}
}
function f2<T>(obj: { [P in keyof T]: T[P] }, k: keyof T) {
const b = k in obj;
let k1: keyof T;
for (k1 in obj) {
let x1 = obj[k1];
}
for (let k2 in obj) {
let x2 = obj[k2];
}
}
function f3<T, K extends keyof T>(obj: { [P in K]: T[P] }, k: K) {
const b = k in obj;
let k1: K;
for (k1 in obj) {
let x1 = obj[k1];
}
for (let k2 in obj) {
let x2 = obj[k2];
}
}
@@ -1,3 +1,4 @@
// @strictNullChecks: true
// @declaration: true
class Shape {
@@ -21,11 +22,12 @@ class Options {
}
type Dictionary<T> = { [x: string]: T };
type NumericallyIndexed<T> = { [x: number]: T };
const enum E { A, B, C }
type K00 = keyof any; // string | number
type K01 = keyof string; // number | "toString" | "charAt" | ...
type K00 = keyof any; // string
type K01 = keyof string; // "toString" | "charAt" | ...
type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ...
type K03 = keyof boolean; // "valueOf"
type K04 = keyof void; // never
@@ -34,19 +36,20 @@ type K06 = keyof null; // never
type K07 = keyof never; // never
type K10 = keyof Shape; // "name" | "width" | "height" | "visible"
type K11 = keyof Shape[]; // number | "length" | "toString" | ...
type K12 = keyof Dictionary<Shape>; // string | number
type K11 = keyof Shape[]; // "length" | "toString" | ...
type K12 = keyof Dictionary<Shape>; // string
type K13 = keyof {}; // never
type K14 = keyof Object; // "constructor" | "toString" | ...
type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ...
type K16 = keyof [string, number]; // number | "0" | "1" | "length" | "toString" | ...
type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ...
type K17 = keyof (Shape | Item); // "name"
type K18 = keyof (Shape & Item); // "name" | "width" | "height" | "visible" | "price"
type K19 = keyof NumericallyIndexed<Shape> // never
type KeyOf<T> = keyof T;
type K20 = KeyOf<Shape>; // "name" | "width" | "height" | "visible"
type K21 = KeyOf<Dictionary<Shape>>; // string | number
type K21 = KeyOf<Dictionary<Shape>>; // string
type NAME = "name";
type WIDTH_OR_HEIGHT = "width" | "height";
@@ -217,6 +220,83 @@ function f60<T>(source: T, target: T) {
}
}
function f70(func: <T, U>(k1: keyof (T | U), k2: keyof (T & U)) => void) {
func<{ a: any, b: any }, { a: any, c: any }>('a', 'a');
func<{ a: any, b: any }, { a: any, c: any }>('a', 'b');
func<{ a: any, b: any }, { a: any, c: any }>('a', 'c');
}
function f71(func: <T, U>(x: T, y: U) => Partial<T & U>) {
let x = func({ a: 1, b: "hello" }, { c: true });
x.a; // number | undefined
x.b; // string | undefined
x.c; // boolean | undefined
}
function f72(func: <T, U, K extends keyof T | keyof U>(x: T, y: U, k: K) => (T & U)[K]) {
let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number
let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string
let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean
}
function f73(func: <T, U, K extends keyof (T & U)>(x: T, y: U, k: K) => (T & U)[K]) {
let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number
let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string
let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean
}
function f74(func: <T, U, K extends keyof (T | U)>(x: T, y: U, k: K) => (T | U)[K]) {
let a = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'a'); // number
let b = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b'); // string | boolean
}
function f80<T extends { a: { x: any } }>(obj: T) {
let a1 = obj.a; // { x: any }
let a2 = obj['a']; // { x: any }
let a3 = obj['a'] as T['a']; // T["a"]
let x1 = obj.a.x; // any
let x2 = obj['a']['x']; // any
let x3 = obj['a']['x'] as T['a']['x']; // T["a"]["x"]
}
function f81<T extends { a: { x: any } }>(obj: T) {
return obj['a']['x'] as T['a']['x'];
}
function f82() {
let x1 = f81({ a: { x: "hello" } }); // string
let x2 = f81({ a: { x: 42 } }); // number
}
function f83<T extends { [x: string]: { x: any } }, K extends keyof T>(obj: T, key: K) {
return obj[key]['x'] as T[K]['x'];
}
function f84() {
let x1 = f83({ foo: { x: "hello" } }, "foo"); // string
let x2 = f83({ bar: { x: 42 } }, "bar"); // number
}
class C1 {
x: number;
get<K extends keyof this>(key: K) {
return this[key];
}
set<K extends keyof this>(key: K, value: this[K]) {
this[key] = value;
}
foo() {
let x1 = this.x; // number
let x2 = this["x"]; // number
let x3 = this.get("x"); // this["x"]
let x4 = getProperty(this, "x"); // this["x"]
this.x = 42;
this["x"] = 42;
this.set("x", 42);
setProperty(this, "x", 42);
}
}
// Repros from #12011
class Base {
@@ -247,4 +327,107 @@ class OtherPerson {
getParts() {
return getProperty(this, "parts")
}
}
}
// Modified repro from #12544
function path<T, K1 extends keyof T>(obj: T, key1: K1): T[K1];
function path<T, K1 extends keyof T, K2 extends keyof T[K1]>(obj: T, key1: K1, key2: K2): T[K1][K2];
function path<T, K1 extends keyof T, K2 extends keyof T[K1], K3 extends keyof T[K1][K2]>(obj: T, key1: K1, key2: K2, key3: K3): T[K1][K2][K3];
function path(obj: any, ...keys: (string | number)[]): any;
function path(obj: any, ...keys: (string | number)[]): any {
let result = obj;
for (let k of keys) {
result = result[k];
}
return result;
}
type Thing = {
a: { x: number, y: string },
b: boolean
};
function f1(thing: Thing) {
let x1 = path(thing, 'a'); // { x: number, y: string }
let x2 = path(thing, 'a', 'y'); // string
let x3 = path(thing, 'b'); // boolean
let x4 = path(thing, ...['a', 'x']); // any
}
// Repro from comment in #12114
const assignTo2 = <T, K1 extends keyof T, K2 extends keyof T[K1]>(object: T, key1: K1, key2: K2) =>
(value: T[K1][K2]) => object[key1][key2] = value;
// Modified repro from #12573
declare function one<T>(handler: (t: T) => void): T
var empty = one(() => {}) // inferred as {}, expected
type Handlers<T> = { [K in keyof T]: (t: T[K]) => void }
declare function on<T>(handlerHash: Handlers<T>): T
var hashOfEmpty1 = on({ test: () => {} }); // {}
var hashOfEmpty2 = on({ test: (x: boolean) => {} }); // { test: boolean }
// Repro from #12624
interface Options1<Data, Computed> {
data?: Data
computed?: Computed;
}
declare class Component1<Data, Computed> {
constructor(options: Options1<Data, Computed>);
get<K extends keyof (Data & Computed)>(key: K): (Data & Computed)[K];
}
let c1 = new Component1({
data: {
hello: ""
}
});
c1.get("hello");
// Repro from #12625
interface Options2<Data, Computed> {
data?: Data
computed?: Computed;
}
declare class Component2<Data, Computed> {
constructor(options: Options2<Data, Computed>);
get<K extends keyof Data | keyof Computed>(key: K): (Data & Computed)[K];
}
// Repro from #12641
interface R {
p: number;
}
function f<K extends keyof R>(p: K) {
let a: any;
a[p].add; // any
}
// Repro from #12651
type MethodDescriptor = {
name: string;
args: any[];
returnValue: any;
}
declare function dispatchMethod<M extends MethodDescriptor>(name: M['name'], args: M['args']): M['returnValue'];
type SomeMethodDescriptor = {
name: "someMethod";
args: [string, number];
returnValue: string[];
}
let result = dispatchMethod<SomeMethodDescriptor>("someMethod", ["hello", 35]);
@@ -65,4 +65,15 @@ function f10(shape: Shape) {
setProperty(shape, "name", "rectangle");
setProperty(shape, "size", 10); // Error
setProperty(shape, cond ? "name" : "size", 10); // Error
}
function f20<T, U>(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) {
o1[k1];
o1[k2]; // Error
o2[k1];
o2[k2];
o1 = o2;
o2 = o1; // Error
k1 = k2; // Error
k2 = k1;
}
@@ -0,0 +1,155 @@
// @strictNullChecks: true
// @noimplicitany: true
// @declaration: true
type Box<T> = {
value: T;
}
type Boxified<T> = {
[P in keyof T]: Box<T[P]>;
}
function box<T>(x: T): Box<T> {
return { value: x };
}
function unbox<T>(x: Box<T>): T {
return x.value;
}
function boxify<T>(obj: T): Boxified<T> {
let result = {} as Boxified<T>;
for (let k in obj) {
result[k] = box(obj[k]);
}
return result;
}
function unboxify<T>(obj: Boxified<T>): T {
let result = {} as T;
for (let k in obj) {
result[k] = unbox(obj[k]);
}
return result;
}
function assignBoxified<T>(obj: Boxified<T>, values: T) {
for (let k in values) {
obj[k].value = values[k];
}
}
function f1() {
let v = {
a: 42,
b: "hello",
c: true
};
let b = boxify(v);
let x: number = b.a.value;
}
function f2() {
let b = {
a: box(42),
b: box("hello"),
c: box(true)
};
let v = unboxify(b);
let x: number = v.a;
}
function f3() {
let b = {
a: box(42),
b: box("hello"),
c: box(true)
};
assignBoxified(b, { c: false });
}
function f4() {
let b = {
a: box(42),
b: box("hello"),
c: box(true)
};
b = boxify(unboxify(b));
b = unboxify(boxify(b));
}
function makeRecord<T, K extends string>(obj: { [P in K]: T }) {
return obj;
}
function f5(s: string) {
let b = makeRecord({
a: box(42),
b: box("hello"),
c: box(true)
});
let v = unboxify(b);
let x: string | number | boolean = v.a;
}
function makeDictionary<T>(obj: { [x: string]: T }) {
return obj;
}
function f6(s: string) {
let b = makeDictionary({
a: box(42),
b: box("hello"),
c: box(true)
});
let v = unboxify(b);
let x: string | number | boolean = v[s];
}
declare function validate<T>(obj: { [P in keyof T]?: T[P] }): T;
declare function clone<T>(obj: { readonly [P in keyof T]: T[P] }): T;
declare function validateAndClone<T>(obj: { readonly [P in keyof T]?: T[P] }): T;
type Foo = {
a?: number;
readonly b: string;
}
function f10(foo: Foo) {
let x = validate(foo); // { a: number, readonly b: string }
let y = clone(foo); // { a?: number, b: string }
let z = validateAndClone(foo); // { a: number, b: string }
}
// Repro from #12606
type Func<T> = (...args: any[]) => T;
type Spec<T> = {
[P in keyof T]: Func<T[P]> | Spec<T[P]> ;
};
/**
* Given a spec object recursively mapping properties to functions, creates a function
* producing an object of the same structure, by mapping each property to the result
* of calling its associated function with the supplied arguments.
*/
declare function applySpec<T>(obj: Spec<T>): (...args: any[]) => T;
// Infers g1: (...args: any[]) => { sum: number, nested: { mul: string } }
var g1 = applySpec({
sum: (a: any) => 3,
nested: {
mul: (b: any) => "n"
}
});
// Infers g2: (...args: any[]) => { foo: { bar: { baz: boolean } } }
var g2 = applySpec({ foo: { bar: { baz: (x: any) => true } } });
// Repro from #12633
const foo = <T>(object: T, partial: Partial<T>) => object;
let o = {a: 5, b: 7};
foo(o, {b: 9});
o = foo(o, {b: 9});
@@ -67,4 +67,61 @@ function f11<T>() {
function f12<T>() {
var x: { [P in keyof T]: T[P] };
var x: { [P in keyof T]: T[P][] }; // Error
}
}
// Check that inferences to mapped types are secondary
declare function objAndReadonly<T>(primary: T, secondary: Readonly<T>): T;
declare function objAndPartial<T>(primary: T, secondary: Partial<T>): T;
function f20() {
let x1 = objAndReadonly({ x: 0, y: 0 }, { x: 1 }); // Error
let x2 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1 });
let x3 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error
}
function f21() {
let x1 = objAndPartial({ x: 0, y: 0 }, { x: 1 });
let x2 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1 });
let x3 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error
}
// Verify use of Pick<T, K> for setState functions (#12793)
interface Foo {
a: string;
b?: number;
}
function setState<T, K extends keyof T>(obj: T, props: Pick<T, K>) {
for (let k in props) {
obj[k] = props[k];
}
}
let foo: Foo = { a: "hello", b: 42 };
setState(foo, { a: "test", b: 43 })
setState(foo, { a: "hi" });
setState(foo, { b: undefined });
setState(foo, { });
setState(foo, foo);
setState(foo, { a: undefined }); // Error
setState(foo, { c: true }); // Error
class C<T> {
state: T;
setState<K extends keyof T>(props: Pick<T, K>) {
for (let k in props) {
this.state[k] = props[k];
}
}
}
let c = new C<Foo>();
c.setState({ a: "test", b: 43 });
c.setState({ a: "hi" });
c.setState({ b: undefined });
c.setState({ });
c.setState(foo);
c.setState({ a: undefined }); // Error
c.setState({ c: true }); // Error
@@ -0,0 +1,77 @@
// @strictNullChecks: true
type T = { a: number, b: string };
type TP = { a?: number, b?: string };
type TR = { readonly a: number, readonly b: string };
type TPR = { readonly a?: number, readonly b?: string };
var v00: "a" | "b";
var v00: keyof T;
var v00: keyof TP;
var v00: keyof TR;
var v00: keyof TPR;
var v01: T;
var v01: { [P in keyof T]: T[P] };
var v01: Pick<T, keyof T>;
var v01: Pick<Pick<T, keyof T>, keyof T>;
var v02: TP;
var v02: { [P in keyof T]?: T[P] };
var v02: Partial<T>;
var v02: { [P in keyof TP]: TP[P] }
var v02: Pick<TP, keyof TP>;
var v03: TR;
var v03: { readonly [P in keyof T]: T[P] };
var v03: Readonly<T>;
var v03: { [P in keyof TR]: TR[P] }
var v03: Pick<TR, keyof TR>;
var v04: TPR;
var v04: { readonly [P in keyof T]?: T[P] };
var v04: Partial<TR>;
var v04: Readonly<TP>;
var v04: Partial<Readonly<T>>;
var v04: Readonly<Partial<T>>;
var v04: { [P in keyof TPR]: TPR[P] }
var v04: Pick<TPR, keyof T>;
type Boxified<T> = { [P in keyof T]: { x: T[P] } };
type B = { a: { x: number }, b: { x: string } };
type BP = { a?: { x: number }, b?: { x: string } };
type BR = { readonly a: { x: number }, readonly b: { x: string } };
type BPR = { readonly a?: { x: number }, readonly b?: { x: string } };
var b00: "a" | "b";
var b00: keyof B;
var b00: keyof BP;
var b00: keyof BR;
var b00: keyof BPR;
var b01: B;
var b01: { [P in keyof B]: B[P] };
var b01: Pick<B, keyof B>;
var b01: Pick<Pick<B, keyof B>, keyof B>;
var b02: BP;
var b02: { [P in keyof B]?: B[P] };
var b02: Partial<B>;
var b02: { [P in keyof BP]: BP[P] }
var b02: Pick<BP, keyof BP>;
var b03: BR;
var b03: { readonly [P in keyof B]: B[P] };
var b03: Readonly<B>;
var b03: { [P in keyof BR]: BR[P] }
var b03: Pick<BR, keyof BR>;
var b04: BPR;
var b04: { readonly [P in keyof B]?: B[P] };
var b04: Partial<BR>;
var b04: Readonly<BP>;
var b04: Partial<Readonly<B>>;
var b04: Readonly<Partial<B>>;
var b04: { [P in keyof BPR]: BPR[P] }
var b04: Pick<BPR, keyof BPR>;
@@ -34,7 +34,9 @@ type T47 = { [P in string | "a" | "b" | "0" | "1"]: void };
declare function f1<T1>(): { [P in keyof T1]: void };
declare function f2<T1 extends string>(): { [P in keyof T1]: void };
declare function f3<T1 extends number>(): { [P in keyof T1]: void };
declare function f4<T1 extends Number>(): { [P in keyof T1]: void };
let x1 = f1();
let x2 = f2();
let x3 = f3();
let x3 = f3();
let x4 = f4();
@@ -31,25 +31,30 @@ declare function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K>;
declare function mapObject<K extends string, T, U>(obj: Record<K, T>, f: (x: T) => U): Record<K, U>;
declare function proxify<T>(obj: T): Proxify<T>;
interface Point {
x: number;
y: number;
}
interface Shape {
name: string;
width: number;
height: number;
visible: boolean;
location: Point;
}
interface PartialShape {
name?: string;
width?: number;
height?: number;
visible?: boolean;
location?: Point;
}
interface ReadonlyShape {
readonly name: string;
readonly width: number;
readonly height: number;
readonly visible: boolean;
readonly location: Point;
}
function f0(s1: Shape, s2: Shape) {
@@ -70,7 +75,7 @@ function f2(shape: Shape) {
}
function f3(shape: Shape) {
const x = pick(shape, "name", "visible"); // { name: string, visible: boolean }
const x = pick(shape, "name", "location"); // { name: string, location: Point }
}
function f4() {
@@ -81,11 +86,11 @@ function f4() {
function f5(shape: Shape) {
const p = proxify(shape);
let name = p.name.get();
p.visible.set(false);
p.width.set(42);
}
function f6(shape: DeepReadonly<Shape>) {
let name = shape.name; // DeepReadonly<string>
let length = name.length; // DeepReadonly<number>
let toString = length.toString; // DeepReadonly<(radix?: number) => string>
let name = shape.name; // string
let location = shape.location; // DeepReadonly<Point>
let x = location.x; // number
}
@@ -0,0 +1,62 @@
// @strictNullChecks: true
// @declaration: true
type Box<T> = {
};
type Boxified<T> = {
[P in keyof T]: Box<T[P]>;
};
function boxify<T>(obj: T): Boxified<T> {
if (typeof obj === "object") {
let result = {} as Boxified<T>;
for (let k in obj) {
result[k] = { value: obj[k] };
}
return result;
}
return <any>obj;
}
type A = { a: string };
type B = { b: string };
type C = { c: string };
function f1(x: A | B | C | undefined) {
return boxify(x);
}
type T00 = Partial<A | B | C>;
type T01 = Readonly<A | B | C | null | undefined>;
type T02 = Boxified<A | B[] | C | string>
type T03 = Readonly<string | number | boolean | null | undefined | void>;
type T04 = Boxified<string | number | boolean | null | undefined | void>;
type T05 = Partial<"hello" | "world" | 42>;
type BoxifiedWithSentinel<T, U> = {
[P in keyof T]: Box<T[P]> | U;
}
type T10 = BoxifiedWithSentinel<A | B | C, null>;
type T11 = BoxifiedWithSentinel<A | B | C, undefined>;
type T12 = BoxifiedWithSentinel<string, undefined>;
type DeepReadonly<T> = {
readonly [P in keyof T]: DeepReadonly<T[P]>;
};
type Foo = {
x: number;
y: { a: string, b: number };
z: boolean;
};
type DeepReadonlyFoo = {
readonly x: number;
readonly y: { readonly a: string, readonly b: number };
readonly z: boolean;
};
var x1: DeepReadonly<Foo>;
var x1: DeepReadonlyFoo;
@@ -36,3 +36,5 @@ let computed = 'b';
let computed2 = 'a';
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject['anythingGoes'];
@@ -1,3 +1,4 @@
// @noImplicitAny: true
let o = { a: 1, b: 'no' };
var { ...mustBeLast, a } = o;
@@ -15,3 +16,5 @@ function generic<T extends { x, y }>(t: T) {
let rest: { b: string }
({a, ...rest.b + rest.b} = o);
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes;
@@ -29,9 +29,7 @@ spread = b; // error, missing 's'
let duplicated = { b: 'bad', ...o, b: 'bad', ...o2, b: 'bad' }
let duplicatedSpread = { ...o, ...o }
// null, undefined and primitives are not allowed
let spreadNull = { ...null };
let spreadUndefind = { ...undefined };
// primitives are not allowed
let spreadNum = { ...12 };
let spreadSum = { ...1 + 1 };
spreadSum.toFixed(); // error, no methods from number
+3 -3
View File
@@ -7,6 +7,6 @@
goTo.eof();
edit.insert('t.');
verify.memberListContains('x');
verify.memberListContains('y');
verify.not.memberListContains('z');
verify.completionListContains('x');
verify.completionListContains('y');
verify.not.completionListContains('z');
@@ -14,10 +14,10 @@
//// }
goTo.marker('1');
verify.not.isValidBraceCompletionAtPosition('(');
verify.isValidBraceCompletionAtPosition('(');
goTo.marker('2');
verify.not.isValidBraceCompletionAtPosition('(');
verify.isValidBraceCompletionAtPosition('(');
goTo.marker('3');
verify.not.isValidBraceCompletionAtPosition('(');
verify.isValidBraceCompletionAtPosition('(');
+167 -167
View File
@@ -139,18 +139,18 @@ verify.quickInfos({
});
goTo.marker('4');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('5');
verify.completionListContains("b", "(parameter) b: number", "number to add");
@@ -158,18 +158,18 @@ verify.completionListContains("b", "(parameter) b: number", "number to add");
verify.quickInfoAt("6", "(property) c1.p3: number", "getter property 1\nsetter property 1");
goTo.marker('7');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("sum with property");
@@ -177,48 +177,48 @@ verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.quickInfoAt("8q", "(method) c1.p2(b: number): number", "sum with property");
goTo.marker('9');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.quickInfoAt("10", "(property) c1.p3: number", "getter property 1\nsetter property 1");
goTo.marker('11');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('12');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("sum with property");
@@ -232,18 +232,18 @@ verify.quickInfos({
});
goTo.marker('16');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('17');
verify.completionListContains("b", "(parameter) b: number", "number to add");
@@ -251,18 +251,18 @@ verify.completionListContains("b", "(parameter) b: number", "number to add");
verify.quickInfoAt("18", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
goTo.marker('19');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("sum with property");
@@ -270,48 +270,48 @@ verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.quickInfoAt("20q", "(method) c1.pp2(b: number): number", "sum with property");
goTo.marker('21');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.quickInfoAt("22", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
goTo.marker('23');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('24');
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.memberListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.memberListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.memberListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.memberListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.memberListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("pp1", "(property) c1.pp1: number", "pp1 is property of c1");
verify.completionListContains("pp2", "(method) c1.pp2(b: number): number", "sum with property");
verify.completionListContains("pp3", "(property) c1.pp3: number", "getter property 2\nsetter property 2");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("sum with property");
@@ -329,12 +329,12 @@ goTo.marker('29');
verify.completionListContains("c1", "class c1", "This is comment for c1");
goTo.marker('30');
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
goTo.marker('31');
verify.completionListContains("b", "(parameter) b: number", "number to add");
@@ -345,12 +345,12 @@ goTo.marker('33');
verify.completionListContains("c1", "class c1", "This is comment for c1");
goTo.marker('34');
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
goTo.marker('35');
verify.currentSignatureHelpDocCommentIs("static sum with property");
@@ -359,12 +359,12 @@ verify.completionListContains("c1", "class c1", "This is comment for c1");
verify.quickInfoAt("35q", "(method) c1.s2(b: number): number", "static sum with property");
goTo.marker('36');
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.quickInfoAt("37", "(property) c1.s3: number", "static getter property\nsetter property 3");
@@ -372,23 +372,23 @@ goTo.marker('38');
verify.completionListContains("c1", "class c1", "This is comment for c1");
goTo.marker('39');
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
goTo.marker('40');
verify.completionListContains("c1", "class c1", "This is comment for c1");
goTo.marker('41');
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("static sum with property");
@@ -477,12 +477,12 @@ verify.quickInfos({
goTo.marker("67");
verify.quickInfoIs("(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.memberListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.memberListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.memberListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.memberListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.completionListContains("p1", "(property) c1.p1: number", "p1 is property of c1");
verify.completionListContains("p2", "(method) c1.p2(b: number): number", "sum with property");
verify.completionListContains("p3", "(property) c1.p3: number", "getter property 1\nsetter property 1");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "");
verify.completionListContains("nc_p2", "(method) c1.nc_p2(b: number): number", "");
verify.completionListContains("nc_p3", "(property) c1.nc_p3: number", "");
verify.quickInfos({
68: "var i1_f: (b: number) => number",
@@ -526,12 +526,12 @@ verify.completionListContains("c1", "class c1", "This is comment for c1");
goTo.marker('88');
verify.quickInfoIs("(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.memberListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.memberListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.memberListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.memberListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.memberListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.completionListContains("s1", "(property) c1.s1: number", "s1 is static property of c1");
verify.completionListContains("s2", "(method) c1.s2(b: number): number", "static sum with property");
verify.completionListContains("s3", "(property) c1.s3: number", "static getter property\nsetter property 3");
verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");
verify.quickInfos({
89: "var i1_s_f: (b: number) => number",
@@ -593,10 +593,10 @@ verify.completionListContains("i1_c", "var i1_c: typeof c1", "");
goTo.marker('110');
verify.quickInfoIs("(property) cProperties.p2: number", "setter only property");
verify.memberListContains("p1", "(property) cProperties.p1: number", "getter only property");
verify.memberListContains("p2", "(property) cProperties.p2: number", "setter only property");
verify.memberListContains("nc_p1", "(property) cProperties.nc_p1: number", "");
verify.memberListContains("nc_p2", "(property) cProperties.nc_p2: number", "");
verify.completionListContains("p1", "(property) cProperties.p1: number", "getter only property");
verify.completionListContains("p2", "(property) cProperties.p2: number", "setter only property");
verify.completionListContains("nc_p1", "(property) cProperties.nc_p1: number", "");
verify.completionListContains("nc_p2", "(property) cProperties.nc_p2: number", "");
verify.quickInfos({
111: ["(property) cProperties.p1: number", "getter only property"],
@@ -605,7 +605,7 @@ verify.quickInfos({
});
goTo.marker('114');
verify.memberListContains("a", "(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a");
verify.completionListContains("a", "(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a");
verify.quickInfoIs("(property) cWithConstructorProperty.a: number", "this is first parameter a\nmore info about a");
goTo.marker('115');
+4 -4
View File
@@ -22,11 +22,11 @@ verify.completionListContains("Colors", "enum Colors", "Enum of colors");
verify.quickInfoIs("enum Colors", "Enum of colors");
goTo.marker('6');
verify.memberListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'");
verify.memberListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'");
verify.completionListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'");
verify.completionListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'");
verify.quickInfoIs("(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'");
goTo.marker('7');
verify.memberListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'");
verify.memberListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'");
verify.completionListContains("Cornflower", "(enum member) Colors.Cornflower = 0", "Fancy name for 'blue'");
verify.completionListContains("FancyPink", "(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'");
verify.quickInfoIs("(enum member) Colors.FancyPink = 1", "Fancy name for 'pink'");
@@ -46,9 +46,9 @@ goTo.marker('4');
verify.completionListContains("m1", "namespace m1", "Namespace comment");
goTo.marker('5');
verify.memberListContains("b", "var m1.b: number", "b's comment");
verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.memberListContains("m2", "namespace m1.m2");
verify.completionListContains("b", "var m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace m1.m2");
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("exported function");
@@ -57,8 +57,8 @@ verify.quickInfoAt("6q", "function m1.fooExport(): number", "exported function")
verify.quickInfoAt("7", "var myvar: m1.m2.c");
goTo.marker('8');
verify.memberListContains("c", "constructor m1.m2.c(): m1.m2.c", "");
verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i");
verify.completionListContains("c", "constructor m1.m2.c(): m1.m2.c", "");
verify.completionListContains("i", "var m1.m2.i: m1.m2.c", "i");
goTo.file("commentsExternalModules_file1.ts");
verify.quickInfoAt("9", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration");
@@ -67,12 +67,12 @@ goTo.marker('10');
verify.completionListContains("extMod", 'import extMod = require("./commentsExternalModules_file0")', "This is on import declaration");
goTo.marker('11');
verify.memberListContains("m1", "namespace extMod.m1");
verify.completionListContains("m1", "namespace extMod.m1");
goTo.marker('12');
verify.memberListContains("b", "var extMod.m1.b: number", "b's comment");
verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.memberListContains("m2", "namespace extMod.m1.m2");
verify.completionListContains("b", "var extMod.m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace extMod.m1.m2");
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("exported function");
@@ -81,5 +81,5 @@ verify.quickInfoAt("13q", "function extMod.m1.fooExport(): number", "exported fu
verify.quickInfoAt("14", "var newVar: extMod.m1.m2.c");
goTo.marker('15');
verify.memberListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", "");
verify.memberListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i");
verify.completionListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", "");
verify.completionListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i");
@@ -30,12 +30,12 @@ verify.quickInfos({
});
goTo.marker('6');
verify.memberListContains("m1", "namespace extMod.m1");
verify.completionListContains("m1", "namespace extMod.m1");
goTo.marker('7');
verify.memberListContains("b", "var extMod.m1.b: number", "b's comment");
verify.memberListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.memberListContains("m2", "namespace extMod.m1.m2");
verify.completionListContains("b", "var extMod.m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace extMod.m1.m2");
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("exported function");
@@ -45,5 +45,5 @@ verify.quickInfos({
});
goTo.marker('10');
verify.memberListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", "");
verify.memberListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i");
verify.completionListContains("c", "constructor extMod.m1.m2.c(): extMod.m1.m2.c", "");
verify.completionListContains("i", "var extMod.m1.m2.i: extMod.m1.m2.c", "i");
+108 -108
View File
@@ -221,18 +221,18 @@
////}
goTo.marker('1');
verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1");
verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1");
verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "");
verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", "");
verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", "");
verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) i1.p1: number", "");
verify.memberListContains("f1", "(method) i1.f1(): void", "");
verify.memberListContains("l1", "(property) i1.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.memberListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
verify.completionListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1");
verify.completionListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1");
verify.completionListContains("i1_l1", "(property) i1.i1_l1: () => void", "");
verify.completionListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", "");
verify.completionListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", "");
verify.completionListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) i1.p1: number", "");
verify.completionListContains("f1", "(method) i1.f1(): void", "");
verify.completionListContains("l1", "(property) i1.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
goTo.marker('2');
verify.currentSignatureHelpDocCommentIs("i1_f1");
goTo.marker('3');
@@ -263,18 +263,18 @@ verify.quickInfos({
});
goTo.marker('6');
verify.memberListContains("i1_p1", "(property) c1.i1_p1: number", "");
verify.memberListContains("i1_f1", "(method) c1.i1_f1(): void", "");
verify.memberListContains("i1_l1", "(property) c1.i1_l1: () => void", "");
verify.memberListContains("i1_nc_p1", "(property) c1.i1_nc_p1: number", "");
verify.memberListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", "");
verify.memberListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) c1.p1: number", "c1_p1");
verify.memberListContains("f1", "(method) c1.f1(): void", "c1_f1");
verify.memberListContains("l1", "(property) c1.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1");
verify.memberListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1");
verify.memberListContains("nc_l1", "(property) c1.nc_l1: () => void", "");
verify.completionListContains("i1_p1", "(property) c1.i1_p1: number", "");
verify.completionListContains("i1_f1", "(method) c1.i1_f1(): void", "");
verify.completionListContains("i1_l1", "(property) c1.i1_l1: () => void", "");
verify.completionListContains("i1_nc_p1", "(property) c1.i1_nc_p1: number", "");
verify.completionListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", "");
verify.completionListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) c1.p1: number", "c1_p1");
verify.completionListContains("f1", "(method) c1.f1(): void", "c1_f1");
verify.completionListContains("l1", "(property) c1.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1");
verify.completionListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1");
verify.completionListContains("nc_l1", "(property) c1.nc_l1: () => void", "");
goTo.marker('7');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('8');
@@ -305,18 +305,18 @@ verify.quickInfos({
});
goTo.marker('11');
verify.memberListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1");
verify.memberListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1");
verify.memberListContains("i1_l1", "(property) i1.i1_l1: () => void", "");
verify.memberListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", "");
verify.memberListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", "");
verify.memberListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) i1.p1: number", "");
verify.memberListContains("f1", "(method) i1.f1(): void", "");
verify.memberListContains("l1", "(property) i1.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.memberListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
verify.completionListContains("i1_p1", "(property) i1.i1_p1: number", "i1_p1");
verify.completionListContains("i1_f1", "(method) i1.i1_f1(): void", "i1_f1");
verify.completionListContains("i1_l1", "(property) i1.i1_l1: () => void", "");
verify.completionListContains("i1_nc_p1", "(property) i1.i1_nc_p1: number", "");
verify.completionListContains("i1_nc_f1", "(method) i1.i1_nc_f1(): void", "");
verify.completionListContains("i1_nc_l1", "(property) i1.i1_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) i1.p1: number", "");
verify.completionListContains("f1", "(method) i1.f1(): void", "");
verify.completionListContains("l1", "(property) i1.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("i1_f1");
goTo.marker('13');
@@ -376,18 +376,18 @@ verify.quickInfos({
});
goTo.marker('19');
verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", "");
verify.memberListContains("p1", "(property) c2.p1: number", "c2 p1");
verify.memberListContains("f1", "(method) c2.f1(): void", "c2 f1");
verify.memberListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.memberListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.memberListContains("nc_prop", "(property) c2.nc_prop: number", "");
verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", "");
verify.completionListContains("p1", "(property) c2.p1: number", "c2 p1");
verify.completionListContains("f1", "(method) c2.f1(): void", "c2 f1");
verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", "");
goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('21');
@@ -405,18 +405,18 @@ verify.quickInfos({
});
goTo.marker('24');
verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", "");
verify.memberListContains("p1", "(property) c3.p1: number", "c3 p1");
verify.memberListContains("f1", "(method) c3.f1(): void", "c3 f1");
verify.memberListContains("prop", "(property) c3.prop: number", "c3 prop");
verify.memberListContains("nc_p1", "(property) c3.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) c3.nc_f1(): void", "");
verify.memberListContains("nc_prop", "(property) c3.nc_prop: number", "");
verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number", "");
verify.completionListContains("p1", "(property) c3.p1: number", "c3 p1");
verify.completionListContains("f1", "(method) c3.f1(): void", "c3 f1");
verify.completionListContains("prop", "(property) c3.prop: number", "c3 prop");
verify.completionListContains("nc_p1", "(property) c3.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c3.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c3.nc_prop: number", "");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('26');
@@ -434,18 +434,18 @@ verify.quickInfos({
});
goTo.marker('29');
verify.memberListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.memberListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.memberListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.memberListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.memberListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.memberListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number");
verify.memberListContains("p1", "(property) c2.p1: number", "c2 p1");
verify.memberListContains("f1", "(method) c2.f1(): void", "c2 f1");
verify.memberListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.memberListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.memberListContains("nc_prop", "(property) c2.nc_prop: number", "");
verify.completionListContains("c2_p1", "(property) c2.c2_p1: number", "c2 c2_p1");
verify.completionListContains("c2_f1", "(method) c2.c2_f1(): void", "c2 c2_f1");
verify.completionListContains("c2_prop", "(property) c2.c2_prop: number", "c2 c2_prop");
verify.completionListContains("c2_nc_p1", "(property) c2.c2_nc_p1: number", "");
verify.completionListContains("c2_nc_f1", "(method) c2.c2_nc_f1(): void", "");
verify.completionListContains("c2_nc_prop", "(property) c2.c2_nc_prop: number");
verify.completionListContains("p1", "(property) c2.p1: number", "c2 p1");
verify.completionListContains("f1", "(method) c2.f1(): void", "c2 f1");
verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", "");
goTo.marker('30');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('31');
@@ -478,18 +478,18 @@ verify.completionListContains("c4", "class c4", "");
verify.completionListContains("c4_i", "var c4_i: c4", "");
goTo.marker('36');
verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1");
verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1");
verify.memberListContains("l1", "(property) i2.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) i2.p1: number", "i2 p1");
verify.completionListContains("f1", "(method) i2.f1(): void", "i2 f1");
verify.completionListContains("l1", "(property) i2.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
goTo.marker('37');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('38');
@@ -521,18 +521,18 @@ verify.quickInfos({
});
goTo.marker('41');
verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) i3.p1: number", "i3 p1");
verify.memberListContains("f1", "(method) i3.f1(): void", "i3 f1");
verify.memberListContains("l1", "(property) i3.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) i3.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) i3.nc_f1(): void", "");
verify.memberListContains("nc_l1", "(property) i3.nc_l1: () => void", "");
verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) i3.p1: number", "i3 p1");
verify.completionListContains("f1", "(method) i3.f1(): void", "i3 f1");
verify.completionListContains("l1", "(property) i3.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i3.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i3.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i3.nc_l1: () => void", "");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('43');
@@ -562,18 +562,18 @@ verify.quickInfos({
});
goTo.marker('46');
verify.memberListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.memberListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.memberListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.memberListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.memberListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.memberListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.memberListContains("p1", "(property) i2.p1: number", "i2 p1");
verify.memberListContains("f1", "(method) i2.f1(): void", "i2 f1");
verify.memberListContains("l1", "(property) i2.l1: () => void", "");
verify.memberListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.memberListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.memberListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
verify.completionListContains("i2_p1", "(property) i2.i2_p1: number", "i2_p1");
verify.completionListContains("i2_f1", "(method) i2.i2_f1(): void", "i2_f1");
verify.completionListContains("i2_l1", "(property) i2.i2_l1: () => void", "");
verify.completionListContains("i2_nc_p1", "(property) i2.i2_nc_p1: number", "");
verify.completionListContains("i2_nc_f1", "(method) i2.i2_nc_f1(): void", "");
verify.completionListContains("i2_nc_l1", "(property) i2.i2_nc_l1: () => void", "");
verify.completionListContains("p1", "(property) i2.p1: number", "i2 p1");
verify.completionListContains("f1", "(method) i2.f1(): void", "i2 f1");
verify.completionListContains("l1", "(property) i2.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('48');
+12 -12
View File
@@ -80,12 +80,12 @@ verify.quickInfos({
goTo.marker('8');
verify.quickInfoIs("(property) i2.x: number", "this is x");
verify.memberListContains("x", "(property) i2.x: number", "this is x");
verify.memberListContains("foo", "(property) i2.foo: (b: number) => string", "this is foo");
verify.memberListContains("nc_x", "(property) i2.nc_x: number", "");
verify.memberListContains("nc_foo", "(property) i2.nc_foo: (b: number) => string", "");
verify.memberListContains("fnfoo", "(method) i2.fnfoo(b: number): string", "this is fnfoo");
verify.memberListContains("nc_fnfoo", "(method) i2.nc_fnfoo(b: number): string", "");
verify.completionListContains("x", "(property) i2.x: number", "this is x");
verify.completionListContains("foo", "(property) i2.foo: (b: number) => string", "this is foo");
verify.completionListContains("nc_x", "(property) i2.nc_x: number", "");
verify.completionListContains("nc_foo", "(property) i2.nc_foo: (b: number) => string", "");
verify.completionListContains("fnfoo", "(method) i2.fnfoo(b: number): string", "this is fnfoo");
verify.completionListContains("nc_fnfoo", "(method) i2.nc_fnfoo(b: number): string", "");
verify.quickInfos({
9: "var i2_i_foo: (b: number) => string",
@@ -199,12 +199,12 @@ verify.completionListContains("i3_i", "var i3_i: i3", "");
goTo.marker('41');
verify.quickInfoIs("(method) i3.f(a: number): string", "Function i3 f");
verify.memberListContains("f", "(method) i3.f(a: number): string", "Function i3 f");
verify.memberListContains("l", "(property) i3.l: (b: number) => string", "");
verify.memberListContains("x", "(property) i3.x: number", "Comment i3 x");
verify.memberListContains("nc_f", "(method) i3.nc_f(a: number): string", "");
verify.memberListContains("nc_l", "(property) i3.nc_l: (b: number) => string", "");
verify.memberListContains("nc_x", "(property) i3.nc_x: number", "");
verify.completionListContains("f", "(method) i3.f(a: number): string", "Function i3 f");
verify.completionListContains("l", "(property) i3.l: (b: number) => string", "");
verify.completionListContains("x", "(property) i3.x: number", "Comment i3 x");
verify.completionListContains("nc_f", "(method) i3.nc_f(a: number): string", "");
verify.completionListContains("nc_l", "(property) i3.nc_l: (b: number) => string", "");
verify.completionListContains("nc_x", "(property) i3.nc_x: number", "");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("Function i3 f");
@@ -105,6 +105,14 @@
//// * second time information about the param again
//// */
////function /*l*/l(param1: string) { /*9*/param1 = "hello"; }
//// /**
//// * This is firstLine
//// This is second Line
//// [1]: third * line
//// @param param1 first Line text
//// second line text
//// */
////function /*m*/m(param1: string) { /*10*/param1 = "hello"; }
verify.quickInfos({
a: ["var a: string", "This is firstLine\nThis is second Line\n\nThis is fourth Line"],
@@ -136,5 +144,8 @@ verify.quickInfos({
8: ["(parameter) param1: string", "hello "],
l: ["function l(param1: string): void", "This is firstLine\nThis is second Line"],
9: ["(parameter) param1: string", "first Line text\nblank line that shouldnt be shown when starting this \nsecond time information about the param again"]
9: ["(parameter) param1: string", "first Line text\nblank line that shouldnt be shown when starting this \nsecond time information about the param again"],
m: ["function m(param1: string): void", "This is firstLine\nThis is second Line\n[1]: third * line"],
10: ["(parameter) param1: string", "first Line text\nsecond line text"]
});
+24 -24
View File
@@ -110,9 +110,9 @@ goTo.marker('4');
verify.completionListContains("m1", "namespace m1", "Namespace comment");
goTo.marker('5');
verify.memberListContains("b", "var m1.b: number", "b's comment");
verify.memberListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.memberListContains("m2", "namespace m1.m2");
verify.completionListContains("b", "var m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace m1.m2");
verify.quickInfoIs("function m1.fooExport(): number", "exported function");
goTo.marker('6');
@@ -122,55 +122,55 @@ verify.quickInfoAt("7", "var myvar: m1.m2.c");
goTo.marker('8');
verify.quickInfoIs("constructor m1.m2.c(): m1.m2.c");
verify.memberListContains("c", "constructor m1.m2.c(): m1.m2.c", "");
verify.memberListContains("i", "var m1.m2.i: m1.m2.c", "i");
verify.completionListContains("c", "constructor m1.m2.c(): m1.m2.c", "");
verify.completionListContains("i", "var m1.m2.i: m1.m2.c", "i");
goTo.marker('9');
verify.completionListContains("m2", "namespace m2", "namespace comment of m2.m3");
verify.quickInfoIs("namespace m2", "namespace comment of m2.m3");
goTo.marker('10');
verify.memberListContains("m3", "namespace m2.m3");
verify.completionListContains("m3", "namespace m2.m3");
verify.quickInfoIs("namespace m2.m3", "namespace comment of m2.m3");
goTo.marker('11');
verify.quickInfoIs("constructor m2.m3.c(): m2.m3.c");
verify.memberListContains("c", "constructor m2.m3.c(): m2.m3.c", "");
verify.completionListContains("c", "constructor m2.m3.c(): m2.m3.c", "");
goTo.marker('12');
verify.completionListContains("m3", "namespace m3", "namespace comment of m3.m4.m5");
verify.quickInfoIs("namespace m3", "namespace comment of m3.m4.m5");
goTo.marker('13');
verify.memberListContains("m4", "namespace m3.m4", "namespace comment of m3.m4.m5");
verify.completionListContains("m4", "namespace m3.m4", "namespace comment of m3.m4.m5");
verify.quickInfoIs("namespace m3.m4", "namespace comment of m3.m4.m5");
goTo.marker('14');
verify.memberListContains("m5", "namespace m3.m4.m5");
verify.completionListContains("m5", "namespace m3.m4.m5");
verify.quickInfoIs("namespace m3.m4.m5", "namespace comment of m3.m4.m5");
goTo.marker('15');
verify.quickInfoIs("constructor m3.m4.m5.c(): m3.m4.m5.c");
verify.memberListContains("c", "constructor m3.m4.m5.c(): m3.m4.m5.c", "");
verify.completionListContains("c", "constructor m3.m4.m5.c(): m3.m4.m5.c", "");
goTo.marker('16');
verify.completionListContains("m4", "namespace m4", "namespace comment of m4.m5.m6");
verify.quickInfoIs("namespace m4", "namespace comment of m4.m5.m6");
goTo.marker('17');
verify.memberListContains("m5", "namespace m4.m5", "namespace comment of m4.m5.m6");
verify.completionListContains("m5", "namespace m4.m5", "namespace comment of m4.m5.m6");
verify.quickInfoIs("namespace m4.m5", "namespace comment of m4.m5.m6");
goTo.marker('18');
verify.memberListContains("m6", "namespace m4.m5.m6");
verify.completionListContains("m6", "namespace m4.m5.m6");
verify.quickInfoIs("namespace m4.m5.m6", "namespace comment of m4.m5.m6");
goTo.marker('19');
verify.memberListContains("m7", "namespace m4.m5.m6.m7");
verify.completionListContains("m7", "namespace m4.m5.m6.m7");
verify.quickInfoIs("namespace m4.m5.m6.m7");
goTo.marker('20');
verify.memberListContains("c", "constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", "");
verify.completionListContains("c", "constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c", "");
verify.quickInfoIs("constructor m4.m5.m6.m7.c(): m4.m5.m6.m7.c");
goTo.marker('21');
@@ -178,19 +178,19 @@ verify.completionListContains("m5", "namespace m5");
verify.quickInfoIs("namespace m5", "namespace comment of m5.m6.m7");
goTo.marker('22');
verify.memberListContains("m6", "namespace m5.m6");
verify.completionListContains("m6", "namespace m5.m6");
verify.quickInfoIs("namespace m5.m6", "namespace comment of m5.m6.m7");
goTo.marker('23');
verify.memberListContains("m7", "namespace m5.m6.m7");
verify.completionListContains("m7", "namespace m5.m6.m7");
verify.quickInfoIs("namespace m5.m6.m7", "namespace comment of m5.m6.m7");
goTo.marker('24');
verify.memberListContains("m8", "namespace m5.m6.m7.m8");
verify.completionListContains("m8", "namespace m5.m6.m7.m8");
verify.quickInfoIs("namespace m5.m6.m7.m8", "namespace m8 comment");
goTo.marker('25');
verify.memberListContains("c", "constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", "");
verify.completionListContains("c", "constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c", "");
verify.quickInfoIs("constructor m5.m6.m7.m8.c(): m5.m6.m7.m8.c");
goTo.marker('26');
@@ -198,15 +198,15 @@ verify.completionListContains("m6", "namespace m6");
verify.quickInfoIs("namespace m6");
goTo.marker('27');
verify.memberListContains("m7", "namespace m6.m7");
verify.completionListContains("m7", "namespace m6.m7");
verify.quickInfoIs("namespace m6.m7");
goTo.marker('28');
verify.memberListContains("m8", "namespace m6.m7.m8");
verify.completionListContains("m8", "namespace m6.m7.m8");
verify.quickInfoIs("namespace m6.m7.m8");
goTo.marker('29');
verify.memberListContains("c", "constructor m6.m7.m8.c(): m6.m7.m8.c", "");
verify.completionListContains("c", "constructor m6.m7.m8.c(): m6.m7.m8.c", "");
verify.quickInfoIs("constructor m6.m7.m8.c(): m6.m7.m8.c");
goTo.marker('30');
@@ -214,15 +214,15 @@ verify.completionListContains("m7", "namespace m7");
verify.quickInfoIs("namespace m7");
goTo.marker('31');
verify.memberListContains("m8", "namespace m7.m8");
verify.completionListContains("m8", "namespace m7.m8");
verify.quickInfoIs("namespace m7.m8");
goTo.marker('32');
verify.memberListContains("m9", "namespace m7.m8.m9");
verify.completionListContains("m9", "namespace m7.m8.m9");
verify.quickInfoIs("namespace m7.m8.m9", "namespace m9 comment");
goTo.marker('33');
verify.memberListContains("c", "constructor m7.m8.m9.c(): m7.m8.m9.c", "");
verify.completionListContains("c", "constructor m7.m8.m9.c(): m7.m8.m9.c", "");
verify.quickInfoIs("constructor m7.m8.m9.c(): m7.m8.m9.c");
goTo.marker('34');
+9 -9
View File
@@ -326,10 +326,10 @@ goTo.marker('22q');
verify.quickInfoAt("22q", "var i1_i: i1(b: string) => number (+1 overload)", "this is signature 2");
goTo.marker('23');
verify.memberListContains('foo', '(method) i1.foo(a: number): number (+1 overload)', 'foo 1');
verify.memberListContains('foo2', '(method) i1.foo2(a: number): number (+1 overload)', '');
verify.memberListContains('foo3', '(method) i1.foo3(a: number): number (+1 overload)', '');
verify.memberListContains('foo4', '(method) i1.foo4(a: number): number (+1 overload)', 'foo4 1');
verify.completionListContains('foo', '(method) i1.foo(a: number): number (+1 overload)', 'foo 1');
verify.completionListContains('foo2', '(method) i1.foo2(a: number): number (+1 overload)', '');
verify.completionListContains('foo3', '(method) i1.foo3(a: number): number (+1 overload)', '');
verify.completionListContains('foo4', '(method) i1.foo4(a: number): number (+1 overload)', 'foo4 1');
goTo.marker('24');
verify.currentSignatureHelpDocCommentIs("foo 1");
@@ -432,11 +432,11 @@ verify.currentParameterHelpArgumentDocCommentIs("");
verify.quickInfoAt("43q", "var i4_i: i4(b: string) => number (+1 overload)");
goTo.marker('44');
verify.memberListContains('prop1', '(method) c.prop1(a: number): number (+1 overload)', '');
verify.memberListContains('prop2', '(method) c.prop2(a: number): number (+1 overload)', 'prop2 1');
verify.memberListContains('prop3', '(method) c.prop3(a: number): number (+1 overload)', '');
verify.memberListContains('prop4', '(method) c.prop4(a: number): number (+1 overload)', 'prop4 1');
verify.memberListContains('prop5', '(method) c.prop5(a: number): number (+1 overload)', 'prop5 1');
verify.completionListContains('prop1', '(method) c.prop1(a: number): number (+1 overload)', '');
verify.completionListContains('prop2', '(method) c.prop2(a: number): number (+1 overload)', 'prop2 1');
verify.completionListContains('prop3', '(method) c.prop3(a: number): number (+1 overload)', '');
verify.completionListContains('prop4', '(method) c.prop4(a: number): number (+1 overload)', 'prop4 1');
verify.completionListContains('prop5', '(method) c.prop5(a: number): number (+1 overload)', 'prop5 1');
goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("");
@@ -15,6 +15,6 @@
////x./**/
goTo.marker();
verify.memberListContains("commonProperty", "(property) commonProperty: string | number");
verify.memberListContains("commonFunction", "(method) commonFunction(): number");
verify.memberListCount(2);
verify.completionListContains("commonProperty", "(property) commonProperty: string | number");
verify.completionListContains("commonFunction", "(method) commonFunction(): number");
verify.completionListCount(2);
@@ -15,6 +15,6 @@
////x.commonProperty./**/
goTo.marker();
verify.memberListContains("toString", "(method) toString(): string");
verify.memberListContains("valueOf", "(method) valueOf(): string | number");
verify.memberListCount(2);
verify.completionListContains("toString", "(method) toString(): string");
verify.completionListContains("valueOf", "(method) valueOf(): string | number");
verify.completionListCount(2);
@@ -16,9 +16,9 @@
goTo.marker('0');
verify.completionListContains("jspm");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(1);
verify.completionListCount(1);
goTo.marker('1');
verify.completionListContains("jspm:dev");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(4);
verify.completionListCount(4);
@@ -22,9 +22,9 @@
goTo.marker('0');
verify.completionListContains("jspm");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(1);
verify.completionListCount(1);
goTo.marker('1');
verify.completionListContains("jspm:dev");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(4);
verify.completionListCount(4);
@@ -18,9 +18,9 @@
goTo.marker('0');
verify.completionListContains("jspm");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(1);
verify.completionListCount(1);
goTo.marker('1');
verify.completionListContains("jspm:browser");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(2);
verify.completionListCount(2);
@@ -16,9 +16,9 @@
goTo.marker('0');
verify.completionListContains("jspm");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(1);
verify.completionListCount(1);
goTo.marker('1');
verify.completionListContains("jspm:dev");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(4);
verify.completionListCount(4);
@@ -8,8 +8,8 @@
goTo.marker('1');
verify.completionListContains("Option 1");
verify.memberListCount(3);
verify.completionListCount(3);
goTo.marker('2');
verify.completionListContains("Option 2");
verify.memberListCount(3);
verify.completionListCount(3);
@@ -12,9 +12,9 @@
goTo.marker('1');
verify.completionListContains("foo");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(3);
verify.completionListCount(3);
goTo.marker('2');
verify.completionListContains("some other name");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(3);
verify.completionListCount(3);
@@ -12,9 +12,9 @@
goTo.marker('1');
verify.completionListContains("A");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(3);
verify.completionListCount(3);
goTo.marker('2');
verify.completionListContains("A");
verify.completionListAllowsNewIdentifier();
verify.memberListCount(3);
verify.completionListCount(3);
@@ -20,4 +20,4 @@ verify.quickInfoIs('function f(p1: "literal", p2: "literal", p3: "other1" | "oth
goTo.marker('2');
verify.completionListContains("other1");
verify.completionListContains("other2");
verify.memberListCount(2);
verify.completionListCount(2);
@@ -30,6 +30,7 @@ goTo.marker('1');
verify.completionListContains("constructor");
verify.completionListContains("param");
verify.completionListContains("type");
verify.completionListContains("method");
goTo.marker('2');
verify.completionListContains("constructor");
@@ -9,5 +9,5 @@
//// }
goTo.marker();
verify.memberListContains("charAt");
verify.memberListCount(1);
verify.completionListContains("charAt");
verify.completionListCount(1);
@@ -8,4 +8,4 @@
////testModule./**/
goTo.marker();
verify.memberListContains("foo");
verify.completionListContains("foo");
@@ -3,5 +3,5 @@
////var v = { x: 4, y: 3 }./**/
goTo.marker();
verify.not.memberListContains('a');
verify.memberListContains('x');
verify.not.completionListContains('a');
verify.completionListContains('x');
@@ -4,5 +4,5 @@
/////a/./**/
goTo.marker();
verify.not.memberListContains('v');
verify.memberListContains('compile');
verify.not.completionListContains('v');
verify.completionListContains('compile');
@@ -3,5 +3,5 @@
/////a/./**/
goTo.marker();
verify.not.memberListContains('alert');
verify.memberListContains('compile');
verify.not.completionListContains('alert');
verify.completionListContains('compile');
@@ -3,5 +3,5 @@
////"a"./**/
goTo.marker();
verify.not.memberListContains('alert');
verify.memberListContains('charAt');
verify.not.completionListContains('alert');
verify.completionListContains('charAt');
@@ -15,4 +15,4 @@
goTo.marker();
verify.completionListIsEmpty();
verify.memberListIsEmpty();
verify.completionListIsEmpty();
@@ -15,4 +15,4 @@
goTo.marker();
verify.completionListIsEmpty();
verify.memberListIsEmpty();
verify.completionListIsEmpty();
@@ -3,4 +3,4 @@
//// if(0 === ''.
goTo.eof();
verify.memberListContains("charAt");
verify.completionListContains("charAt");
@@ -8,4 +8,4 @@
////var p = <Shapes.
goTo.eof();
verify.memberListContains("Point");
verify.completionListContains("Point");
@@ -19,4 +19,4 @@
goTo.marker();
verify.memberListContains("charAt");
verify.completionListContains("charAt");

Some files were not shown because too many files have changed in this diff Show More