file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
crates/swc_ecma_parser/tests/tsc/objectSpreadSetonlyAccessor.ts
TypeScript
// @strict: true // @target: esnext const o1: { foo: number, bar: undefined } = { foo: 1, ... { set bar(_v: number) { } } } const o2: { foo: undefined } = { foo: 1, ... { set foo(_v: number) { } } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectSpreadStrictNull.ts
TypeScript
// @strictNullChecks: true function f( definiteBoolean: { sn: boolean }, definiteString: { sn: string }, optionalString: { sn?: string }, optionalNumber: { sn?: number }, undefinedString: { sn: string | undefined }, undefinedNumber: { sn: number | undefined }) { // optional let optional...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeHidingMembersOfExtendedObject.ts
TypeScript
// @skipDefaultLibCheck: false class A { foo: string; } class B extends A { bar: string; } interface Object { data: A; [x: string]: Object; } class C { valueOf() { } data: B; [x: string]: any; } var c: C; var r1: void = c.valueOf(); var r1b: B = c.data; var r1c = r1b['hm']; // should be ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeHidingMembersOfObject.ts
TypeScript
// all of these valueOf calls should return the type shown in the overriding signatures here class C { valueOf() { } } var c: C; var r1: void = c.valueOf(); interface I { valueOf(): void; } var i: I; var r2: void = i.valueOf(); var a = { valueOf: () => { } } var r3: void = a.valueOf(); var b: { v...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeHidingMembersOfObjectAssignmentCompat.ts
TypeScript
interface I { toString(): void; } var i: I; var o: Object; o = i; // error i = o; // ok class C { toString(): void { } } var c: C; o = c; // error c = o; // ok var a = { toString: () => { } } o = a; // error a = o; // ok
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeHidingMembersOfObjectAssignmentCompat2.ts
TypeScript
interface I { toString(): number; } var i: I; var o: Object; o = i; // error i = o; // error class C { toString(): number { return 1; } } var c: C; o = c; // error c = o; // error var a = { toString: () => { } } o = a; // error a = o; // ok
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeLiteralSyntax.ts
TypeScript
var x: { foo: string; bar: string; } var y: { foo: string; bar: string }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypePropertyAccess.ts
TypeScript
// Index notation should resolve to the type of a declared property with that same name class C { foo: string; } var c: C; var r1 = c.toString(); var r2 = c['toString'](); var r3 = c.foo; var r4 = c['foo']; interface I { bar: string; } var i: I; var r4 = i.toString(); var r5 = i['toString'](); var r6 = i.bar;...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithCallSignatureAppearsToBeFunctionType.ts
TypeScript
// objects with call signatures should be permitted where function types are expected // no errors expected below interface I { (): void; } var i: I; var r2: void = i(); var r2b: (x: any, y?: any) => any = i.apply; var b: { (): void; } var r4: void = b(); var rb4: (x: any, y?: any) => any = b.apply;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts
TypeScript
// object types with call signatures can override members of Function // no errors expected below interface Function { data: number; [x: string]: Object; } interface I { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } var i: I; var r1: (a: any, b?: an...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithCallSignatureHidingMembersOfFunction.ts
TypeScript
// object types with call signatures can override members of Function // no errors expected below interface I { (): void; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } var i: I; var r1: (a: any, b?: any) => void = i.apply; var r1b: (thisArg: number, ...argArray: numbe...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithCallSignatureHidingMembersOfFunctionAssignmentCompat.ts
TypeScript
interface I { (): void; } var i: I; var f: Object; f = i; i = f; var a: { (): void } f = a; a = f;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithConstructSignatureAppearsToBeFunctionType.ts
TypeScript
// no errors expected below interface I { new(): number; } var i: I; var r2: number = i(); var r2b: number = new i(); var r2c: (x: any, y?: any) => any = i.apply; var b: { new(): number; } var r4: number = b(); var r4b: number = new b(); var r4c: (x: any, y?: any) => any = b.apply;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.ts
TypeScript
interface Function { data: number; [x: string]: Object; } interface I { new(): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } var i: I; var r1: (a: any, b?: any) => void = i.apply; var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; var r...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithConstructSignatureHidingMembersOfFunction.ts
TypeScript
interface I { new(): number; apply(a: any, b?: any): void; call(thisArg: number, ...argArray: number[]): any; } var i: I; var r1: (a: any, b?: any) => void = i.apply; var r1b: (thisArg: number, ...argArray: number[]) => void = i.call; var r1c = i.arguments; var x: { new(): number; apply(a: any, b?...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithConstructSignatureHidingMembersOfFunctionAssignmentCompat.ts
TypeScript
interface I { new(): any; } var i: I; var f: Object; f = i; i = f; var a: { new(): any } f = a; a = f;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithNumericProperty.ts
TypeScript
// no errors here class C { 1: number; 1.1: string; } var c: C; var r1 = c[1]; var r2 = c[1.1]; var r3 = c['1']; var r4 = c['1.1']; interface I { 1: number; 1.1: string; } var i: I; var r1 = i[1]; var r2 = i[1.1]; var r3 = i['1']; var r4 = i['1.1']; var a: { 1: number; 1.1: string; } var r...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithRecursiveWrappedProperty.ts
TypeScript
// Basic recursive type class List<T> { data: T; next: List<List<T>>; } var list1 = new List<number>(); var list2 = new List<number>(); var list3 = new List<string>(); list1 = list2; // ok list1 = list3; // error
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithRecursiveWrappedProperty2.ts
TypeScript
// Basic recursive type class List<T> { data: T; next: List<List<T>>; } var list1 = new List<number>(); var list2 = new List<number>(); var list3 = new List<string>(); list1 = list2; // ok list1 = list3; // error
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts
TypeScript
// Types with infinitely expanding recursive types are type checked nominally class List<T> { data: T; next: List<List<T>>; } class MyList<T> { data: T; next: MyList<MyList<T>>; } var list1 = new List<number>(); var list2 = new List<string>(); var myList1 = new MyList<number>(); var myList2 = new My...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithStringAndNumberIndexSignatureToAny.ts
TypeScript
// @strict: true // When checking compatibility between two types, // TypeScript should not require an index signature if // the target side index signature maps to `any` *and* // the target side has *any* string index signature to `any`. // // So an index signature like in // // { [x: number]: any } // // is still r...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithStringIndexerHidingObjectIndexer.ts
TypeScript
// @skipDefaultLibCheck: false // object types can define string indexers that are more specific than the default 'any' that would be returned // no errors expected below interface Object { [x: string]: Object; } var o = {}; var r = o['']; // should be Object class C { foo: string; [x: string]: string; }...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypeWithStringNamedPropertyOfIllegalCharacters.ts
TypeScript
class C { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; "a\a": number; static "a ": number } var c: C; var r = c[" "]; var r2 = c[" "]; var r3 = c["a b"]; // BUG 817263 var r4 = c["~!@#$%^&*()_+{}|:'<>?\/.,`"]; interface I { " ": number; "a b": string; ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentity.ts
TypeScript
// object types are identical structurally class A { foo: string; } class B { foo: string; } class C<T> { foo: T; } interface I { foo: string; } var a: { foo: string; } var b = { foo: '' }; function foo1(x: A); function foo1(x: A); // error function foo1(x: any) { } function foo1b(x: B); function...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentity2.ts
TypeScript
// object types are identical structurally class A { foo: number; } class B { foo: boolean; } class C<T> { foo: T; } interface I { foo: Date; } var a: { foo: RegExp; } enum E { A } var b = { foo: E.A }; function foo5(x: A); function foo5(x: B); // ok function foo5(x: any) { } function foo5b(x: A)...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignatures.ts
TypeScript
// object types are identical structurally class A { foo(x: string): string { return null; } } class B { foo(x: string): string { return null; } } class C<T> { foo(x: T): T { return null; } } interface I { foo(x: string): string; } interface I2<T> { foo(x: T): T; } var a: { foo(x: string): str...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignatures2.ts
TypeScript
// object types are identical structurally class A { foo(x: string): string { return null; } } class B { foo(x: number): string { return null; } } class C<T> { foo(x: T): T { return null; } } interface I { foo(x: boolean): string; } interface I2<T> { foo(x: T): T; } var a: { foo(x: Date): stri...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignatures3.ts
TypeScript
// object types are identical structurally interface I { (x: string): string; } interface I2<T> { (x: T): T; } var a: { (x: string): string } function foo2(x: I); function foo2(x: I); // error function foo2(x: any) { } function foo3(x: typeof a); function foo3(x: typeof a); // error function foo3(x: any) {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts
TypeScript
// object types are identical structurally class A { foo(x: string): string { return null; } } class B { foo(x: string, y: string): string { return null; } } class C<T> { foo(x: T, y: T): T { return null; } } interface I { foo(x: string): string; } interface I2<T> { foo(x: T): T; } var a: { fo...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts
TypeScript
// object types are identical structurally interface I { (x: string): string; } interface I2<T> { (x: T): T; } var a: { (x: string, y: string): string } function foo2(x: I); function foo2(x: I); // error function foo2(x: any) { } function foo3(x: typeof a); function foo3(x: typeof a); // error function foo...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithCallSignaturesWithOverloads.ts
TypeScript
// object types are identical structurally class A { foo(x: number): number; foo(x: string): string; foo(x: any): any { return null; } } class B { foo(x: number): number; foo(x: string): string; foo(x: any): any { return null; } } class C<T> { foo(x: number): number; foo(x: string): s...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithComplexConstraints.ts
TypeScript
interface A { <T extends { <S extends A>(x: T, y: S): void }>(x: T, y: T): void } interface B { <U extends B>(x: U, y: U): void } // ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters function foo(x: A); function foo(x: B); /...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithConstructSignatures.ts
TypeScript
// object types are identical structurally class A { constructor(x: string) { } } class B { constructor(x: string) { } } class C<T> { constructor(x: T) { } } interface I { new(x: string); } interface I2<T> { new(x: T): T; } var a: { new(x: string) } function foo1(x: A); function foo1(x: A); /...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithConstructSignatures2.ts
TypeScript
// object types are identical structurally class B { constructor(x: number) { return null; } } class C<T> { constructor(x: T) { return null; } } interface I { new(x: boolean): string; } interface I2<T> { new(x: T): T; } var a: { new(x: Date): string } var b = { new(x: RegExp) { return ''; } }; // n...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts
TypeScript
// object types are identical structurally class B { constructor(x: string, y: string) { return null; } } class C<T> { constructor(x: T, y: T) { return null; } } interface I { new(x: string): string; } interface I2<T> { new(x: T): T; } var a: { new(x: string, y: string): string } var b = { new(x: s...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignatures.ts
TypeScript
// object types are identical structurally class A { foo<T>(x: T): T { return null; } } class B<T> { foo(x: T): T { return null; } } class C<T> { foo(x: T): T { return null; } } interface I<T> { foo(x: T): T; } interface I2 { foo<T>(x: T): T; } var a: { foo<T>(x: T): T } var b = { foo<T>(x: T)...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignatures2.ts
TypeScript
// object types are identical structurally class A { foo<T, U>(x: T, y: U): T { return null; } } class B<T, U> { foo(x: T, y: U): T { return null; } } class C<T, U> { foo(x: T, y: U): T { return null; } } interface I<T, U> { foo(x: T, y: U): T; } interface I2 { foo<T, U>(x: T, y: U): T; } var ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts
TypeScript
// object types are identical structurally class A { foo<T>(x: T): T { return null; } } class B<U, V> { foo(x: U): U { return null; } } class C<V, W, X> { foo(x: V): V { return null; } } interface I<X, Y, Z, A> { foo(x: X): X; } interface I2 { foo<Y, Z, A, B>(x: Y): Y; } var a: { foo<Z, A, B, ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts
TypeScript
// object types are identical structurally interface I<X, Y, Z, A> { (x: X): X; } interface I2 { <Y, Z, A, B>(x: Y): Y; } var a: { <Z, A, B, C, D>(x: Z): Z } function foo1(x: I<string, boolean, number, string>); function foo1(x: I<string, boolean, number, string>); // error function foo1(x: any) { } funct...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts
TypeScript
// object types are identical structurally class A { foo<T>(x: T): T { return null; } } class B<U> { foo(x: U): U { return null; } } class C<V> { foo(x: V): V { return null; } } interface I<X> { foo(x: X): X; } interface I2 { foo<Y>(x: Y): Y; } var a: { foo<Z>(x: Z): Z } var b = { foo<A>(x: A)...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts
TypeScript
// object types are identical structurally class B<U, V> { constructor(x: U) { return null; } } class C<V, W, X> { constructor(x: V) { return null; } } interface I<X, Y, Z, A> { new(x: X): B<X,Y>; } interface I2 { new <Y, Z, A, B>(x: Y): C<Y, Z, A>; } var a: { new <Z, A, B, CC, D>(x: Z): C<Z, A, B>...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts
TypeScript
// object types are identical structurally class B<U> { constructor(x: U) { return null; } } class C<V> { constructor(x: V) { return null; } } interface I<X> { new(x: X): B<X>; } interface I2 { new<Y>(x: Y): C<Y>; } var a: { new<Z>(x: Z): B<Z> } var b = { new<A>(x: A) { return new C<A>(x); } }; fu...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts
TypeScript
// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, // optional or rest) and types, and identical ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithNumericIndexers1.ts
TypeScript
// object types are identical structurally class A { [x: number]: string; } class B { [x: number]: string; } class C<T> { [x: number]: T; } interface I { [x: number]: string; } class PA extends A { } class PB extends B { } var a: { [x: number]: string; } var b: { [x: number]: string; } = { 0:...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithNumericIndexers2.ts
TypeScript
// object types are identical structurally class Base { foo: string; } class Derived extends Base { bar: string; } class A { [x: number]: Base; } class B { [x: number]: Derived; } class C<T> { [x: number]: T; } interface I { [x: number]: Derived; } class PA extends A { } class PB extends B { } v...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithNumericIndexers3.ts
TypeScript
// object types are identical structurally class A { [x: number]: string; } class B { [x: string]: string; } class C<T> { [x: number]: T; } interface I { [x: string]: string; } class PA extends A { } class PB extends B { } var a: { [x: string]: string; } var b: { [x: number]: string; } = { 0:...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithOptionality.ts
TypeScript
// object types are identical structurally class A { foo: string; } class B { foo: string; } class C<T> { foo: T; } interface I { foo?: string; } var a: { foo?: string; } var b = { foo: '' }; function foo2(x: I); function foo2(x: I); // error function foo2(x: any) { } function foo3(x: typeof a); ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates.ts
TypeScript
// object types are identical structurally class A { private foo: string; } class B { private foo: string; } class C<T> { private foo: T; } interface I { foo: string; } class PA extends A { } class PB extends B { } var a: { foo: string; } var b = { foo: '' }; function foo1(x: A); function foo1(x...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates2.ts
TypeScript
// object types are identical structurally class C<T> { private foo: T; } class D<T> extends C<T> { } function foo1(x: C<string>); function foo1(x: C<number>); // ok function foo1(x: any) { } function foo2(x: D<string>); function foo2(x: D<number>); // ok function foo2(x: any) { } function foo3(x: C<string>); ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPrivates3.ts
TypeScript
interface T1 { } interface T2 { z } class C1<T> { private x; } class C2 extends C1<T1> { y; } var c1: C1<T2>; <C2>c1; // Should succeed (private x originates in the same declaration) class C3<T> { private x: T; // This T is the difference between C3 and C1 } class C4 extends C3<T1> { y; } var c3...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithPublics.ts
TypeScript
// object types are identical structurally class A { public foo: string; } class B { public foo: string; } class C<T> { public foo: T; } interface I { foo: string; } var a: { foo: string; } var b = { foo: '' }; function foo1(x: A); function foo1(x: A); // error function foo1(x: any) { } function ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithStringIndexers.ts
TypeScript
// object types are identical structurally class A { [x: string]: string; } class B { [x: string]: string; } class C<T> { [x: string]: T; } interface I { [x: string]: string; } class PA extends A { } class PB extends B { } var a: { [x: string]: string; } var b: { [x: string]: string; } = { fo...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesIdentityWithStringIndexers2.ts
TypeScript
// object types are identical structurally class Base { foo: string; } class Derived extends Base { bar: string; } class A { [x: string]: Base; } class B { [x: string]: Derived; } class C<T> { [x: string]: T; } interface I { [x: string]: Derived; } class PA extends A { } class PB extends B { } v...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/objectTypesWithPredefinedTypesAsName.ts
TypeScript
// it is an error to use a predefined type as a type name class any { } class number { } class boolean { } class bool { } // not a predefined type anymore class string { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/octalIntegerLiteral.ts
TypeScript
// @target: es5 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/octalIntegerLiteralES6.ts
TypeScript
// @target: es6 var oct1 = 0o45436; var oct2 = 0O45436; var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/operatorsAndIntersectionTypes.ts
TypeScript
type Guid = string & { $Guid }; // Tagged string type type SerialNo = number & { $SerialNo }; // Tagged number type function createGuid() { return "21EC2020-3AEA-4069-A2DD-08002B30309D" as Guid; } function createSerialNo() { return 12345 as SerialNo; } let map1: { [x: string]: number } = {}; let gu...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParameters1.ts
TypeScript
 function foo([x,y,z]?: [string, number, boolean]) { } foo(["", 0, false]); foo([false, 0, ""]);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParameters2.ts
TypeScript
 function foo({ x, y, z }?: { x: string; y: number; z: boolean }) { } foo({ x: "", y: 0, z: false }); foo({ x: false, y: 0, z: "" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParameters3.ts
TypeScript
// @checkJs: true // @allowJs: true // @noEmit: true // @filename: /a.js /** * @typedef Foo * @property {string} a */ /** * @param {Foo} [options] */ function f({ a = "a" }) {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParameters4.ts
TypeScript
// @checkJs: true // @allowJs: true // @noEmit: true // @filename: /a.js /** * @param {{ cause?: string }} [options] */ function foo({ cause } = {}) { return cause; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads1.ts
TypeScript
 function foo([x, y, z] ?: [string, number, boolean]); function foo(...rest: any[]) { } foo(["", 0, false]); foo([false, 0, ""]);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalBindingParametersInOverloads2.ts
TypeScript
 function foo({ x, y, z }?: { x: string; y: number; z: boolean }); function foo(...rest: any[]) { } foo({ x: "", y: 0, z: false }); foo({ x: false, y: 0, z: "" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInArrow.ts
TypeScript
// @target: es5 // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/41814 const test = (names: string[]) => // single-line comment names?.filter(x => x);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInLoop.ts
TypeScript
// @target: es5 // @lib: es2015 // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/40643 const list: any[] = [] for (const comp of list) { comp.sp.y = comp.sp.r.find((k: any) => k.c == (comp.xp ? '1' : '0')) for (const item of comp.c) { item.v = !!item.t?.length } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInParameterBindingPattern.2.ts
TypeScript
// @target: esnext,es2015,es5 // @noTypesAndSymbols: true // @noEmit: true // https://github.com/microsoft/TypeScript/issues/36295 const a = (): { d: string } | undefined => undefined; (({ [a()?.d]: c = "" }) => { var a; })(); const x = ""; (({ [a()?.d]: c }, d = x) => { var x; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInParameterBindingPattern.ts
TypeScript
// @target: esnext,es2015,es5 // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 const a = (): { d: string } | undefined => undefined; (({ [a()?.d]: c = "" }) => {})();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInParameterInitializer.2.ts
TypeScript
// @target: esnext,es2015,es5 // @noTypesAndSymbols: true // @noEmit: true // https://github.com/microsoft/TypeScript/issues/36295 const a = (): { d: string } | undefined => undefined; ((b = a()?.d) => { var a; })(); const x = ""; ((b = a()?.d, d = x) => { var x; })();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInParameterInitializer.ts
TypeScript
// @target: esnext,es2015,es5 // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/36295 const a = (): { d: string } | undefined => undefined; ((b = a()?.d) => {})();
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInTypeAssertions.ts
TypeScript
// @target: es2015, esnext class Foo { m() {} } const foo = new Foo(); (foo.m as any)?.(); (<any>foo.m)?.(); /*a1*/(/*a2*/foo.m as any/*a3*/)/*a4*/?.(); /*b1*/(/*b2*/<any>foo.m/*b3*/)/*b4*/?.(); // https://github.com/microsoft/TypeScript/issues/50148 (foo?.m as any).length; (<any>foo?.m).length; (foo?.["m"] as...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalChainingInference.ts
TypeScript
// https://github.com/microsoft/TypeScript/issues/34579 declare function unbox<T>(box: { value: T | undefined }): T; declare const su: string | undefined; declare const fnu: (() => number) | undefined; declare const osu: { prop: string } | undefined; declare const ofnu: { prop: () => number } | undefined; const b1 = {...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalMethod.ts
TypeScript
// @target: esnext // @noTypesAndSymbols: true class Base { method?() { } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalMethodDeclarations.ts
TypeScript
// @target: esnext,es2016 // @noTypesAndSymbols: true // https://github.com/microsoft/TypeScript/issues/34952#issuecomment-552025027 class C { // ? should be removed in emit method?() {} }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalMethods.ts
TypeScript
// @strictNullChecks: true // @declaration: true interface Foo { a: number; b?: number; f(): number; g?(): number; } function test1(x: Foo) { x.a; x.b; x.f; x.g; let f1 = x.f(); let g1 = x.g && x.g(); let g2 = x.g ? x.g() : 0; } class Bar { a: number; b?: number; ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalProperties01.ts
TypeScript
// @strictNullChecks: true // @declaration: true interface Foo { required1: string; required2: string; optional?: string; } const foo1 = { required1: "hello" } as Foo; const foo2 = { required1: "hello", optional: "bar" } as Foo;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalProperties02.ts
TypeScript
// @strictNullChecks: true // @declaration: true interface Foo { a?: string; b: string; } <Foo>{ a: undefined };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalProperty.ts
TypeScript
// @target: esnext // @useDefineForClassFields: true // @noTypesAndSymbols: true class C { prop?; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/optionalPropertyAssignableToStringIndexSignature.ts
TypeScript
// @strict: true declare let optionalProperties: { k1?: string }; declare let undefinedProperties: { k1: string | undefined }; declare let stringDictionary: { [key: string]: string }; stringDictionary = optionalProperties; // ok stringDictionary = undefinedProperties; // error declare let probablyArray: { [key: num...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/outFilerootDirModuleNamesAmd.ts
TypeScript
// @target: ES6 // @module: amd // @rootDir: src // @outFile: output.js // @filename: src/a.ts import foo from "./b"; export default class Foo {} foo(); // @filename: src/b.ts import Foo from "./a"; export default function foo() { new Foo(); } // https://github.com/microsoft/TypeScript/issues/37429 import("./a");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/outFilerootDirModuleNamesSystem.ts
TypeScript
// @target: ES6 // @module: system // @rootDir: src // @outFile: output.js // @filename: src/a.ts import foo from "./b"; export default class Foo {} foo(); // @filename: src/b.ts import Foo from "./a"; export default function foo() { new Foo(); } // https://github.com/microsoft/TypeScript/issues/37429 import("./a");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/overloadResolution.ts
TypeScript
class SomeBase { private n; public s: string; } class SomeDerived1 extends SomeBase { private m; } class SomeDerived2 extends SomeBase { private m; } class SomeDerived3 extends SomeBase { private m; } // Ambiguous call picks the first overload in declaration order function fn1(s: string): string;...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/overloadResolutionClassConstructors.ts
TypeScript
class SomeBase { private n; public s: string; } class SomeDerived1 extends SomeBase { private m; } class SomeDerived2 extends SomeBase { private m; } class SomeDerived3 extends SomeBase { private m; } // Ambiguous call picks the first overload in declaration order class fn1 { constructor(s: s...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/overloadResolutionConstructors.ts
TypeScript
class SomeBase { private n; public s: string; } class SomeDerived1 extends SomeBase { private m; } class SomeDerived2 extends SomeBase { private m; } class SomeDerived3 extends SomeBase { private m; } interface fn1 { new (s: string): string; new (s: number): number; } var fn1: fn1; // Amb...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/overloadTag1.ts
TypeScript
// @checkJs: true // @allowJs: true // @outdir: foo // @declaration: true // @filename: overloadTag1.js /** * @overload * @param {number} a * @param {number} b * @returns {number} * * @overload * @param {string} a * @param {boolean} b * @returns {string} * * @param {string | number} a * @param {string | n...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_parser/tests/tsc/overloadTag2.ts
TypeScript
// @checkJs: true // @allowJs: true // @target: esnext // @outdir: foo // @declaration: true // @filename: overloadTag2.js // @strict: true export class Foo { #a = true ? 1 : "1" #b /** * Should not have an implicit any error, because constructor's return type is always implicit * @constructor ...
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University