Lines Matching full:foo
731 +import {foo, baz} from "foobarbaz";
732 +foo(baz);
735 +foo(foos);
739 +foo(fileText);
748 +declare module "foo*baz" {
749 + export function foo(s: string): void;
752 +declare module "foo*baz" {
806 +import foo, {bar} from "foo";
807 +foo;
816 +declare module "foo";
824 +declare module "foo" {
946 foo() { return 1; }
959 d = { foo: '' }
971 function foo() {
1134 + foo () {
1264 +function foo () {
1266 + static foo = 1;
1445 +async function foo () {
1542 +void class Foo {
1545 + console.log(Foo.prop);
1546 + Foo.prop++;
1549 + console.log(Foo.prop);
1550 + Foo.prop++;
1553 + console.log(Foo.prop);
1554 + Foo.prop++;
1672 +async function foo () {
1752 +function foo (v: number) {
1808 + static bar = A.foo + 1
1810 + A.foo + 2;
1812 + static foo = 1;
1941 +export interface Foo {}
2216 +import { Foo as Reflect } from "./external"; // collision (es2015-es2021 only, not a type-only imp…
2224 +import { Foo as Reflect } from "./external"; // collision (es2015-es2021 only, not a type-only imp…
2597 var r5 = t2.foo + 1;
2613 +declare const foo: any;
2615 +@foo
2621 +@foo
2628 + static foo () {
2650 + static foo () {
2670 +declare const foo: any;
2672 +@foo
2678 +@foo
2685 + static foo () {
2707 + static foo () {
2727 + static readonly c: "foo" = "foo"
2743 + static readonly c: "foo" = "foo"
2796 + constructor (private foo: string) {
2845 + function foo () {
2873 + function foo () {
2888 @@ -23,3 +23,5 @@ class Foo {
2891 console.log(new Foo("NAME").getValue(100));
2893 +let ff = new Foo(null)
2931 +class Foo {
2944 + const d = #field in (v as Foo);
2966 + flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | F…
2974 + u; // good u is Foo
2981 + u; // good u is Foo
2987 + u; // good u is Foo
2991 + u; // good u is typeof Foo
2995 + u; // good u is typeof Foo
3001 + fb; // good fb is Foo
3013 + b; // good b is 'Bar & Foo'
3025 + fsfb; // good fsfb is 'Foo | FooSub'
3033 + v; // good v is Foo
3040 +class FooSub extends Foo { subTypeOfFoo = true }
3043 +function badSyntax(v: Foo) {
3054 +class Foo {
3061 + #field in v; // expect Foo's 'field' WeakMap
3062 + #method in v; // expect Foo's 'instances' WeakSet
3063 + #staticField in v; // expect Foo's constructor
3064 + #staticMethod in v; // expect Foo's constructor
3094 +function syntaxError(v: Foo) {
3109 +class Foo {
3113 + isFoo(v: any): v is Foo {
3297 -d.foo();
3299 +d.foo();
3371 +const foo = (a) => {
3379 + foo(a);
3467 +function f20(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3468 + const isFoo = obj.kind === 'foo';
3470 + obj.foo;
3477 +function f21(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3478 + const isFoo: boolean = obj.kind === 'foo';
3480 + obj.foo; // Not narrowed because isFoo has type annotation
3487 +function f22(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3488 + let isFoo = obj.kind === 'foo';
3490 + obj.foo; // Not narrowed because isFoo is mutable
3497 +function f23(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3498 + const isFoo = obj.kind === 'foo';
3501 + obj.foo; // Not narrowed because obj is assigned in function body
3508 +function f24(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3510 + const isFoo = obj.kind === 'foo';
3512 + obj.foo;
3519 +function f25(arg: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3521 + const isFoo = obj.kind === 'foo';
3523 + obj.foo; // Not narrowed because obj is mutable
3530 +function f26(outer: { readonly obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number } })…
3531 + const isFoo = outer.obj.kind === 'foo';
3533 + outer.obj.foo;
3540 +function f27(outer: { obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number } }) {
3541 + const isFoo = outer.obj.kind === 'foo';
3543 + outer.obj.foo; // Not narrowed because obj is mutable
3550 +function f28(obj?: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3551 + const isFoo = obj && obj.kind === 'foo';
3554 + obj.foo;
3563 +function f30(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3565 + if (kind === 'foo') {
3566 + obj.foo;
3573 +function f31(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3575 + if (kind === 'foo') {
3576 + obj.foo;
3583 +function f32(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3585 + if (k === 'foo') {
3586 + obj.foo;
3593 +function f33(obj: { kind: 'foo', foo: string } | { kind: 'bar', bar: number }) {
3596 + case 'foo': obj.foo; break;
3633 +function f40(obj: { kind: 'foo', foo?: string } | { kind: 'bar', bar?: number }) {
3635 + const isFoo = kind == 'foo';
3636 + if (isFoo && obj.foo) {
3637 + let t: string = obj.foo;
3654 +function foo({ kind, payload }: Data) {
3982 +type Foo =
3987 +function f30({ kind, isA }: Foo) {
4060 +let qq4 = new Foo();
4083 +// let ff = new Foo('','','','','','','','','','')
4207 +class Foo {
4208 + public static func(): Foo {
4209 + return new Foo();
4212 +Foo.func();
4230 + class Foo {
4231 + public static func(): Foo {
4232 + return new Foo();
4235 + Foo.func();
4254 +class Foo {
4255 + public static func(): Foo {
4256 + return new Foo();
4259 +Foo.func();
4263 + class Foo {
4264 + public static func(): Foo {
4265 + return new Foo();
4268 + Foo.func();
4282 +class Foo {
4287 + foo() {
4302 +class Foo {
4305 + foo() {
4320 +class Foo {
4323 + foo() {
4338 +class Foo {
4340 + foo() {
4355 +class Foo {
4474 function foo() {
4477 -class C extends (foo()).B {}
4479 +class C extends (foo()).B {}
4572 as(Foo); // should emit
4573 +let qw11 = new Foo();
4782 super.foo(1, 2, ...a);
5250 ~foo();
5265 ~foo();
5290 +// @filename: /src/foo.mts
5291 +export function foo() {
5297 +import { foo } from "./foo"; // should error, suggest adding ".mjs"
5310 +import foo = require("./foo"); // should error, should not ask for extension
5322 +// @filename: /src/foo.tsx
5323 +export function foo() {
5329 +import { foo } from "./foo"; // should error, suggest adding ".jsx"
5340 +// @filename: /src/foo.tsx
5341 +export function foo() {
5347 +import { foo } from "./foo"; // should error, suggest adding ".js"
5359 +import("./foo").then(x => x); // should error, ask for extension
5374 +import { foo } from "./foo"; // should error, should not ask for extension
5387 +import foo = require("./foo"); // should error, should not ask for extension
5400 +import("./foo").then(x => x); // should error, ask for extension
5412 +import { type, as, something, foo, bar } from "./exports.js";
5416 +foo; // Error (used in emitting position)
5426 +export { type type as foo };
5655 +import * as foo from './0' assert { type: "json" }
5658 +foo.a;
5659 +foo.b;
5675 +declare function foo(): any;
5676 +const e = import('./0', foo())
5723 +import type * as foo from './0' assert { type: "json" }
5779 @@ -39,4 +39,5 @@ var a: Foo = {
6117 + * @typedef {T[K]} Foo
6122 +/** @type {Foo<typeof x, "a">} */
6149 +const foo = function (a, b, ...r) { };
6152 +foo(false, '');
6201 + <public-foo></public-foo>
6400 +// @filename: node_modules/foo/package.json
6402 + "name": "foo",
6406 +// @filename: node_modules/foo/index.js
6407 +var foo = 0;
6408 +module.exports = foo;
6410 +// @filename: node_modules/foo/index.d.ts
6411 +declare const foo: any;
6412 +export = foo;
6414 +// @filename: node_modules/foo/other.js
6418 +import * as Foo from "foo";
6419 +import * as Other from "foo/other"/*1*/;
6495 +// @filename: /node_modules/foo/index.js
6499 +import foo from "foo";
6500 +foo.bar();
6508 +declare module "foo" {
6521 +// @filename: /node_modules/foo/index.js
6527 +import { x } from "foo";
6900 +// @filename: foo.cjs
6901 +exports.foo = "foo"
6903 +import foo from "./foo.cjs"
6904 +foo.foo;
7282 +export {default as foo} from "fs";
7287 +export {default as foo} from "fs";
9495 abstract override foo(): number;
9533 override foo = "string";
9553 override foo = "string";
9566 +type Foo = abstract new(...args: any) => any;
9567 +declare function CreateMixin<C extends Foo, T extends Foo>(Context: C, Base: T): T & {
9577 + override foo() {} // Remove override
9592 +const Foo: C1 & C2 =
9615 +export class Bar extends Foo {
9663 foo();
9664 foo() { }
9686 foo();
9687 "foo"() { }
9927 declare Foo;
10027 +async function foo(x: any) {
10340 class C { foo: string; }
10431 export const x: import("./foo")<{x: number}> = { x: 0, y: 0, data: {x: 12} };
10454 export const x: import("./foo") = { x: 0, y: 0 };
10736 +declare let combo: { [x: `foo-${string}`]: 'a' | 'b' } & { [x: `${string}-bar`]: 'b' | 'c' };
10737 +const x1 = combo['foo-test']; // 'a' | 'b'
10739 +const x3 = combo['foo-test-bar']; // 'b' (('a' | 'b') & ('b' | 'c'))
10743 +const x4 = combo[`foo-${str}`];
10745 +const x6 = combo[`foo-${str}-bar`];
10781 + [key: symbol | `foo${string}`]: any; // Error
10782 + [key: `foo${string}`]: any; // Error
10961 +declare function foo<TArg, TRet, TDir>(options: { [x in string]: (arg: TArg) => TRet } & { [direct…
10963 +let case1 = foo({
10969 +let case2 = foo({
10975 +let case3 = foo({
11051 var r10 = a.foo;
11052 var r11 = a['foo'];
11087 var r1: Derived1 = c.foo('hi');
11088 var r2: Derived2 = c.foo('bye');
11089 -var r3: Base = c.foo('hm');
11091 +var r3: Base = c.foo('hm');
11153 export class C { foo: string }
11174 foo(x, x) { },
11175 a: function foo(x: number, x: string) { },
11199 a.foo(1);
11200 a.foo(1, 2);
11201 -a.foo(1, 2, 3);
11203 +a.foo(1, 2, 3);
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') { },
11308 var r1 = (new C()).foo;
11309 var r2 = (<I>null).foo;
11310 var r3 = a.foo;
11311 -var r4 = b.foo;
11313 +var r4 = b.foo;
11466 foo: number;
11491 + data = { foo: '' };
11494 + var copy: typeof this.data = { foo: '' };
11495 + var foo: typeof this.data.foo = '';
11580 + foo() {
11596 + foo() {
11710 var z = c.foo().bar().baz(); // Fluent pattern
11757 +class Foo {
11763 +Foo.m`test`;
11764 +(Foo.m)`test`;
11771 k: readonly [string, number] = ['foo', 42];
11837 // foo(x);
11838 // foo(y);
11851 var r9 = foo(function <U>(x: U) { return x; });
11852 var r10 = foo(<U extends string>(x: U) => x);
11853 var r12 = foo(i2);
11854 -var r15 = foo(c2);
11856 +var r15 = foo(c2);
11883 -var r4 = b.foo(new Date());
11885 +var r4 = b.foo(new Date());
11893 var r3 = a<A, A>().foo();
11894 var r3b = a()['foo']();
11898 var r3c = a(aB, aB).foo();
11899 var r3d = a(aB, aB)['foo']();
11905 -var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, error
11907 +var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, error
11920 -var r4 = b.foo(new B()); // valid call to an invalid function
11922 +var r4 = b.foo(new B()); // valid call to an invalid function
11934 -var r4 = b.foo(1);
11936 +var r4 = b.foo(1);
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) {
11990 foo: any;
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) {
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) {
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) {
12260 -var c1 = new Foo<D<string>>(); // ok, circularity in assignment compat check causes success
12262 +var c1 = new Foo<D<string>>(); // ok, circularity in assignment compat check causes success
12264 +let foo = new Foo();
12315 foo: {};
12480 foo: {};
13146 @@ -19,8 +19,8 @@ function foo<T extends { x: string }>(t: X<T>, t2: X<T>) {
13154 var r = foo(c1, d1);
13155 var r2 = foo(c1, c1);