Lines Matching +full:0 +full:x
728 @@ -0,0 +1,11 @@
746 @@ -0,0 +1,18 @@
762 + const x: string;
763 + export default x;
788 @@ -3,4 +3,6 @@ export declare var x;
802 @@ -0,0 +1,6 @@
814 @@ -0,0 +1,2 @@
822 @@ -0,0 +1,4 @@
833 @@ -0,0 +1,5 @@
835 +import {x} from "./reExportX";
838 +x($);
844 @@ -0,0 +1,2 @@
853 @@ -0,0 +1,2 @@
862 @@ -0,0 +1,2 @@
871 @@ -0,0 +1,2 @@
873 +export {x} from "jquery";
880 ({ f: super["x"] } = { f });
889 @@ -0,0 +1,49 @@
1032 @@ -0,0 +1,11 @@
1049 @@ -0,0 +1,30 @@
1086 @@ -0,0 +1,15 @@
1091 + #x = 1
1092 + constructor(x: number) {
1093 + this.#x = x;
1097 + // getX has privileged access to #x
1098 + getX = (obj: C) => obj.#x;
1107 @@ -0,0 +1,10 @@
1112 + static #x = 1;
1115 + C.#x;
1123 @@ -0,0 +1,14 @@
1128 + static #x = 123;
1131 + console.log(C.#x)
1135 + return C.#x;
1143 @@ -0,0 +1,15 @@
1164 @@ -0,0 +1,18 @@
1188 @@ -0,0 +1,26 @@
1193 + #x = 1
1194 + constructor(x: number) {
1195 + this.#x = x;
1199 + // getX has privileged access to #x
1200 + getX = (obj: C) => obj.#x;
1211 + getX = (obj: C) => obj.#x;
1221 @@ -0,0 +1,33 @@
1227 + #x: number;
1230 + this.#x = v;
1234 + return this.#x;
1239 + getX(obj) { return obj.#x },
1240 + setX(obj, value) { obj.#x = value }
1247 + const x = friendA.getX(a); // ok
1248 + friendA.setX(a, x + 1); // ok
1261 @@ -0,0 +1,15 @@
1282 @@ -0,0 +1,6 @@
1294 @@ -0,0 +1,20 @@
1320 @@ -0,0 +1,13 @@
1339 @@ -0,0 +1,7 @@
1353 @@ -0,0 +1,72 @@
1380 + x = await; // legal (initializers have an implicit function boundary)
1432 @@ -0,0 +1,21 @@
1460 @@ -0,0 +1,8 @@
1464 + static x: number;
1466 + C.x = 1;
1474 @@ -0,0 +1,23 @@
1503 @@ -0,0 +1,30 @@
1539 @@ -0,0 +1,17 @@
1562 @@ -0,0 +1,19 @@
1587 @@ -0,0 +1,16 @@
1609 @@ -0,0 +1,19 @@
1634 @@ -0,0 +1,62 @@
1702 @@ -0,0 +1,43 @@
1751 @@ -0,0 +1,48 @@
1805 @@ -0,0 +1,8 @@
1819 @@ -0,0 +1,15 @@
1825 + static x;
1827 + this.x = 1;
1829 + static y = this.x;
1841 @@ -0,0 +1,10 @@
1848 + this.x = 1;
1850 + static x;
1879 constructor(x: T = null) {
1880 var y = x;
1897 constructor(readonly x: number) {}
1923 [x: number]: any;
1935 @@ -0,0 +1,492 @@
2433 @@ -0,0 +1,42 @@
2446 + static x: any = undefined!;
2447 + static y1 = this.x;
2448 + static y2 = this.x();
2449 + static y3 = this?.x();
2450 + static y4 = this[("x")]();
2451 + static y5 = this?.[("x")]();
2456 + static z5 = super.a = 0;
2458 + static z7 = (() => { super.a = 0; })();
2459 + static z8 = [super.a] = [0];
2460 + static z9 = [super.a = 0] = [0];
2461 + static z10 = [...super.a] = [0];
2462 + static z11 = { x: super.a } = { x: 0 };
2463 + static z12 = { x: super.a = 0 } = { x: 0 };
2464 + static z13 = { ...super.a } = { x: 0 };
2472 + x = 1;
2473 + y = this.x;
2482 @@ -0,0 +1,42 @@
2495 + static x: any = undefined!;
2496 + static y1 = this.x;
2497 + static y2 = this.x();
2498 + static y3 = this?.x();
2499 + static y4 = this[("x")]();
2500 + static y5 = this?.[("x")]();
2505 + static z5 = super.a = 0;
2507 + static z7 = (() => { super.a = 0; })();
2508 + static z8 = [super.a] = [0];
2509 + static z9 = [super.a = 0] = [0];
2510 + static z10 = [...super.a] = [0];
2511 + static z11 = { x: super.a } = { x: 0 };
2512 + static z12 = { x: super.a = 0 } = { x: 0 };
2513 + static z13 = { ...super.a } = { x: 0 };
2521 + x = 1;
2522 + y = this.x;
2531 @@ -0,0 +1,26 @@
2544 + static x: any = undefined!;
2545 + static y1 = this.x;
2546 + static y2 = this.x();
2547 + static y3 = this?.x();
2548 + static y4 = this[("x")]();
2549 + static y5 = this?.[("x")]();
2554 + x = 1;
2555 + y = this.x;
2564 @@ -0,0 +1,26 @@
2577 + static x: any = undefined!;
2578 + static y1 = this.x;
2579 + static y2 = this.x();
2580 + static y3 = this?.x();
2581 + static y4 = this[("x")]();
2582 + static y5 = this?.[("x")]();
2587 + x = 1;
2588 + y = this.x;
2608 @@ -0,0 +1,51 @@
2665 @@ -0,0 +1,51 @@
2722 @@ -0,0 +1,10 @@
2738 @@ -0,0 +1,10 @@
2754 @@ -0,0 +1,12 @@
2769 index 0000000000..0d08423bb9
2772 @@ -0,0 +1,12 @@
2790 @@ -0,0 +1,9 @@
2805 @@ -0,0 +1,7 @@
2818 @@ -0,0 +1,12 @@
2836 @@ -0,0 +1,19 @@
2858 index 0000000000..0a648d2fa0
2861 @@ -0,0 +1,22 @@
2909 @@ -0,0 +1,11 @@
2926 @@ -0,0 +1,119 @@
2962 + const a = v && /*0*/#field/*1*/
3051 @@ -0,0 +1,47 @@
3104 @@ -0,0 +1,13 @@
3123 @@ -0,0 +1,65 @@
3209 index 0e42288808..aa639e71e3 100644
3239 protected get x() { return 'C.x' };
3249 @@ -0,0 +1,5 @@
3262 c.x = 3;
3264 -var r = c.x === c2.x;
3266 +// var r = c.x === c2.x;
3270 @@ -14,4 +14,5 @@ var r = c.x === c2.x;
3283 @@ -6,3 +6,4 @@ const x = 1;
3285 [x]: string;
3353 @@ -0,0 +1,27 @@
3360 + * @typedef {{ x: number }} A
3372 + if (/** @type { B } */ (a).y !== 0) throw TypeError();
3378 + const a = { x: 1 };
3386 @@ -0,0 +1,285 @@
3392 +function f10(x: string | number) {
3393 + const isString = typeof x === "string";
3395 + let t: string = x;
3398 + let t: number = x;
3402 +function f11(x: unknown) {
3403 + const isString = typeof x === "string";
3405 + let t: string = x;
3409 +function f12(x: string | number | boolean) {
3410 + const isString = typeof x === "string";
3411 + const isNumber = typeof x === "number";
3413 + let t: string | number = x;
3416 + let t: boolean = x;
3420 +function f13(x: string | number | boolean) {
3421 + const isString = typeof x === "string";
3422 + const isNumber = typeof x === "number";
3425 + let t: string | number = x;
3428 + let t: boolean = x;
3432 +function f14(x: number | null | undefined): number | null {
3433 + const notUndefined = x !== undefined;
3434 + return notUndefined ? x : 0;
3437 +function f15(obj: { readonly x: string | number }) {
3438 + const isString = typeof obj.x === 'string';
3440 + let s: string = obj.x;
3444 +function f16(obj: { readonly x: string | number }) {
3445 + const isString = typeof obj.x === 'string';
3446 + obj = { x: 42 };
3448 + let s: string = obj.x; // Not narrowed because of is assigned in function body
3453 + const isString = typeof obj[0] === 'string';
3455 + let s: string = obj[0];
3460 + const isString = typeof obj[0] === 'string';
3463 + let s: string = obj[0]; // Not narrowed because of is assigned in function body
3603 + constructor(readonly x: string | number) {
3604 + const thisX_isString = typeof this.x === 'string';
3605 + const xIsString = typeof x === 'string';
3608 + s = this.x;
3609 + s = x;
3615 + constructor(readonly x: string | number) {
3616 + const thisX_isString = typeof this.x === 'string';
3617 + const xIsString = typeof x === 'string';
3621 + s = this.x;
3622 + s = x;
3625 + this.x = 10;
3626 + x = 10;
3677 @@ -0,0 +1,28 @@
3722 @@ -0,0 +1,25 @@
3754 @@ -0,0 +1,26 @@
3785 @@ -29,4 +29,6 @@ export const x: X | number = Math.random() > 0.5 ? new X() : 1
3787 if (x instanceof X) {
3788 x.why() // should compile
3792 +let xx = new X();
3810 @@ -0,0 +1,71 @@
3814 +declare function obj(x: object): void;
3816 +function f1(x: unknown) {
3817 + if (!x) {
3820 + if (typeof x === 'object') {
3821 + obj(x);
3825 +function f2(x: unknown) {
3826 + if (x === null) {
3829 + if (typeof x === 'object') {
3830 + obj(x);
3834 +function f3(x: unknown) {
3835 + if (x == null) {
3838 + if (typeof x === 'object') {
3839 + obj(x);
3843 +function f4(x: unknown) {
3844 + if (x == undefined) {
3847 + if (typeof x === 'object') {
3848 + obj(x);
3852 +function f5(x: unknown) {
3854 + if (!x) {
3859 + if (x === null) {
3863 + if (typeof x === 'object') {
3864 + obj(x);
3868 +function f6(x: unknown) {
3869 + if (x === null) {
3870 + x;
3873 + x;
3874 + if (typeof x === 'object') {
3875 + obj(x);
3878 + if (typeof x === 'object') {
3879 + obj(x); // Error
3887 @@ -0,0 +1,161 @@
4118 @@ -0,0 +1,5 @@
4130 @@ -0,0 +1,2 @@
4139 @@ -0,0 +1,4 @@
4142 + "version": "1.0.0"
4150 @@ -0,0 +1,18 @@
4158 +// "version": "1.0.0"
4174 @@ -0,0 +1,15 @@
4196 @@ -0,0 +1,16 @@
4218 @@ -0,0 +1,19 @@
4243 @@ -0,0 +1,27 @@
4276 @@ -0,0 +1,14 @@
4284 + return 0;
4288 + return 0;
4296 @@ -0,0 +1,12 @@
4306 + return 0;
4314 @@ -0,0 +1,12 @@
4324 + return 0;
4332 @@ -0,0 +1,11 @@
4341 + return 0;
4349 @@ -0,0 +1,11 @@
4366 @@ -0,0 +1,17 @@
4408 @@ -0,0 +1,7 @@
4422 @@ -0,0 +1,45 @@
4528 @@ -0,0 +1,16 @@
4550 @@ -0,0 +1,14 @@
4596 @@ -0,0 +1,5 @@
4734 index 0a6a47dfbb..4e2e1e494d 100644
4747 @@ -44,3 +44,6 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
4822 @@ -0,0 +1,178 @@
5012 index 57d56ccc3b..0f531ea811 100644
5072 -// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function'
5074 -// - when true, narrows the type of x to the type of the 'prototype' property in C provided
5075 -// it is a subtype of the type of x, or
5076 -// - when false, has no effect on the type of x.
5087 +// A type guard of the form x instanceof C, where C is of a subtype of the global type 'Function'
5089 +// - when true, narrows the type of x to the type of the 'prototype' property in C provided
5090 +// it is a subtype of the type of x, or
5091 +// - when false, has no effect on the type of x.
5225 x: string | number;
5227 -strOrNum = typeof obj1.x === "string" && obj1.x; // string | number
5229 +strOrNum = typeof obj1.x === "string" && obj1.x; // string | number
5259 index 0b60c73ef9..4495309b10 100644
5286 @@ -0,0 +1,12 @@
5304 @@ -0,0 +1,6 @@
5317 @@ -0,0 +1,12 @@
5335 @@ -0,0 +1,12 @@
5353 @@ -0,0 +1,6 @@
5359 +import("./foo").then(x => x); // should error, ask for extension
5366 @@ -0,0 +1,8 @@
5381 @@ -0,0 +1,6 @@
5394 @@ -0,0 +1,6 @@
5400 +import("./foo").then(x => x); // should error, ask for extension
5407 @@ -0,0 +1,21 @@
5420 +const type = 0;
5421 +const as = 0;
5422 +const something = 0;
5434 @@ -0,0 +1,2 @@
5443 @@ -0,0 +1,5 @@
5455 @@ -0,0 +1,46 @@
5460 +export const as = 0;
5461 +export const type = 0;
5462 +export const something = 0;
5507 @@ -0,0 +1,28 @@
5514 +export const b = 0;
5541 @@ -0,0 +1,47 @@
5594 @@ -0,0 +1,14 @@
5614 @@ -0,0 +1,13 @@
5633 @@ -0,0 +1,4 @@
5643 @@ -0,0 +1,37 @@
5648 +// @filename: 0.ts
5653 +import './0' assert { type: "json" }
5654 +import { a, b } from './0' assert { "type": "json" }
5655 +import * as foo from './0' assert { type: "json" }
5662 +import { a, b } from './0' assert {}
5663 +import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" }
5670 +const a = import('./0')
5671 +const b = import('./0', { assert: { type: "json" } })
5672 +const c = import('./0', { assert: { type: "json", ttype: "typo" } })
5673 +const d = import('./0', { assert: {} })
5674 +const dd = import('./0', {})
5676 +const e = import('./0', foo())
5678 +const g = import('./0', {}, {})
5679 +const h = import('./0', { assert: { type: "json" }},)
5686 @@ -0,0 +1,17 @@
5691 +// @filename: 0.ts
5696 +export {} from './0' assert { type: "json" }
5697 +export { a, b } from './0' assert { type: "json" }
5698 +export * from './0' assert { type: "json" }
5699 +export * as ns from './0' assert { type: "json" }
5702 +export { a, b } from './0' assert {}
5703 +export { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" }
5709 @@ -0,0 +1,15 @@
5714 +// @filename: 0.ts
5718 +export type {} from './0' assert { type: "json" }
5719 +export type { I } from './0' assert { type: "json" }
5722 +import type { I } from './0' assert { type: "json" }
5723 +import type * as foo from './0' assert { type: "json" }
5730 @@ -0,0 +1 @@
5737 @@ -0,0 +1 @@
5758 @@ -53,3 +53,15 @@ class C20 extends Constructor<Partial<T1>>() { x: string }
5759 class C21 extends Constructor<Readonly<T1>>() { x: string }
5760 class C22 extends Constructor<Identifiable<T1>>() { x: string }
5761 class C23 extends Constructor<Identifiable<T1 & { b: number}>>() { x: string }
5793 var p: { x: number; y: number; }
5795 var p = new A.Point(0, 0); // unexpected error here, bug 840000
5804 constructor(public x: number, public y: number) { }
5829 x: number;
5837 return { x: p.x, y: p.y };
5844 @@ -21,6 +23,7 @@ module X.Y.Z {
5851 module X {
5852 @@ -29,6 +32,7 @@ module X {
5864 @@ -16,6 +16,7 @@ module X.Y.Z {
5871 module X {
5872 @@ -24,6 +25,7 @@ module X {
5886 export var x = 42;
5894 var x = 42;
5910 module X {
5956 @@ -0,0 +1,23 @@
5994 @@ -0,0 +1,10 @@
6010 return this.x;
6030 @@ -0,0 +1,71 @@
6045 +const aDefault2 = [0];
6049 +const aNumber = [0];
6107 @@ -0,0 +1,16 @@
6120 +const x = { a: 1 };
6122 +/** @type {Foo<typeof x, "a">} */
6140 @@ -0,0 +1,12 @@
6158 @@ -0,0 +1,7 @@
6171 @@ -0,0 +1,11 @@
6188 @@ -0,0 +1,18 @@
6212 @@ -0,0 +1,140 @@
6358 @@ -0,0 +1,32 @@
6396 @@ -0,0 +1,23 @@
6403 + "version": "1.0.0"
6407 +var foo = 0;
6426 @@ -0,0 +1,3 @@
6428 +export const x: number;
6436 @@ -0,0 +1,12 @@
6443 +import { x } from "./index";
6446 +x;
6455 @@ -0,0 +1,2 @@
6464 @@ -0,0 +1,2 @@
6466 +export const x = 0;
6472 @@ -0,0 +1,9 @@
6480 +import { x } from "./index";
6481 +x;
6488 @@ -0,0 +1,12 @@
6496 +// exports.default = { bar() { return 0; } }
6506 @@ -0,0 +1,4 @@
6509 + export const x: number;
6516 @@ -0,0 +1,12 @@
6527 +import { x } from "foo";
6528 +x;
6534 @@ -0,0 +1,24 @@
6565 @@ -0,0 +1,324 @@
6573 +const x = 1;
6574 +export {x};
6577 +const x = 1;
6578 +export {x};
6581 +const x = 1;
6582 +export {x};
6585 +const x = 1;
6586 +export {x};
6589 +const x = 1;
6590 +export {x};
6593 +const x = 1;
6594 +export {x};
6597 +const x = 1;
6598 +export {x};
6601 +const x = 1;
6602 +export {x};
6605 +const x = 1;
6606 +export {x};
6693 +const x = 1;
6694 +export {x};
6782 +const x = 1;
6783 +export {x};
6871 +const x = 1;
6872 +export {x};
6896 @@ -0,0 +1,8 @@
6911 @@ -0,0 +1,126 @@
7044 @@ -0,0 +1,27 @@
7078 @@ -0,0 +1,32 @@
7117 @@ -0,0 +1,29 @@
7153 @@ -0,0 +1,34 @@
7194 @@ -0,0 +1,34 @@
7235 @@ -0,0 +1,30 @@
7272 @@ -0,0 +1,32 @@
7311 @@ -0,0 +1,23 @@
7319 +const x = import.meta.url;
7320 +export {x};
7323 +const x = import.meta.url;
7324 +export {x};
7341 @@ -0,0 +1,92 @@
7440 @@ -0,0 +1,41 @@
7488 @@ -0,0 +1,69 @@
7564 @@ -0,0 +1,69 @@
7640 @@ -0,0 +1,37 @@
7684 @@ -0,0 +1,25 @@
7692 +const x = await 1;
7693 +export {x};
7697 +const x = await 1;
7698 +export {x};
7716 @@ -0,0 +1,33 @@
7721 +export const a = async () => (await import("inner")).x();
7723 +export { x } from "./other.js";
7726 +export const x: () => Thing;
7756 @@ -0,0 +1,321 @@
7761 +const x = 1;
7762 +export {x};
7765 +const x = 1;
7766 +export {x};
7769 +const x = 1;
7770 +export {x};
7773 +const x = 1;
7774 +export {x};
7777 +const x = 1;
7778 +export {x};
7781 +const x = 1;
7782 +export {x};
7785 +const x = 1;
7786 +export {x};
7789 +const x = 1;
7790 +export {x};
7793 +const x = 1;
7794 +export {x};
7882 +const x = 1;
7883 +export {x};
7971 +const x = 1;
7972 +export {x};
8059 +const x = 1;
8060 +export {x};
8084 @@ -0,0 +1,19 @@
8110 @@ -0,0 +1,124 @@
8241 @@ -0,0 +1,71 @@
8319 @@ -0,0 +1,93 @@
8419 @@ -0,0 +1,24 @@
8450 @@ -0,0 +1,20 @@
8477 @@ -0,0 +1,27 @@
8483 +export const a = (await import("inner")).x();
8486 +export { x } from "./other.js";
8490 +export const x: () => Thing;
8511 @@ -0,0 +1,34 @@
8517 +export const a = (await import("inner")).x();
8520 +export { x } from "./other.js";
8524 +export const x: () => Thing;
8552 @@ -0,0 +1,29 @@
8558 +export const a = (await import("inner/index.js")).x();
8561 +export { x } from "./other.js";
8565 +export const x: () => Thing;
8588 @@ -0,0 +1,29 @@
8594 +export const a = (await import("inner/index.js")).x();
8597 +export { x } from "./other.js";
8601 +export const x: () => Thing;
8624 @@ -0,0 +1,67 @@
8629 +const x = <T>() => <T><any>(void 0);
8630 +export {x};
8633 +const x = <T>() => <T><any>(void 0);
8634 +export {x};
8637 +const x = <T>() => <T><any>(void 0);
8638 +export {x};
8641 +const x = <T>() => <T><any>(void 0);
8642 +export {x};
8645 +const x = <T>() => <T><any>(void 0);
8646 +export {x};
8649 +const x = <T>() => <T><any>(void 0);
8650 +export {x};
8653 +const x = <T>() => <T><any>(void 0);
8654 +export {x};
8657 +const x = <T>() => <T><any>(void 0);
8658 +export {x};
8661 +const x = <T>() => <T><any>(void 0);
8662 +export {x};
8665 +const x = <T>() => <T><any>(void 0);
8666 +export {x};
8669 +const x = <T>() => <T><any>(void 0);
8670 +export {x};
8673 +const x = <T>() => <T><any>(void 0);
8674 +export {x};
8698 @@ -0,0 +1,26 @@
8728 index 0000000000..0fe1ccdf82
8731 @@ -0,0 +1,13 @@
8751 @@ -0,0 +1,31 @@
8789 @@ -0,0 +1,31 @@
8827 @@ -0,0 +1,27 @@
8861 @@ -0,0 +1,25 @@
8893 @@ -0,0 +1,20 @@
8898 +const x = import.meta.url;
8899 +export {x};
8902 +const x = import.meta.url;
8903 +export {x};
8920 @@ -0,0 +1,24 @@
8951 @@ -0,0 +1,24 @@
8982 @@ -0,0 +1,90 @@
9079 @@ -0,0 +1,38 @@
9124 @@ -0,0 +1,67 @@
9198 @@ -0,0 +1,67 @@
9272 @@ -0,0 +1,29 @@
9308 @@ -0,0 +1,34 @@
9349 @@ -0,0 +1,22 @@
9354 +const x = await 1;
9355 +export {x};
9359 +const x = await 1;
9360 +export {x};
9378 @@ -0,0 +1,53 @@
9438 @@ -0,0 +1,21 @@
9466 @@ -0,0 +1,21 @@
9517 @@ -0,0 +1,9 @@
9562 @@ -0,0 +1,20 @@
9588 @@ -0,0 +1,34 @@
9642 @@ -0,0 +1,14 @@
9699 0();
9700 "0"() { }
9915 static [x: string]: string;
10014 @@ -0,0 +1,4 @@
10024 @@ -0,0 +1,6 @@
10027 +async function foo(x: any) {
10029 + for await (async of x) {}
10036 @@ -0,0 +1,4 @@
10056 @@ -0,0 +1,44 @@
10093 + label: var x = 1
10096 + return x
10106 @@ -0,0 +1,6 @@
10118 @@ -0,0 +1,7 @@
10131 @@ -0,0 +1,7 @@
10144 @@ -0,0 +1,7 @@
10157 @@ -0,0 +1,51 @@
10214 @@ -0,0 +1,18 @@
10238 @@ -0,0 +1,18 @@
10262 @@ -0,0 +1,29 @@
10297 return 0
10309 @@ -0,0 +1,4 @@
10338 @@ -7,4 +7,6 @@ var b = x<string>('hello');
10341 var c = x<C>(x);
10342 -var d = x<any>(x);
10344 +var d = x<any>(x);
10349 index 0af7d94d7b..aba7eb4753 100644
10352 @@ -42,4 +42,6 @@ M = x;
10355 a = x;
10363 index 8613550fc5..0f7f258e87 100644
10366 @@ -52,4 +52,6 @@ x = { f<T>(x: T) { return x; } }
10369 x = a;
10408 let y: import("foo2").Bar.I = { a: "", b: 0 };
10431 export const x: import("./foo")<{x: number}> = { x: 0, y: 0, data: {x: 12} };
10432 export let y: import("./foo2").Bar.I<{x: number}> = { a: "", b: 0, data: {x: 12} };
10454 export const x: import("./foo") = { x: 0, y: 0 };
10455 export let y: import("./foo2").Bar.I = { a: "", b: 0 };
10465 index 0000000000..0f67b66bff
10468 @@ -0,0 +1,16 @@
10471 +interface X {
10477 +declare const q: X & AorB;
10517 @@ -176,3 +176,6 @@ type Bit = 0 | 1;
10519 let aa = makeArray<Bit>(0);
10530 constructor(public x: number, public y: number) { }
10537 public x = x;
10545 public x = x;
10557 class C<X, Y> {
10558 constructor(public x: X, public y: Y) { }
10565 public x = x;
10573 public x = x;
10585 @@ -0,0 +1,27 @@
10596 + let x: Filter<T> = val; // Ok
10606 + let x: FilterInclOpt<T> = val; // Ok
10618 @@ -0,0 +1,42 @@
10705 @@ -0,0 +1,325 @@
10714 +function gg3(x: { [key: string]: string }, y: { [key: symbol]: string }, z: { [sym]: number }) {
10715 + x = z;
10721 +function gg1(x: { [key: `a${string}`]: string, [key: `${string}a`]: string }, y: { [key: `a${strin…
10722 + x = y;
10723 + y = x;
10729 +function gg2(x: IX, y: IY) {
10730 + x = y; // Error
10731 + y = x;
10736 +declare let combo: { [x: `foo-${string}`]: 'a' | 'b' } & { [x: `${string}-bar`]: 'b' | 'c' };
10747 +declare let combo2: { [x: `${string}xxx${string}` & `${string}yyy${string}`]: string };
10755 +declare let dom: { [x: `data${string}`]: string };
10767 + [key: `s${string}`]: (x: string) => void,
10768 + [key: `n${string}`]: (x: number) => void,
10772 + sfoo: x => x.length, // x: string
10773 + nfoo: x => x * 2, // n: number
10914 + ['x']: 0 as const,
10929 + ['x']: 0 as const,
10961 +declare function foo<TArg, TRet, TDir>(options: { [x in string]: (arg: TArg) => TRet } & { [direct…
10964 + [directive]: (x: string) => 'str',
10965 + addOne: (x: number) => x + 1,
10966 + double: (x: number) => x + x,
10970 + addOne: (x: number) => x + 1,
10971 + double: (x: number) => x + x,
10972 + [directive]: (x: string) => 'str',
10977 + addOne: (x: number) => x + 1,
10978 + double: (x: number) => x + x,
11117 x?: T;
11118 f?(x: T) {}
11152 export var x = 1;
11174 foo(x, x) { },
11175 a: function foo(x: number, x: string) { },
11176 b: <T>(x: T, x: T) => { }
11211 return x;
11213 b: (x) => x
11220 index 01f33fbd7b..0aeddb657c 100644
11224 foo(x: 'a');
11225 foo<T extends String>(x: T);
11235 foo(x: 'a');
11236 foo<T extends String>(x: T);
11247 a: function foo(x: 'hi', y: 'hi') { },
11248 b: (x: 'hi') => { }
11259 // x: C<U, T>;
11270 new <T>(x: T, y: string): C2<T>;
11271 new <T>(x: T, y: string): C; // error
11296 @@ -32,3 +32,5 @@ var b: { [x: string]: string } = { y: '' }
11347 @@ -7,4 +7,4 @@ var x = 1;
11348 var a: string = x.doStuff();
11349 var b: string = x.doOtherStuff('hm');
11350 var c: string = x['doStuff']();
11351 -var d: string = x['doOtherStuff']('hm');
11353 +var d: string = x['doOtherStuff']('hm');
11358 @@ -28,4 +28,6 @@ x = f;
11361 x = E;
11362 -x = E.A;
11364 +x = E.A;
11372 @@ -20,4 +20,6 @@ var h: { f(): void } = x;
11375 a = x;
11396 @@ -23,4 +23,6 @@ var c2: { (x: number): number; <T>(x: T): any; };
11399 var r6 = z2[0];
11412 new<T>(x: string): D<T>;
11413 new<T>(x: number): D<T>;
11479 @@ -0,0 +1,146 @@
11506 + let x: typeof this.no = 1;
11510 + let x: typeof this.no = 1;
11514 + let x: typeof this.no = 1;
11522 + let x: typeof this.no = 1;
11528 + let x: typeof this.no = 1;
11534 + let x: typeof this.no = 1;
11539 + let x: typeof this.no = 1;
11543 + no = 0;
11544 + this = 0;
11594 + this?: { x?: string };
11600 + if (o.this && o.this.x) {
11601 + let y: string = o.this.x; // should narrow to string
11632 @@ -0,0 +1,5 @@
11636 + let x: typeof this.no = 1
11643 @@ -0,0 +1,21 @@
11670 @@ -0,0 +1,22 @@
11698 @@ -0,0 +1,4 @@
11699 +declare const a: { x: () => void }
11700 +declare const b: { x?: () => void }
11704 index c9e791cb6f..0aad4efe17 100644
11718 x = x.self();
11725 index 6c650341fb..0d3913de7e 100644
11754 @@ -0,0 +1,10 @@
11766 index 0f58f1971d..e03bc2a0c6 100644
11782 [x: string]: T4;
11793 @@ -9,4 +9,6 @@ var x: StringTree;
11794 if (typeof x !== "string") {
11795 x[0] = "";
11796 x[0] = new StringTreeCollection;
11806 @@ -77,4 +77,6 @@ var x: [string, boolean];
11807 f16(x);
11810 -y[0].toLowerCase();
11812 +y[0].toLowerCase();
11821 f(x: T): T;
11835 @@ -58,4 +58,7 @@ function foo2<T extends { (): void }, U extends { (): void }>(x: T, y: U) {
11836 //function foo2<T extends { (): void }, U extends T>(x: T, y: U) {
11837 // foo(x);
11850 @@ -38,4 +38,7 @@ var c2: { <T>(x: T): T; <T>(x: T, y: T): T };
11851 var r9 = foo(function <U>(x: U) { return x; });
11852 var r10 = foo(<U extends string>(x: U) => x);
11866 // var x: U;
11867 // x.getDate();
11962 declare function foo18(x: {}): {};
11963 declare function foo18(x: any): any;
11976 @@ -38,6 +38,7 @@ function foo<T, U /*extends T*/, V extends Date>(x: T, y: U, z: V) {
11981 //function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
11982 // x = a;
11989 [x: string]: {};
12056 a16: <T extends Base>(x: T) => number[]; // ok
12057 a17: <T>(x: (a: T) => T) => T[]; // ok
12058 a18: <T>(x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any
12072 a16: <T>(x: { a: T; b: T }) => T[]; // ok, more general parameter type
12073 a17: <T>(x: (a: T) => T) => T[]; // ok
12074 a18: (x: <T>(a: T) => T) => any[]; // ok
12088 …a12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific paramet…
12089 …a13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies c…
12090 a14: <T, U>(x: { a: T; b: U }) => T; // ok
12103 a16: new <T extends Base>(x: T) => number[]; // ok
12104 a17: new <T>(x: new (a: T) => T) => T[]; // ok
12105 a18: new <T>(x: new (a: T) => T) => T[]; // ok, no inferences for T but assignable to any
12119 a18: new <T extends Base>(x: T) => number[]; // ok, more general parameter type
12120 a19: new <T extends Base>(x: new (a: T) => T) => T[]; // ok
12121 a20: new (x: new <T extends Base>(a: T) => T) => any[]; // ok
12134 …a12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific par…
12135 …a13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfi…
12136 a14: new <T, U>(x: { a: T; b: U }) => T; // ok
12148 @@ -53,6 +53,8 @@ function foo<T, U /*extends T*/, V extends Date>(x: T, y: U, z: V) {
12154 //function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
12155 // a = x;
12161 @@ -35,7 +35,7 @@ function foo<T, U, V extends Date>(x: T, y: U, z: V) {
12167 //function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
12168 // x = null;
12174 @@ -35,6 +35,7 @@ function foo<T, U, V extends Date>(x: T, y: U, z: V) {
12179 //function foo<T, U extends T, V extends Date>(x: T, y: U, z: V) {
12180 // x = undefined;
12212 index 0f498c570a..13ecea225a 100644
12228 @@ -34,3 +34,6 @@ function f3<T extends E>(v: T | { x: string }) {
12229 const y: { x: string } = v;
12257 x: G<G<T>>;
12295 index c7e9c0fc8e..0f00bc8c02 100644
12298 @@ -97,4 +97,6 @@ function f15<T, U extends T>(x: any) { }
12300 function f16<T extends String, U extends T>(x: 'a');
12301 function f16<T extends String, U extends T>(x: U);
12302 -function f16<T extends String, U extends T>(x: any) { }
12304 +function f16<T extends String, U extends T>(x: any) { }
12309 index 0e5df54319..d785a27b7b 100644
12314 [x: string]: any;
12327 @@ -154,4 +154,7 @@ function f20<T extends Number>(x: T) {
12328 function f21<T extends Number>(x: T) {
12329 var r20 = true ? {} : x; // ok
12330 var r20 = true ? x : {}; // ok
12347 declare function foo1(a: (x: number) => number[]): typeof a;
12350 @@ -169,3 +170,8 @@ var r17arg1 = <T>(x: (a: T) => T) => <T[]>null;
12352 var r18arg1 = <T>(x: (a: T) => T) => <T[]>null;
12366 var r9arg = <T>(x: (a: T) => T) => <any[]>null;
12367 …var r9 = foo17(r9arg); // (x: { <T extends Derived >(a: T): T; <T extends Base >(a: T): T; }): any…
12379 @@ -108,4 +108,8 @@ var r17arg = <T>(x: (a: T) => T) => <T[]>null;
12382 var r18arg = (x: <T>(a: T) => T) => <any[]>null;
12395 @@ -169,3 +169,8 @@ var r17arg1: new <T>(x: (a: T) => T) => T[];
12397 var r18arg1: new <T>(x: (a: T) => T) => T[];
12411 var r9arg: new <T>(x: new (a: T) => T) => any[];
12412 …var r9 = foo17(r9arg); // // (x: { <T extends Derived >(a: T): T; <T extends Base >(a: T): T; }): …
12424 @@ -108,4 +108,8 @@ var r17arg: new <T>(x: new (a: T) => T) => T[];
12427 var r18arg: new (x: new <T>(a: T) => T) => any[];
12447 a: new (x: number) => number[];
12449 …a12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific par…
12450 …a13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfi…
12451 a14: new <T, U>(x: { a: T; b: U }) => T; // ok
12511 @@ -85,4 +85,8 @@ function foo13(x: any) { }
12513 function foo14(x: I);
12514 function foo14(x: typeof b); // error
12515 -function foo14(x: any) { }
12517 +function foo14(x: any) { }
12527 @@ -62,4 +62,7 @@ function foo13(x: any) { }
12529 function foo14(x: I);
12530 function foo14(x: typeof b); // ok
12531 -function foo14(x: any) { }
12533 +function foo14(x: any) { }
12542 @@ -97,4 +97,7 @@ function foo14(x: any) { }
12544 function foo15(x: I2<string>);
12545 function foo15(x: C<number>); // ok
12546 -function foo15(x: any) { }
12548 +function foo15(x: any) { }
12557 @@ -97,4 +97,7 @@ function foo14(x: any) { }
12559 function foo15(x: I2<string>);
12560 function foo15(x: C<number>); // ok
12561 -function foo15(x: any) { }
12563 +function foo15(x: any) { }
12572 @@ -97,4 +97,7 @@ function foo14(x: any) { }
12574 function foo15(x: I2<string>);
12575 function foo15(x: C<number>); // ok
12576 -function foo15(x: any) { }
12578 +function foo15(x: any) { }
12584 index 0aaf7c30f2..cc561aa934 100644
12587 @@ -113,4 +113,8 @@ function foo14(x: any) { }
12589 function foo15(x: I2<string>);
12590 function foo15(x: C<number>); // ok
12591 -function foo15(x: any) { }
12593 +function foo15(x: any) { }
12603 @@ -84,4 +84,8 @@ function foo13(x: any) { }
12605 function foo15(x: I2<string>);
12606 function foo15(x: C<number>); // ok
12607 -function foo15(x: any) { }
12609 +function foo15(x: any) { }
12619 @@ -73,4 +73,6 @@ function foo14(x: any) { }
12621 function foo15(x: I2<string>);
12622 function foo15(x: C<number>); // ok
12623 -function foo15(x: any) { }
12625 +function foo15(x: any) { }
12633 @@ -73,4 +73,6 @@ function foo14(x: any) { }
12635 function foo15(x: I2<string>);
12636 function foo15(x: C<number>); // ok
12637 -function foo15(x: any) { }
12639 +function foo15(x: any) { }
12647 @@ -97,4 +97,8 @@ function foo14(x: any) { }
12649 function foo15(x: I2);
12650 function foo15(x: C<number>); // ok
12651 -function foo15(x: any) { }
12653 +function foo15(x: any) { }
12663 @@ -97,4 +97,8 @@ function foo14(x: any) { }
12665 function foo15(x: I2);
12666 function foo15(x: C<string, number>); // ok
12667 -function foo15(x: any) { }
12669 +function foo15(x: any) { }
12678 @@ -99,4 +99,8 @@ function foo14(x: any) { }
12680 function foo15(x: I2);
12681 function foo15(x: C<String>); // ok
12682 -function foo15(x: any) { }
12684 +function foo15(x: any) { }
12693 @@ -111,4 +111,8 @@ function foo14(x: any) { }
12695 function foo15(x: I2);
12696 function foo15(x: C<String, String>); // ok
12697 -function foo15(x: any) { }
12699 +function foo15(x: any) { }
12709 @@ -120,4 +120,11 @@ function foo14(x: any) { }
12711 function foo15(x: I2);
12712 function foo15(x: C<Three, Three>); // ok
12713 -function foo15(x: any) { }
12715 +function foo15(x: any) { }
12728 @@ -99,4 +99,7 @@ function foo14(x: any) { }
12730 function foo15(x: I2);
12731 function foo15(x: C<number>); // ok
12732 -function foo15(x: any) { }
12734 +function foo15(x: any) { }
12742 @@ -99,4 +99,8 @@ function foo14(x: any) { }
12744 function foo15(x: I2);
12745 function foo15(x: C<Date>); // ok
12746 -function foo15(x: any) { }
12748 +function foo15(x: any) { }
12758 @@ -97,4 +97,8 @@ function foo14(x: any) { }
12760 function foo15(x: I2);
12761 function foo15(x: C<number, B<string, string>, B<number, string>>); // ok
12762 -function foo15(x: any) { }
12764 +function foo15(x: any) { }
12773 @@ -97,4 +97,7 @@ function foo14(x: any) { }
12775 function foo15(x: I2);
12776 function foo15(x: C<number>); // ok
12777 -function foo15(x: any) { }
12779 +function foo15(x: any) { }
12788 @@ -99,4 +99,7 @@ function foo14(x: any) { }
12790 function foo15(x: I2);
12791 function foo15(x: C<number>); // ok
12792 -function foo15(x: any) { }
12794 +function foo15(x: any) { }
12803 @@ -99,4 +99,7 @@ function foo14(x: any) { }
12805 function foo15(x: I2);
12806 function foo15(x: C<string, number>); // ok
12807 -function foo15(x: any) { }
12809 +function foo15(x: any) { }
12818 @@ -99,4 +99,8 @@ function foo14(x: any) { }
12820 function foo15(x: I2);
12821 function foo15(x: C<string, number>); // ok
12822 -function foo15(x: any) { }
12824 +function foo15(x: any) { }
12834 @@ -72,3 +72,5 @@ function foo13(x: any) { }
12835 function foo14(x: I<Number>);
12836 function foo14(x: typeof b); // ok
12837 function foo14(x: any) { }
12845 @@ -83,4 +83,9 @@ function foo13(x: any) { }
12847 function foo14(x: I<Number, Number>);
12848 function foo14(x: typeof b); // ok
12849 -function foo14(x: any) { }
12851 +function foo14(x: any) { }
12862 @@ -92,4 +92,9 @@ function foo13(x: any) { }
12864 function foo14(x: I<Five<string>, Five<string>>);
12865 function foo14(x: typeof b); // ok
12866 -function foo14(x: any) { }
12868 +function foo14(x: any) { }
12879 @@ -79,4 +79,6 @@ function foo14(x: any) { }
12881 function foo15(x: I2);
12882 function foo15(x: C<number>); // ok
12883 -function foo15(x: any) { }
12885 +function foo15(x: any) { }
12893 @@ -75,4 +75,8 @@ function foo14(x: any) { }
12895 function foo15(x: I2);
12896 function foo15(x: C<Date>); // ok
12897 -function foo15(x: any) { }
12899 +function foo15(x: any) { }
12909 @@ -69,4 +69,6 @@ function foo13(x: any) { }
12911 function foo14(x: I<string, Date, RegExp, boolean>);
12912 function foo14(x: typeof b); // ok
12913 -function foo14(x: any) { }
12915 +function foo14(x: any) { }
12923 @@ -69,4 +69,8 @@ function foo13(x: any) { }
12925 function foo14(x: I<string>);
12926 function foo14(x: typeof b); // ok
12927 -function foo14(x: any) { }
12929 +function foo14(x: any) { }
12938 @@ -71,4 +71,7 @@ function foo13(x: any) { }
12940 function foo14(x: I<string>);
12941 function foo14(x: typeof b); // ok
12942 -function foo14(x: any) { }
12944 +function foo14(x: any) { }
12952 @@ -71,4 +71,7 @@ function foo13(x: any) { }
12954 function foo14(x: I<string, number>);
12955 function foo14(x: typeof b); // ok
12956 -function foo14(x: any) { }
12958 +function foo14(x: any) { }
12966 @@ -71,4 +71,6 @@ function foo13(x: any) { }
12968 function foo14(x: I<string, number>);
12969 function foo14(x: typeof b); // ok
12970 -function foo14(x: any) { }
12972 +function foo14(x: any) { }
12977 index 867199d905..0c6b2ca24b 100644
12980 @@ -119,3 +119,6 @@ function foo16(x: I);
12981 function foo16(x: PB); // error
12982 function foo16(x: any) { }
12992 @@ -122,3 +122,8 @@ function foo16(x: I);
12993 function foo16(x: PB); // error
12994 function foo16(x: any) { }
13006 @@ -119,3 +119,6 @@ function foo16(x: I);
13007 function foo16(x: PB); // error
13008 function foo16(x: any) { }
13017 @@ -53,4 +53,8 @@ function foo13(x: any) { }
13019 function foo14(x: I);
13020 function foo14(x: typeof b); // ok
13021 -function foo14(x: any) { }
13023 +function foo14(x: any) { }
13032 @@ -116,4 +116,6 @@ function foo15(x: any) { }
13033 function foo16(x: I);
13034 function foo16(x: PB); // no error
13035 function foo16(x: any) { }
13044 @@ -35,3 +35,4 @@ function foo6(x: D<number>): string; // error
13045 function foo6(x: any): any { }
13053 @@ -85,4 +85,7 @@ function foo13(x: any) { }
13055 function foo14(x: I);
13056 function foo14(x: typeof b); // error
13057 -function foo14(x: any) { }
13059 +function foo14(x: any) { }
13068 @@ -119,3 +119,6 @@ function foo16(x: I);
13069 function foo16(x: PB); // error
13070 function foo16(x: any) { }
13079 @@ -122,3 +122,8 @@ function foo16(x: I);
13080 function foo16(x: PB); // error
13081 function foo16(x: any) { }
13094 foo3<T>(x: T);
13095 foo3<T>(x: T); // no error, different declaration for each T
13119 new<T>(x: T): any;
13146 @@ -19,8 +19,8 @@ function foo<T extends { x: string }>(t: X<T>, t2: X<T>) {
13147 return x;
13150 -var c1 = new X<C>();
13151 -var d1 = new X<D>();
13152 +// var c1 = new X<C>();
13153 +// var d1 = new X<D>();
13157 @@ -30,4 +30,8 @@ function foo2<T extends C>(t: X<T>, t2: X<T>) {
13167 +let qu6 = new X();
13173 @@ -35,3 +35,4 @@ var r5 = f3(new Derived(), x => x);
13176 var r7 = f3(null, x => x); // any
13201 +let x = new X();
13221 @@ -0,0 +1,19 @@