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/subtypingWithConstructSignatures2.ts | TypeScript | // checking subtype relations for function types as it relates to contextual signature instantiation
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class OtherDerived extends Base { bing: string; }
declare function foo1(a: new (x: number) => num... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignatures3.ts | TypeScript | // checking subtype relations for function types as it relates to contextual signature instantiation
// error cases, so function calls will all result in 'any'
module Errors {
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class O... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignatures4.ts | TypeScript | // checking subtype relations for function types as it relates to contextual signature instantiation
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
class OtherDerived extends Base { bing: string; }
declare function foo1(a: new <T>(x: T) => T[]);... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignatures5.ts | TypeScript | // checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignatures6.ts | TypeScript | // checking subtype relations for function types as it relates to contextual signature instantiation
// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
// all are errors
class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extend... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignaturesWithOptionalParameters.ts | TypeScript | // call signatures in derived types must have the same or fewer optional parameters as the base type
interface Base {
a: new () => number;
a2: new (x?: number) => number;
a3: new (x: number) => number;
a4: new (x: number, y?: number) => number;
a5: new (x?: number, y?: number) => number;
}
interf... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithConstructSignaturesWithSpecializedSignatures.ts | TypeScript | // same as subtypingWithCallSignatures but with additional specialized signatures that should not affect the results
module CallSignature {
interface Base { // T
// M's
new (x: 'a'): void;
new (x: string, y: number): void;
}
// S's
interface I extends Base {
// N's
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithGenericCallSignaturesWithOptionalParameters.ts | TypeScript | // call signatures in derived types must have the same or fewer optional parameters as the base type
module ClassTypeParam {
interface Base<T> {
a: () => T;
a2: (x?: T) => T;
a3: (x: T) => T;
a4: (x: T, y?: T) => T;
a5: (x?: T, y?: T) => T;
}
interface I1<T> extends... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithGenericConstructSignaturesWithOptionalParameters.ts | TypeScript | // call signatures in derived types must have the same or fewer optional parameters as the base type
module ClassTypeParam {
interface Base<T> {
a: new () => T;
a2: new (x?: T) => T;
a3: new (x: T) => T;
a4: new (x: T, y?: T) => T;
a5: new (x?: T, y?: T) => T;
}
int... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithNumericIndexer.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: number]: Base;
}
class B extends A {
[x: number]: Derived; // ok
}
class B2 extends A {
[x: numbe... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithNumericIndexer2.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
interface A {
[x: number]: Derived;
}
interface B extends A {
[x: number]: Base; // error
}
interface B2 extends A ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithNumericIndexer3.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: number]: Derived;
}
class B extends A {
[x: number]: Base; // error
}
class B2 extends A {
[x: nu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithNumericIndexer4.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: number]: Derived;
}
class B extends A {
[x: number]: string; // error
}
module Generics {
class A... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithNumericIndexer5.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
interface A {
[x: number]: Derived;
}
class B implements A {
[x: string]: Base; // error
}
class B2 implements A {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembers.ts | TypeScript | class Base { foo: string; }
class Derived extends Base { bar: string; }
class Derived2 extends Derived { baz: string; }
// N and M have the same name, same accessibility, same optionality, and N is a subtype of M
// foo properties are valid, bar properties cause errors in the derived class declarations
class A {
f... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembers2.ts | TypeScript | interface Base {
foo: string;
}
interface Derived extends Base {
bar: string;
}
// N and M have the same name, same accessibility, same optionality, and N is a subtype of M
// foo properties are valid, bar properties cause errors in the derived class declarations
module NotOptional {
interface A {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembers3.ts | TypeScript | interface Base {
foo: string;
}
interface Derived extends Base {
bar: string;
}
// N and M have the same name, same accessibility, same optionality, and N is a subtype of M
// foo properties are valid, bar properties cause errors in the derived class declarations
module NotOptional {
interface A {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembers4.ts | TypeScript | // subtyping when property names do not match
class Base {
foo: string;
}
class Derived extends Base {
bar: string;
}
class A {
foo: Base;
}
class B extends A {
fooo: Derived; // ok, inherits foo
}
class A2 {
1: Base;
}
class B2 extends A2 {
1.1: Derived; // ok, inherits 1
}
class A3 {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembers5.ts | TypeScript | interface Base {
foo: string;
}
interface Derived extends Base {
bar: string;
}
// N and M have the same name, same accessibility, same optionality, and N is a subtype of M
// foo properties are valid, bar properties cause errors in the derived class declarations
module NotOptional {
interface A {
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersAccessibility.ts | TypeScript | // Derived member is private, base member is not causes errors
class Base {
foo: string;
}
class Derived extends Base {
bar: string;
}
class A {
public foo: Base;
}
class B extends A {
private foo: Derived; // error
}
class A2 {
public 1: Base;
}
class B2 extends A2 {
private 1: Derived; ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersAccessibility2.ts | TypeScript | // Derived member is private, base member is not causes errors
class Base {
foo: string;
}
class Derived extends Base {
bar: string;
}
module ExplicitPublic {
class A {
private foo: Base;
}
class B extends A {
public foo: Derived; // error
}
class A2 {
private 1:... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersOptionality.ts | TypeScript | // Derived member is not optional but base member is, should be ok
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparen... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersOptionality2.ts | TypeScript | // Derived member is optional but base member is not, should be an error
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface T {
Foo: Base;
}
interface S extends T {
Foo?: Derived // error
}
interface T2 {
1: Base;
}
interface S2 extends T2 {
1?: Derived; // er... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersOptionality3.ts | TypeScript | // Base property is optional and derived type has no property of that name
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface T {
Foo?: Base;
}
interface S extends T {
Foo2: Derived // ok
}
interface T2 {
1?: Base;
}
interface S2 extends T2 {
2: Derived; // ok... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithObjectMembersOptionality4.ts | TypeScript | // Base has required property, derived adds an optional property, no errors
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface T {
Foo: Base;
}
interface S extends T {
Foo2?: Derived // ok
}
interface T2 {
1: Base;
}
interface S2 extends T2 {
2?: Derived; // ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithOptionalProperties.ts | TypeScript | // subtyping is not transitive due to optional properties but the subtyping algorithm assumes it is for the 99% case
// returns { s?: number; }
function f<T>(a: T) {
var b: { s?: number } = a;
return b;
}
var r = f({ s: new Object() }); // ok
r.s && r.s.toFixed(); // would blow up at runtime | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithStringIndexer.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: string]: Base;
}
class B extends A {
[x: string]: Derived; // ok
}
class B2 extends A {
[x: strin... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithStringIndexer2.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
interface A {
[x: string]: Derived;
}
interface B extends A {
[x: string]: Base; // error
}
interface B2 extends A ... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithStringIndexer3.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: string]: Derived;
}
class B extends A {
[x: string]: Base; // error
}
class B2 extends A {
[x: st... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/subtypingWithStringIndexer4.ts | TypeScript | // Derived type indexer must be subtype of base type indexer
interface Base { foo: string; }
interface Derived extends Base { bar: string; }
interface Derived2 extends Derived { baz: string; }
class A {
[x: string]: Derived;
}
class B extends A {
[x: string]: string; // error
}
module Generics {
class A... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing1.ts | TypeScript | declare var Factory: any
class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(i);
var s = {
t: this._t
}
var i = Factory.create(s);
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing2.ts | TypeScript | class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
super(() => { this._t }); // no error. only check when this is directly accessing in constructor
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing5.ts | TypeScript | class D extends null {
private _t;
constructor() {
this._t; // No error
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallBeforeThisAccessing8.ts | TypeScript | class Base {
constructor(c) { }
}
class D extends Base {
private _t;
constructor() {
let x = {
k: super(undefined),
j: this._t, // no error
}
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallFromClassThatHasNoBaseTypeButWithSameSymbolInterface.ts | TypeScript | interface Foo extends Array<number> {}
class Foo {
constructor() {
super(); // error
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallInConstructorWithNoBaseType.ts | TypeScript | class C {
constructor() {
super(); // error
}
}
class D<T> {
public constructor(public x: T) {
super(); // error
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping1.ts | TypeScript |
class A<T1, T2> {
constructor(private map: (value: T1) => T2) {
}
}
class B extends A<number, string> {
// Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method.
constructor() { super(value => String(value.toExponential())); }
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping2.ts | TypeScript |
class A<T1, T2> {
constructor(private map: (value: T1) => T2) {
}
}
class C extends A<number, string> {
// Ensure 'value' is not of type 'any' by invoking it with type arguments.
constructor() { super(value => String(value<string>())); }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCallParameterContextualTyping3.ts | TypeScript | interface ContextualType<T> {
method(parameter: T): void;
}
class CBase<T> {
constructor(param: ContextualType<T>) {
}
foo(param: ContextualType<T>) {
}
}
class C extends CBase<string> {
constructor() {
// Should be okay.
// 'p' should have type 'string'.
super({
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superCalls.ts | TypeScript | class Base {
x = 43;
constructor(n: string) {
}
}
function v(): void { }
class Derived extends Base {
//super call in class constructor of derived type
constructor(public q: number) {
super('');
//type of super call expression is void
var p = super('');
var p = v()... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superInStaticMembers1.ts | TypeScript | // @target: es5, es2015, es2021, es2022, esnext
// @noTypesAndSymbols: true
// @filename: external.ts
export class Reflect {}
export interface Foo {}
export declare namespace Bar { type _ = unknown; }
export const enum Baz {}
export default class {};
// @filename: locals.ts
export {};
declare class B { static w(): nu... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superMethodCall.ts | TypeScript | // @strict: true
// @target: ES6
class Base {
method?() { }
}
class Derived extends Base {
method() {
return super.method?.();
}
async asyncMethod() {
return super.method?.();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superPropertyAccessNoError.ts | TypeScript | // @target: es5
//super.publicInstanceMemberFunction in constructor of derived class
//super.publicInstanceMemberFunction in instance member function of derived class
//super.publicInstanceMemberFunction in instance member accessor(get and set) of derived class
//super.publicInstanceMemberFunction in lambda in member f... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess1.ts | TypeScript | //@target: ES6
var symbol = Symbol.for('myThing');
class Foo {
[symbol]() {
return 0;
}
}
class Bar extends Foo {
[symbol]() {
return super[symbol]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess2.ts | TypeScript | //@target: ES6
class Foo {
[Symbol.isConcatSpreadable]() {
return 0;
}
}
class Bar extends Foo {
[Symbol.isConcatSpreadable]() {
return super[Symbol.isConcatSpreadable]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess3.ts | TypeScript | //@target: ES6
var symbol = Symbol.for('myThing');
class Foo {
[symbol]() {
return 0;
}
}
class Bar extends Foo {
[symbol]() {
return super[Bar]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess4.ts | TypeScript | //@target: ES6
var symbol = Symbol.for('myThing');
class Bar {
[symbol]() {
return super[symbol]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess5.ts | TypeScript | //@target: ES5
var symbol: any;
class Foo {
[symbol]() {
return 0;
}
}
class Bar extends Foo {
[symbol]() {
return super[symbol]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/superSymbolIndexedAccess6.ts | TypeScript | //@target: ES5
var symbol: any;
class Foo {
static [symbol]() {
return 0;
}
}
class Bar extends Foo {
static [symbol]() {
return super[symbol]();
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/switchBreakStatements.ts | TypeScript | // @allowUnusedLabels: true
// @allowUnreachableCode: true
switch ('') {
case 'a':
break;
}
ONE:
switch ('') {
case 'a':
break ONE;
}
TWO:
THREE:
switch ('') {
case 'a':
break THREE;
}
FOUR:
switch ('') {
case 'a':
FIVE:
switch ('') {
case 'a':
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/switchCaseWithIntersectionTypes01.ts | TypeScript |
var strAndNum: string & number;
var numAndBool: number & boolean;
var str: string;
var num: number;
var bool: boolean;
switch (strAndNum) {
// Identical
case strAndNum:
break;
// Constituents
case str:
case num:
break;
// Overlap in constituents
case numAndBool:
b... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/switchCaseWithUnionTypes01.ts | TypeScript |
var strOrNum: string | number;
var numOrBool: number | boolean;
var str: string;
var num: number;
var bool: boolean;
switch (strOrNum) {
// Identical
case strOrNum:
break;
// Constituents
case str:
case num:
break;
// Overlap in constituents
case numOrBool:
break;... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/switchStatements.ts | TypeScript | module M {
export function fn(x: number) {
return '';
}
}
var x: any;
switch (x) {
case '':
case 12:
case true:
case null:
case undefined:
case new Date(12):
case new Object():
case /[a-z]/:
case[]:
case {}:
case { id: 12 }:
case['a']:
case typeof x:
... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/switchWithConstrainedTypeVariable.ts | TypeScript | // @strict: true
// Repro from #20840
function function1<T extends 'a' | 'b'>(key: T) {
switch (key) {
case 'a':
key.toLowerCase();
break;
default:
key.toLowerCase();
break;
}
}
| willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit1.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
[Symbol.toPrimitive]: number;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit10.ts | TypeScript | //@target: ES6
//@declaration: true
var obj = {
get [Symbol.isConcatSpreadable]() { return '' },
set [Symbol.isConcatSpreadable](x) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit11.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
static [Symbol.iterator] = 0;
static [Symbol.isConcatSpreadable]() { }
static get [Symbol.toPrimitive]() { return ""; }
static set [Symbol.toPrimitive](x) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit12.ts | TypeScript | //@target: ES6
//@declaration: true
module M {
interface I { }
export class C {
[Symbol.iterator]: I;
[Symbol.toPrimitive](x: I) { }
[Symbol.isConcatSpreadable](): I {
return undefined
}
get [Symbol.toPrimitive]() { return undefined; }
set [Symbol.toPr... | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit13.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
get [Symbol.toPrimitive]() { return ""; }
set [Symbol.toStringTag](x) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit14.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
get [Symbol.toPrimitive]() { return ""; }
get [Symbol.toStringTag]() { return ""; }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit2.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
[Symbol.toPrimitive] = "";
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit3.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
[Symbol.toPrimitive](x: number);
[Symbol.toPrimitive](x: string);
[Symbol.toPrimitive](x: any) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit4.ts | TypeScript | //@target: ES6
//@declaration: true
class C {
get [Symbol.toPrimitive]() { return ""; }
set [Symbol.toPrimitive](x) { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit5.ts | TypeScript | //@target: ES6
//@declaration: true
interface I {
[Symbol.isConcatSpreadable](): string;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit6.ts | TypeScript | //@target: ES6
//@declaration: true
interface I {
[Symbol.isConcatSpreadable]: string;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit7.ts | TypeScript | //@target: ES6
//@declaration: true
var obj: {
[Symbol.isConcatSpreadable]: string;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit8.ts | TypeScript | //@target: ES6
//@declaration: true
var obj = {
[Symbol.isConcatSpreadable]: 0
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolDeclarationEmit9.ts | TypeScript | //@target: ES6
//@declaration: true
var obj = {
[Symbol.isConcatSpreadable]() { }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty1.ts | TypeScript | //@target: ES6
var s: symbol;
var x = {
[s]: 0,
[s]() { },
get [s]() {
return 0;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty10.ts | TypeScript | //@target: ES6
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]?: { x };
}
var i: I;
i = new C;
var c: C = i; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty11.ts | TypeScript | //@target: ES6
class C { }
interface I {
[Symbol.iterator]?: { x };
}
var i: I;
i = new C;
var c: C = i; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty12.ts | TypeScript | //@target: ES6
class C {
private [Symbol.iterator]: { x };
}
interface I {
[Symbol.iterator]: { x };
}
var i: I;
i = new C;
var c: C = i; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty13.ts | TypeScript | //@target: ES6
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]: { x };
}
declare function foo(i: I): I;
declare function foo(a: any): any;
declare function bar(i: C): C;
declare function bar(a: any): any;
foo(new C);
var i: I;
bar(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty14.ts | TypeScript | //@target: ES6
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]?: { x };
}
declare function foo(i: I): I;
declare function foo(a: any): any;
declare function bar(i: C): C;
declare function bar(a: any): any;
foo(new C);
var i: I;
bar(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty15.ts | TypeScript | //@target: ES6
class C { }
interface I {
[Symbol.iterator]?: { x };
}
declare function foo(i: I): I;
declare function foo(a: any): any;
declare function bar(i: C): C;
declare function bar(a: any): any;
foo(new C);
var i: I;
bar(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty16.ts | TypeScript | //@target: ES6
class C {
private [Symbol.iterator]: { x };
}
interface I {
[Symbol.iterator]: { x };
}
declare function foo(i: I): I;
declare function foo(a: any): any;
declare function bar(i: C): C;
declare function bar(a: any): any;
foo(new C);
var i: I;
bar(i); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty17.ts | TypeScript | //@target: ES6
interface I {
[Symbol.iterator]: number;
[s: symbol]: string;
"__@iterator": string;
}
var i: I;
var it = i[Symbol.iterator]; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty18.ts | TypeScript | //@target: ES6
var i = {
[Symbol.iterator]: 0,
[Symbol.toStringTag]() { return "" },
set [Symbol.toPrimitive](p: boolean) { }
}
var it = i[Symbol.iterator];
var str = i[Symbol.toStringTag]();
i[Symbol.toPrimitive] = false; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty19.ts | TypeScript | //@target: ES6
var i = {
[Symbol.iterator]: { p: null },
[Symbol.toStringTag]() { return { p: undefined }; }
}
var it = i[Symbol.iterator];
var str = i[Symbol.toStringTag](); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty2.ts | TypeScript | //@target: ES6
var s = Symbol();
var x = {
[s]: 0,
[s]() { },
get [s]() {
return 0;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty20.ts | TypeScript | //@target: ES6
interface I {
[Symbol.iterator]: (s: string) => string;
[Symbol.toStringTag](s: number): number;
}
var i: I = {
[Symbol.iterator]: s => s,
[Symbol.toStringTag](n) { return n; }
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty21.ts | TypeScript | //@target: ES6
interface I<T, U> {
[Symbol.unscopables]: T;
[Symbol.isConcatSpreadable]: U;
}
declare function foo<T, U>(p: I<T, U>): { t: T; u: U };
foo({
[Symbol.isConcatSpreadable]: "",
[Symbol.toPrimitive]: 0,
[Symbol.unscopables]: true
}); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty22.ts | TypeScript | //@target: ES6
interface I<T, U> {
[Symbol.unscopables](x: T): U;
}
declare function foo<T, U>(p1: T, p2: I<T, U>): U;
foo("", { [Symbol.unscopables]: s => s.length }); | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty23.ts | TypeScript | //@target: ES6
interface I {
[Symbol.toPrimitive]: () => boolean;
}
class C implements I {
[Symbol.toPrimitive]() {
return true;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty24.ts | TypeScript | //@target: ES6
interface I {
[Symbol.toPrimitive]: () => boolean;
}
class C implements I {
[Symbol.toPrimitive]() {
return "";
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty25.ts | TypeScript | //@target: ES6
interface I {
[Symbol.toPrimitive]: () => boolean;
}
class C implements I {
[Symbol.toStringTag]() {
return "";
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty26.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return "";
}
}
class C2 extends C1 {
[Symbol.toStringTag]() {
return "";
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty27.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return {};
}
}
class C2 extends C1 {
[Symbol.toStringTag]() {
return "";
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty28.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return { x: "" };
}
}
class C2 extends C1 { }
var c: C2;
var obj = c[Symbol.toStringTag]().x; | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty29.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return { x: "" };
}
[s: symbol]: () => { x: string };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty3.ts | TypeScript | //@target: ES6
var s = Symbol;
var x = {
[s]: 0,
[s]() { },
get [s]() {
return 0;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty30.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return { x: "" };
}
[s: symbol]: () => { x: number };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty31.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return { x: "" };
}
}
class C2 extends C1 {
[s: symbol]: () => { x: string };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty32.ts | TypeScript | //@target: ES6
class C1 {
[Symbol.toStringTag]() {
return { x: "" };
}
}
class C2 extends C1 {
[s: symbol]: () => { x: number };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty33.ts | TypeScript | //@target: ES6
class C1 extends C2 {
[Symbol.toStringTag]() {
return { x: "" };
}
}
class C2 {
[s: symbol]: () => { x: string };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty34.ts | TypeScript | //@target: ES6
class C1 extends C2 {
[Symbol.toStringTag]() {
return { x: "" };
}
}
class C2 {
[s: symbol]: () => { x: number };
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty35.ts | TypeScript | //@target: ES6
interface I1 {
[Symbol.toStringTag](): { x: string }
}
interface I2 {
[Symbol.toStringTag](): { x: number }
}
interface I3 extends I1, I2 { } | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty37.ts | TypeScript | //@target: ES6
interface I {
[Symbol.isConcatSpreadable]: string;
[Symbol.isConcatSpreadable]: string;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty38.ts | TypeScript | //@target: ES6
interface I {
[Symbol.isConcatSpreadable]: string;
}
interface I {
[Symbol.isConcatSpreadable]: string;
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University | |
crates/swc_ecma_parser/tests/tsc/symbolProperty39.ts | TypeScript | //@target: ES6
class C {
[Symbol.iterator](x: string): string;
[Symbol.iterator](x: number): number;
[Symbol.iterator](x: any) {
return undefined;
}
[Symbol.iterator](x: any) {
return undefined;
}
} | willcrichton/ilc-swc | 1 | Rust | willcrichton | Will Crichton | Brown University |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.