_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/compiler/restParameterNotLast.ts_0_23 | function f(...x, y) { } | {
"end_byte": 23,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/restParameterNotLast.ts"
} |
TypeScript/tests/cases/compiler/templateLiteralIntersection.ts_0_556 | // https://github.com/microsoft/TypeScript/issues/48034
const a = 'a'
type A = typeof a
type MixA = A & {foo: string}
type OriginA1 = `${A}`
type OriginA2 = `${MixA}`
type B = `${typeof a}`
type MixB = B & { foo: string }
type OriginB1 = `${B}`
type OriginB2 = `${MixB}`
type MixC = { foo: string } & A
type Origin... | {
"end_byte": 556,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/templateLiteralIntersection.ts"
} |
TypeScript/tests/cases/compiler/noEmitAndComposite.ts_0_149 | // @Filename: /a.ts
const x = 10;
// @Filename: /tsconfig.json
{
"compilerOptions": {
"noEmit": true,
"composite": true
}
}
| {
"end_byte": 149,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noEmitAndComposite.ts"
} |
TypeScript/tests/cases/compiler/noImplicitAnyFunctions.ts_0_302 | // @noImplicitAny: true
declare function f1();
declare function f2(): any;
function f3(x) {
}
function f4(x: any) {
return x;
}
function f5(x: any): any {
return x;
}
function f6(x: string, y: number);
function f6(x: string, y: string): any;
function f6(x: string, y) {
return null;
} | {
"end_byte": 302,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noImplicitAnyFunctions.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitBindingPatternWithReservedWord.ts_0_642 | // @declaration: true
type LocaleData = Record<string, never>
type ConvertLocaleConfig<T extends LocaleData = LocaleData> = Record<
string,
T
>;
type LocaleConfig<T extends LocaleData = LocaleData> = Record<string, Partial<T>>;
export interface GetLocalesOptions<T extends LocaleData> {
app: unknown;
defaul... | {
"end_byte": 642,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitBindingPatternWithReservedWord.ts"
} |
TypeScript/tests/cases/compiler/genericCallOnMemberReturningClosedOverObject.ts_0_240 | // @strict: true
// @noEmit: true
// https://github.com/microsoft/TypeScript/issues/11584
function example<T1>() {
let x = {
foo: <T2>(t2: T2) => x,
bar: (t1: T1) => x,
};
return x;
}
example<number>().foo("hello").bar(1);
| {
"end_byte": 240,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericCallOnMemberReturningClosedOverObject.ts"
} |
TypeScript/tests/cases/compiler/indexedAccessRetainsIndexSignature.ts_0_424 | type Diff<T extends keyof any, U extends keyof any> =
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]
type Omit<U, K extends keyof U> = Pick<U, Diff<keyof U, K>>
type Omit1<U, K extends keyof U> = Pick<U, Diff<keyof U, K>>;
// is in fact an equivalent of
type Omit2<T, K extends keyof T> = {[P i... | {
"end_byte": 424,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexedAccessRetainsIndexSignature.ts"
} |
TypeScript/tests/cases/compiler/classExtendsAcrossFiles.ts_0_340 | // @target: es5
// @module: commonjs
// @filename: a.ts
import { b } from './b';
export const a = {
f: () => {
class A { }
class B extends A { }
b.f();
}
};
// @filename: b.ts
import { a } from './a';
export const b = {
f: () => {
class A { }
class B extends A { }
... | {
"end_byte": 340,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/classExtendsAcrossFiles.ts"
} |
TypeScript/tests/cases/compiler/module_augmentUninstantiatedModule2.ts_0_598 | // @module: commonjs
// @moduleResolution: node
// @fileName: app.ts
import ng = require("angular");
import "./moduleAugmentation";
var x: number = ng.getNumber();
// @filename: moduleAugmentation.ts
import * as ng from "angular"
declare module "angular" {
export interface IAngularStatic {
getNumber: (... | {
"end_byte": 598,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/module_augmentUninstantiatedModule2.ts"
} |
TypeScript/tests/cases/compiler/requireOfJsonFileWithErrors.ts_0_320 | // @module: commonjs
// @outdir: out/
// @allowJs: true
// @fullEmitPaths: true
// @resolveJsonModule: true
// @Filename: file1.ts
import b1 = require('./b.json');
let x = b1.a;
import b2 = require('./b.json');
if (x) {
let b = b2.b;
x = (b1.b === b);
}
// @Filename: b.json
{
'a': true,
"b": "hello"
} | {
"end_byte": 320,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/requireOfJsonFileWithErrors.ts"
} |
TypeScript/tests/cases/compiler/circularMappedTypeConstraint.ts_0_200 | // @strict: true
// @noEmit: true
// Repro from #56232
declare function foo2<T extends { [P in keyof T & string as Capitalize<P>]: V }, V extends string>(a: T): T;
export const r2 = foo2({A: "a"});
| {
"end_byte": 200,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/circularMappedTypeConstraint.ts"
} |
TypeScript/tests/cases/compiler/constDeclarations-errors.ts_0_359 | // @target: ES6
// error, missing intialicer
const c1;
const c2: number;
const c3, c4, c5 :string, c6; // error, missing initialicer
for(const c in {}) { }
// error, assigning to a const
for(const c8 = 0; c8 < 1; c8++) { }
// error, can not be unintalized
for(const c9; c9 < 1;) { }
// error, can not be unintalize... | {
"end_byte": 359,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/constDeclarations-errors.ts"
} |
TypeScript/tests/cases/compiler/genericGetter.ts_0_123 | class C<T> {
data: T;
get x(): T {
return this.data;
}
}
var c = new C<number>();
var r: string = c.x; | {
"end_byte": 123,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericGetter.ts"
} |
TypeScript/tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts_0_105 | // @target: ES6
module m {
export interface foo {
}
}
// Should not be emitted
export default m; | {
"end_byte": 105,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/exportDefaultForNonInstantiatedModule.ts"
} |
TypeScript/tests/cases/compiler/sourceMapForFunctionWithCommentPrecedingStatement01.ts_3_70 | @sourceMap: true
function P() {
// Test this
var a = 1;
} | {
"end_byte": 70,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapForFunctionWithCommentPrecedingStatement01.ts"
} |
TypeScript/tests/cases/compiler/moduleAugmentationDoesInterfaceMergeOfReexport.ts_0_318 | // @filename: file.ts
export interface Foo {
x: number;
}
// @filename: reexport.ts
export * from "./file";
// @filename: augment.ts
import * as ns from "./reexport";
declare module "./reexport" {
export interface Foo {
self: Foo;
}
}
declare const f: ns.Foo;
f.x;
f.self;
f.self.x;
f.self.self; | {
"end_byte": 318,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleAugmentationDoesInterfaceMergeOfReexport.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts_0_3187 | // @lib: es5
// @sourcemap: true
declare var console: {
log(msg: any): void;
}
type Robot = [number, string, string];
type MultiSkilledRobot = [string, string[]];
let robotA: Robot = [1, "mower", "mowing"];
function getRobot() {
return robotA;
}
let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]];
... | {
"end_byte": 3187,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts"
} |
TypeScript/tests/cases/compiler/duplicatePropertiesInStrictMode.ts_0_40 | "use strict";
var x = {
x: 1,
x: 2
} | {
"end_byte": 40,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicatePropertiesInStrictMode.ts"
} |
TypeScript/tests/cases/compiler/doubleUnderscoreEnumEmit.ts_0_314 | enum Foo {
"__a" = 1,
"(Anonymous function)" = 2,
"(Anonymous class)" = 4,
"__call" = 10
}
namespace Foo {
export function ___call(): number {
return 5;
}
}
function Bar() {
return "no";
}
namespace Bar {
export function __call(x: number): number {
return 5;
}
} | {
"end_byte": 314,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/doubleUnderscoreEnumEmit.ts"
} |
TypeScript/tests/cases/compiler/unusedLocalsStartingWithUnderscore.ts_0_208 | // @noUnusedLocals:true
// @Filename: /a.ts
import * as _ from "./a";
for (const _ of []) { }
for (const _ in []) { }
namespace _ns {
let _;
for (const _ of []) { }
for (const _ in []) { }
}
| {
"end_byte": 208,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedLocalsStartingWithUnderscore.ts"
} |
TypeScript/tests/cases/compiler/ClassDeclaration13.ts_0_34 | class C {
foo();
bar() { }
} | {
"end_byte": 34,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/ClassDeclaration13.ts"
} |
TypeScript/tests/cases/compiler/assignmentCompatability36.ts_0_344 | module __test1__ {
export interface interfaceWithPublicAndOptional<T,U> { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional<number,string> = { one: 1 };;
export var __val__obj4 = obj4;
}
module __test2__ {
export var aa:{[index:string]:any;};;
export var __val__aa = aa;
}
__test2__.__val__aa... | {
"end_byte": 344,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentCompatability36.ts"
} |
TypeScript/tests/cases/compiler/awaitCallExpressionInSyncFunction.ts_0_96 | // @target: esnext
function foo() {
const foo = await(Promise.resolve(1));
return foo;
}
| {
"end_byte": 96,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/awaitCallExpressionInSyncFunction.ts"
} |
TypeScript/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts_0_759 | // https://github.com/Microsoft/TypeScript/issues/19632
declare function direct<A extends string>(a: A | A[]): Record<A, string>
declare function nested<A extends string>(a: { fields: A }): Record<A, string>
declare function nestedUnion<A extends string>(a: { fields: A | A[] }): Record<A, string>
const directUnionSing... | {
"end_byte": 759,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts"
} |
TypeScript/tests/cases/compiler/exportDefaultClassInNamespace.ts_0_121 | namespace ns_class {
export default class {}
}
namespace ns_abstract_class {
export default abstract class {}
}
| {
"end_byte": 121,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/exportDefaultClassInNamespace.ts"
} |
TypeScript/tests/cases/compiler/unusedTypeParameterInMethod4.ts_0_90 | //@noUnusedLocals:true
//@noUnusedParameters:true
class A {
public f1<X>() {
}
} | {
"end_byte": 90,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedTypeParameterInMethod4.ts"
} |
TypeScript/tests/cases/compiler/recursiveBaseConstructorCreation1.ts_0_96 | class C1 {
public func(param: C2): any { }
}
class C2 extends C1 { }
var x = new C2(); // Valid
| {
"end_byte": 96,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/recursiveBaseConstructorCreation1.ts"
} |
TypeScript/tests/cases/compiler/checkJsdocTypeTagOnExportAssignment5.ts_0_304 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @filename: checkJsdocTypeTagOnExportAssignment5.js
// @Filename: a.js
/**
* @typedef {Object} Foo
* @property {number} a
* @property {number} b
*/
/** @type {Foo} */
export default { a: 1, b: 1 };
// @Filename: b.js
import a from "./a";
a;
| {
"end_byte": 304,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/checkJsdocTypeTagOnExportAssignment5.ts"
} |
TypeScript/tests/cases/compiler/nounusedTypeParameterConstraint.ts_0_277 | // @noUnusedLocals: true
// @noUnusedParameters:true
//@filename: bar.ts
export interface IEventSourcedEntity { }
//@filename: test.ts
import { IEventSourcedEntity } from "./bar";
export type DomainEntityConstructor<TEntity extends IEventSourcedEntity> = { new(): TEntity; }; | {
"end_byte": 277,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nounusedTypeParameterConstraint.ts"
} |
TypeScript/tests/cases/compiler/arrayAssignmentTest1.ts_0_2502 | interface I1 {
IM1():void[];
}
class C1 implements I1 {
IM1():void[] {return null;}
C1M1():C1[] {return null;}
}
class C2 extends C1 {
C2M1():C2[] { return null;}
}
class C3 {
CM3M1() { return 3;}
}
/*
This behaves unexpectedly with the following types:
Type 1 of any[]:
* Type 2 of the following thr... | {
"end_byte": 2502,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrayAssignmentTest1.ts"
} |
TypeScript/tests/cases/compiler/destructureTupleWithVariableElement.ts_0_427 | // @strict: true
// @noUncheckedIndexedAccess: true
// @noEmit: true
// repro from #52302
type NonEmptyStringArray = [string, ...Array<string>]
const strings: NonEmptyStringArray = ['one', 'two']
const [s0, s1, s2] = strings;
s0.toUpperCase()
s1.toUpperCase()
s2.toUpperCase()
declare const strings2: [string, ...A... | {
"end_byte": 427,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/destructureTupleWithVariableElement.ts"
} |
TypeScript/tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts_0_160 | // @target: ES2020
declare let tgt2: number[];
declare let src2: { [K in keyof number[] as Exclude<K, "length">]: (number[])[K] };
tgt2 = src2; // Should error
| {
"end_byte": 160,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts_0_641 | // @lib: es5
// @sourcemap: true
declare var console: {
log(msg: string): void;
}
type MultiSkilledRobot = [string, [string, string]];
var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]];
var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]];
let [, skillA] = multiRobotA;
let [nameMB]... | {
"end_byte": 641,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts"
} |
TypeScript/tests/cases/compiler/nodeModuleReexportFromDottedPath.ts_0_617 | // @declaration: true
// @Filename: /node_modules/.prisma/client/index.d.ts
export interface PrismaClientOptions {
rejectOnNotFound?: any;
}
export class PrismaClient<T extends PrismaClientOptions = PrismaClientOptions> {
private fetcher;
}
// @Filename: /node_modules/@prisma/client/index.d.ts
export * from ".pr... | {
"end_byte": 617,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nodeModuleReexportFromDottedPath.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationClasses.ts_0_901 | // @sourcemap: true
module Foo.Bar {
"use strict";
class Greeter {
constructor(public greeting: string) {
}
greet() {
return "<h1>" + this.greeting + "</h1>";
}
}
function foo(greeting: string): Greeter {
return new Greeter(greeting);
}
va... | {
"end_byte": 901,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationClasses.ts"
} |
TypeScript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts_0_67 | var v: any[];
function foo(a = (v)) { }
function bar(a = (v)) {
} | {
"end_byte": 67,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionWithDefaultParameterWithNoStatements12.ts"
} |
TypeScript/tests/cases/compiler/inferFromGenericFunctionReturnTypes1.ts_0_1542 | // Repro from #15680
// This is a contrived class. We could do the same thing with Observables, etc.
class SetOf<A> {
_store: A[];
add(a: A) {
this._store.push(a);
}
transform<B>(transformer: (a: SetOf<A>) => SetOf<B>): SetOf<B> {
return transformer(this);
}
forEach(fn: (a: A, index: number) => ... | {
"end_byte": 1542,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inferFromGenericFunctionReturnTypes1.ts"
} |
TypeScript/tests/cases/compiler/importHelpersNoHelpers.ts_0_607 | // @importHelpers: true
// @target: es5
// @module: commonjs
// @moduleResolution: classic
// @experimentalDecorators: true
// @emitDecoratorMetadata: true
// @filename: external.ts
export * from "./other";
export class A { }
export class B extends A { }
declare var dec: any;
@dec
class C {
method(@dec x: number)... | {
"end_byte": 607,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importHelpersNoHelpers.ts"
} |
TypeScript/tests/cases/compiler/moduleAndInterfaceSharingName3.ts_0_143 | module X {
export module Y {
export interface Z { }
}
export interface Y<T> { }
}
var z: X.Y.Z = null;
var z2: X.Y<string>; | {
"end_byte": 143,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleAndInterfaceSharingName3.ts"
} |
TypeScript/tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts_0_125 | class a {
x: string;
}
class b extends a {
get x() {
return "20";
}
set x(aValue: string) {
}
} | {
"end_byte": 125,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inheritanceMemberAccessorOverridingProperty.ts"
} |
TypeScript/tests/cases/compiler/qualifiedModuleLocals.ts_0_120 | module A {
function b() {}
export function a(){ A.b(); } // A.b should be an unresolved symbol error
}
A.a();
| {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/qualifiedModuleLocals.ts"
} |
TypeScript/tests/cases/compiler/performanceComparisonOfStructurallyIdenticalInterfacesWithGenericSignatures.ts_0_2990 | // @strict: true
export declare type ThenArg<T> = T extends any ? any : T extends PromiseLike<infer U> ? U : T;
export interface InterfaceA<T> {
filter(callback: (newValue: T, oldValue: T) => boolean): InterfaceA<T>;
map<D>(callback: (value: T) => D): InterfaceA<D>;
await<R extends ThenArg<T>>(): Interface... | {
"end_byte": 2990,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/performanceComparisonOfStructurallyIdenticalInterfacesWithGenericSignatures.ts"
} |
TypeScript/tests/cases/compiler/jsxEmitWithAttributes.ts_0_1042 | //@jsx: react
//@target: es6
//@module: commonjs
//@reactNamespace: Element
// @filename: Element.ts
declare namespace JSX {
interface Element {
name: string;
isIntrinsic: boolean;
isCustomElement: boolean;
toString(renderId?: number): string;
bindDOM(renderId?: number): num... | {
"end_byte": 1042,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxEmitWithAttributes.ts"
} |
TypeScript/tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts_3_41 | ass C {
static x
static y
} | {
"end_byte": 41,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts"
} |
TypeScript/tests/cases/compiler/modulePreserve3.ts_0_261 | // @module: preserve
// @target: esnext
// @jsx: react-jsx
// @noEmit: true
// @noTypesAndSymbols: true
// @traceResolution: true
// @Filename: /node_modules/@types/react/jsx-runtime.d.ts
export namespace JSX {}
// @Filename: /index.tsx
export {};
(<div />);
| {
"end_byte": 261,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/modulePreserve3.ts"
} |
TypeScript/tests/cases/compiler/arrowFunctionWithObjectLiteralBody2.ts_0_25 | var v = a => <any><any>{} | {
"end_byte": 25,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrowFunctionWithObjectLiteralBody2.ts"
} |
TypeScript/tests/cases/compiler/assignmentToExpandingArrayType.ts_0_618 | // @noImplicitAny: true
// Fixes exponential time/space in #14628
let x = []
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo... | {
"end_byte": 618,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentToExpandingArrayType.ts"
} |
TypeScript/tests/cases/compiler/potentiallyUncalledDecorators.ts_0_1602 | // @target: esnext
// @module: esnext
// @experimentalDecorators: true
// @useDefineForClassFields: false
// Angular-style Input/Output API:
declare function Input(bindingPropertyName?: string): any;
class FooComponent {
@Input foo: string;
}
// Glimmer-style tracked API:
declare const tracked: PropertyDecorator ... | {
"end_byte": 1602,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/potentiallyUncalledDecorators.ts"
} |
TypeScript/tests/cases/compiler/intersectionSatisfiesConstraint.ts_0_491 | // @strict: true
// @lib: esnext
interface FirstInterface {
commonProperty: number
}
interface SecondInterface {
commonProperty: number
}
const myFirstFunction = <T extends FirstInterface | SecondInterface>(param1: T) => {
const newParam: T & { otherProperty: number } = Object.assign(param1, { otherPrope... | {
"end_byte": 491,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/intersectionSatisfiesConstraint.ts"
} |
TypeScript/tests/cases/compiler/contextualOverloadListFromUnionWithPrimitiveNoImplicitAny.ts_0_439 | // @strict: true
// @target: esnext
// must target esnext for `String.normalize` to exist
type Validate = (text: string, pos: number, self: Rule) => number | boolean;
interface FullRule {
validate: string | RegExp | Validate;
normalize?: (match: {x: string}) => void;
}
type Rule = string | FullRule;
const obj... | {
"end_byte": 439,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualOverloadListFromUnionWithPrimitiveNoImplicitAny.ts"
} |
TypeScript/tests/cases/compiler/restParamUsingMappedTypeOverUnionConstraint.ts_0_287 | // @noEmit: true
// @strict: true
// repro 29919#issuecomment-470948453
type HomomorphicMappedType<T> = { [P in keyof T]: T[P] extends string ? boolean : null }
declare function test<T extends [number] | [string]>(
args: T,
fn: (...args: HomomorphicMappedType<T>) => void
): void
| {
"end_byte": 287,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/restParamUsingMappedTypeOverUnionConstraint.ts"
} |
TypeScript/tests/cases/compiler/commentsemitComments.ts_0_1503 | // @target: ES5
// @declaration: true
// @removeComments: false
/** Variable comments*/
var myVariable = 10;
/** function comments*/
function foo(/** parameter comment*/p: number) {
}
/** variable with function type comment*/
var fooVar: () => void;
foo(50);
fooVar();
/**class comment*/
class c {
/** constructo... | {
"end_byte": 1503,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentsemitComments.ts"
} |
TypeScript/tests/cases/compiler/superElementAccess.ts_1_1593 | class MyBase {
m1(a: string) { return a; }
private p1() { }
m2: () => void = function () { }
d1: number = 42;
private d2: number = 42;
get value() {return 0 }
set value(v: number) { }
}
class MyDerived extends MyBase {
foo() {
super["m1"]("hi"); ... | {
"end_byte": 1593,
"start_byte": 1,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/superElementAccess.ts"
} |
TypeScript/tests/cases/compiler/paramterDestrcuturingDeclaration.ts_0_90 | // @declaration: true
interface C {
({p: name}): any;
new ({p: boolean}): any;
}
| {
"end_byte": 90,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/paramterDestrcuturingDeclaration.ts"
} |
TypeScript/tests/cases/compiler/elidingImportNames.ts_0_385 | // @module: commonjs
// @Filename: elidingImportNames_test.ts
import a = require('./elidingImportNames_main'); // alias used in typeof
var b = a;
var x: typeof a;
import a2 = require('./elidingImportNames_main1'); // alias not used in typeof
var b2 = a2;
// @Filename: elidingImportNames_main.ts
export var main = 10;... | {
"end_byte": 385,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/elidingImportNames.ts"
} |
TypeScript/tests/cases/compiler/jsEnumTagOnObjectFrozen.ts_0_679 | // @noEmit: true
// @checkJs: true
// @allowJs: true
// @filename: index.js
/** @enum {string} */
const Thing = Object.freeze({
a: "thing",
b: "chill"
});
exports.Thing = Thing;
/**
* @param {Thing} x
*/
function useThing(x) {}
exports.useThing = useThing;
/**
* @param {(x: Thing) => void} x
*/
function... | {
"end_byte": 679,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsEnumTagOnObjectFrozen.ts"
} |
TypeScript/tests/cases/compiler/checkJsFiles4.ts_0_111 | // @allowJs: true
// @checkJs: false
// @noEmit: true
// @fileName: a.js
// @ts-check
var x = "string";
x = 0; | {
"end_byte": 111,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/checkJsFiles4.ts"
} |
TypeScript/tests/cases/compiler/es6ImportEqualsDeclaration.ts_0_119 | // @target: es6
// @filename: server.ts
var a = 10;
export = a;
// @filename: client.ts
import a = require("server"); | {
"end_byte": 119,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportEqualsDeclaration.ts"
} |
TypeScript/tests/cases/compiler/jqueryInference.ts_0_373 | // #22362
interface MyPromise<T, U> {
then(cb: (t: T) => void): void;
thenUnion(cb: (t: T | U) => void): this;
}
interface DoNothingAlias<T, U> extends MyPromise<T, U> { }
declare function shouldBeIdentity<T, U>(p: DoNothingAlias<T, U>): MyPromise<T, U>;
declare const p1: MyPromise<boolean, any>;
var p2 = sh... | {
"end_byte": 373,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jqueryInference.ts"
} |
TypeScript/tests/cases/compiler/newOnInstanceSymbol.ts_0_68 | class C {}
var x = new C(); // should be ok
new x(); // should error | {
"end_byte": 68,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/newOnInstanceSymbol.ts"
} |
TypeScript/tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt5.ts_3_261 | dule Z {
export module M {
export function bar() {
return "";
}
}
export interface I { }
}
module A.M {
import M = Z.I;
import M = Z.M;
export function bar() {
}
M.bar(); // Should call Z.M.bar
} | {
"end_byte": 261,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleSharesNameWithImportDeclarationInsideIt5.ts"
} |
TypeScript/tests/cases/compiler/unusedImports11.ts_0_324 | //@noUnusedLocals:true
//@noUnusedParameters:true
// @filename: b.ts
export class Member {}
export default Member;
// @filename: a.ts
import { Member } from './b';
import d, { Member as M } from './b';
import * as ns from './b';
import r = require("./b");
new Member();
new d();
new M();
new ns.Member();
new r.Membe... | {
"end_byte": 324,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedImports11.ts"
} |
TypeScript/tests/cases/compiler/unusedTypeParametersWithUnderscore.ts_0_173 | //@noUnusedParameters:true
function f<_T, U>() { }
type T<_T, U> = { };
interface I<_T, U> { };
class C<_T, U> {
public m<_V, W>() { }
};
let l = <_T, U>() => { };
| {
"end_byte": 173,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedTypeParametersWithUnderscore.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitGlobalThisPreserved.ts_0_4163 | // @declaration: true
// @emitDeclarationOnly: true
// Adding this makes tooltips fail too.
// declare global {
// namespace isNaN {
// const prop: number;
// }
// }
// Broken inference cases.
export const a1 = (isNaN: typeof globalThis.isNaN): typeof globalThis.isNaN => isNaN;
export const a2 = (isN... | {
"end_byte": 4163,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitGlobalThisPreserved.ts"
} |
TypeScript/tests/cases/compiler/weakTypeAndPrimitiveNarrowing.ts_0_568 | // @strict: true
type LiteralsAndWeakTypes =
| 'A'
| 'B'
| { optional?: true }
| { toLowerCase?(): string }
| { toUpperCase?(): string, otherOptionalProp?: number };
const g = (arg: LiteralsAndWeakTypes) => {
if (arg === 'A') {
arg;
} else {
arg;
}
}
type PrimitivesAndWeakTypes =
... | {
"end_byte": 568,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/weakTypeAndPrimitiveNarrowing.ts"
} |
TypeScript/tests/cases/compiler/importWithTrailingSlash.ts_0_340 | // @traceResolution: true
// @moduleResolution: node
// @Filename: /a.ts
export default { a: 0 };
// @Filename: /a/index.ts
export default { aIndex: 0 };
// @Filename: /a/test.ts
import a from ".";
import aIndex from "./";
a.a;
aIndex.aIndex;
// @Filename: /a/b/test.ts
import a from "..";
import aIndex from "../";
... | {
"end_byte": 340,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importWithTrailingSlash.ts"
} |
TypeScript/tests/cases/compiler/inKeywordAndIntersection.ts_0_499 | // @strict: true
class A { a = 0 }
class B { b = 0 }
function f10(obj: A & { x: string } | B) {
if (obj instanceof Object) {
obj; // A & { x: string } | B
}
else {
obj; // Error
}
}
// Repro from #50844
interface InstanceOne {
one(): void
}
interface InstanceTwo {
two(): v... | {
"end_byte": 499,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inKeywordAndIntersection.ts"
} |
TypeScript/tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts_0_75 | "use strict";
`\x001`;
`\u00001`;
`\u{00000000}1`;
`\u{000000}1`;
`\u{0}1`; | {
"end_byte": 75,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/shouldNotPrintNullEscapesIntoOctalLiterals.ts"
} |
TypeScript/tests/cases/compiler/recursiveObjectLiteral.ts_0_17 | var a = { f: a }; | {
"end_byte": 17,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/recursiveObjectLiteral.ts"
} |
TypeScript/tests/cases/compiler/declInput4.ts_0_359 | // @declaration: true
module M {
class C { }
export class E {}
export interface I1 {}
interface I2 {}
export class D {
public m1: number;
public m2: string;
public m23: E;
public m24: I1;
public m232(): E { return null;}
public m242(): I1 { return null... | {
"end_byte": 359,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declInput4.ts"
} |
TypeScript/tests/cases/compiler/arrayToLocaleStringES2015.ts_0_2753 | // @target: es2015
let str: string;
const arr = [1, 2, 3];
str = arr.toLocaleString(); // OK
str = arr.toLocaleString('en-US'); // OK
str = arr.toLocaleString('en-US', { style: 'currency', currency: 'EUR' }); // OK
const dates: readonly Date[] = [new Date(), new Date()];
str = dates.toLocaleString(); // OK
str = date... | {
"end_byte": 2753,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrayToLocaleStringES2015.ts"
} |
TypeScript/tests/cases/compiler/restParameterWithBindingPattern1.ts_0_46 | // @sourcemap: true
function a(...{a, b}) { } | {
"end_byte": 46,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/restParameterWithBindingPattern1.ts"
} |
TypeScript/tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExport.ts_0_214 | //@module: commonjs
// @declaration: true
export module a {
export function foo(x: number) {
return x;
}
}
export module c {
import b = a.foo;
var bVal = b(10);
export var bVal2 = b;
}
| {
"end_byte": 214,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasFunctionInsideLocalModuleWithoutExport.ts"
} |
TypeScript/tests/cases/compiler/privacyCannotNameVarTypeDeclFile.ts_0_4071 | // @module: commonjs
// @declaration: true
// @Filename: privacyCannotNameVarTypeDeclFile_GlobalWidgets.ts
declare module "GlobalWidgets" {
export class Widget3 {
name: string;
}
export function createWidget3(): Widget3;
export module SpecializedGlobalWidget {
export class Widget4 {
... | {
"end_byte": 4071,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyCannotNameVarTypeDeclFile.ts"
} |
TypeScript/tests/cases/compiler/jsxFactoryIdentifierAsParameter.ts_0_299 | //@jsx: react
//@target: es6
//@module: commonjs
//@jsxFactory: createElement
//@sourcemap: true
// @filename: test.tsx
declare module JSX {
interface IntrinsicElements {
[s: string]: any;
}
}
export class AppComponent {
render(createElement) {
return <div />;
}
}
| {
"end_byte": 299,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxFactoryIdentifierAsParameter.ts"
} |
TypeScript/tests/cases/compiler/importHelpersNoEmitHelpersExportDefault.ts_0_456 | // @target: es5
// @module: commonjs
// @importHelpers: true
// @noEmitHelpers: true
// @esModuleInterop: true
// @noTypesAndSymbols: true
// @filename: main.ts
// https://github.com/microsoft/TypeScript/issues/40328
export { default as A } from "./other";
// @filename: main2.ts
export { default } from "./other";
//... | {
"end_byte": 456,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importHelpersNoEmitHelpersExportDefault.ts"
} |
TypeScript/tests/cases/compiler/anyInferenceAnonymousFunctions.ts_0_281 | var paired: any[];
paired.reduce(function (a1, a2) {
return a1.concat({});
} , []);
paired.reduce((b1, b2) => {
return b1.concat({});
} , []);
paired.reduce((b3, b4) => b3.concat({}), []);
paired.map((c1) => c1.count);
paired.map(function (c2) { return c2.count; }); | {
"end_byte": 281,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/anyInferenceAnonymousFunctions.ts"
} |
TypeScript/tests/cases/compiler/conditionalExpressionNewLine4.ts_0_21 | var v = a ? b :
c; | {
"end_byte": 21,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/conditionalExpressionNewLine4.ts"
} |
TypeScript/tests/cases/compiler/objectPropertyAsClass.ts_0_348 | // @allowJs: true
// @noEmit: true
// @checkJs: true
// @filename: index.js
const a1 = {
foo() {
this.x = 0;
}
}
const a2 = {
foo: function() {
this.x = 0;
}
}
const b1 = {
/** @class */
foo() {
this.x = 0;
}
}
const b2 = {
/** @class */
foo: function() {
... | {
"end_byte": 348,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/objectPropertyAsClass.ts"
} |
TypeScript/tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts_0_271 | // @module: nodenext
// @outDir: ./dist
// @filename: package.json
{
"name": "@this/package",
"type": "module",
"exports": {
".": "./dist/index.js"
}
}
// @filename: index.ts
import * as me from "@this/package";
me.thing();
export function thing(): void {}
| {
"end_byte": 271,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts"
} |
TypeScript/tests/cases/compiler/selfInCallback.ts_0_119 | class C {
public p1 = 0;
public callback(cb:()=>void) {cb();}
public doit() {
this.callback(()=>{this.p1+1});
}
} | {
"end_byte": 119,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/selfInCallback.ts"
} |
TypeScript/tests/cases/compiler/narrowingAssignmentReadonlyRespectsAssertion.ts_0_995 | // https://github.com/microsoft/TypeScript/issues/41984
interface TestCase<T extends string | number> {
readonly val1: T | ReadonlyArray<T>;
readonly val2: ReadonlyArray<T>;
}
interface MultiCaseFixture<T> {
cases: T[];
}
function subDataFunc(): TestCase<string | number>[] {
return [
{ val1: "a", val2:... | {
"end_byte": 995,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/narrowingAssignmentReadonlyRespectsAssertion.ts"
} |
TypeScript/tests/cases/compiler/typeofInterface.ts_0_120 | var I: { a: string};
interface I {
I: number;
foo: typeof I;
}
var k: I;
var j: typeof k.foo = { a: "hello" }; | {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeofInterface.ts"
} |
TypeScript/tests/cases/compiler/unusedClassesinNamespace2.ts_0_127 | //@noUnusedLocals:true
//@noUnusedParameters:true
namespace Validation {
class c1 {
}
export class c2 {
}
} | {
"end_byte": 127,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedClassesinNamespace2.ts"
} |
TypeScript/tests/cases/compiler/commentEmitWithCommentOnLastLine.ts_0_26 | var x: any;
/*
var bar;
*/ | {
"end_byte": 26,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentEmitWithCommentOnLastLine.ts"
} |
TypeScript/tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx_0_1029 | // @strict: true
// @jsx: preserve
namespace JSX {
export interface Element {}
export interface ElementAttributesProperty { props: {}; }
export interface ElementChildrenAttribute { children: {}; }
export interface IntrinsicAttributes {}
export interface IntrinsicElements { [key: string]: Element }
}... | {
"end_byte": 1029,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx"
} |
TypeScript/tests/cases/compiler/noInferCommonPropertyCheck1.ts_0_572 | // @strict: true
// @noEmit: true
declare const partialObj1: Partial<{ a: unknown; b: unknown }>;
declare const partialObj2: Partial<{ c: unknown; d: unknown }>;
declare const someObj1: { x: string };
declare function test1<T>(a: T, b: NoInfer<T> & { prop?: unknown }): void;
test1(partialObj1, someObj1);
declare fu... | {
"end_byte": 572,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noInferCommonPropertyCheck1.ts"
} |
TypeScript/tests/cases/compiler/unusedParametersinConstructor1.ts_0_108 | //@noUnusedLocals:true
//@noUnusedParameters:true
class greeter {
constructor(param1: string) {
}
} | {
"end_byte": 108,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedParametersinConstructor1.ts"
} |
TypeScript/tests/cases/compiler/symbolObserverMismatchingPolyfillsWorkTogether.ts_0_213 | // @declaration: true
// @target: es6
interface SymbolConstructor {
readonly observer: symbol;
}
interface SymbolConstructor {
readonly observer: unique symbol;
}
const obj = {
[Symbol.observer]: 0
}; | {
"end_byte": 213,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/symbolObserverMismatchingPolyfillsWorkTogether.ts"
} |
TypeScript/tests/cases/compiler/library_ObjectPrototypeProperties.ts_0_376 | // Properties of the Object Prototype Object as per ES5 spec
// http://www.ecma-international.org/ecma-262/5.1/#sec-15.2.4
Object.prototype.constructor;
Object.prototype.toString();
Object.prototype.toLocaleString();
Object.prototype.valueOf();
Object.prototype.hasOwnProperty("string");
Object.prototype.isPrototypeOf(O... | {
"end_byte": 376,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/library_ObjectPrototypeProperties.ts"
} |
TypeScript/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts_0_207 | // @declaration: true
module X.A.C {
export interface Z {
}
}
module X.A.B.C {
export class W implements A.C.Z { // This can refer to it as A.C.Z
}
}
module X.A.B.C {
module A {
}
} | {
"end_byte": 207,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declFileWithInternalModuleNameConflictsInExtendsClause2.ts"
} |
TypeScript/tests/cases/compiler/keyofGenericExtendingClassDoubleLayer.ts_0_309 | class Model<Attributes = any> {
public createdAt: Date;
}
type ModelAttributes<T> = Omit<T, keyof Model>;
class AutoModel<T> extends Model<ModelAttributes<T>> {}
class PersonModel extends AutoModel<PersonModel> {
public age: number;
toJson() {
let x: keyof this = 'createdAt';
}
}
| {
"end_byte": 309,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/keyofGenericExtendingClassDoubleLayer.ts"
} |
TypeScript/tests/cases/compiler/inferringAnyFunctionType1.ts_0_120 | // @lib: es2015
function f<T extends { "0": (p1: number) => number }>(p: T): T {
return p;
}
var v = f([x => x]);
| {
"end_byte": 120,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inferringAnyFunctionType1.ts"
} |
TypeScript/tests/cases/compiler/objectIndexer.ts_0_220 | //@module: amd
export interface Callback {
(value: any): void;
}
interface IMap {
[s: string]: Callback;
}
class Emitter {
private listeners: IMap;
constructor () {
this.listeners = {};
}
}
| {
"end_byte": 220,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/objectIndexer.ts"
} |
TypeScript/tests/cases/compiler/inferenceFromParameterlessLambda.ts_0_221 | function foo<T>(o: Take<T>, i: Make<T>) { }
interface Make<T> {
(): T;
}
interface Take<T> {
(n: T): void;
}
// Infer string from second argument because it isn't context sensitive
foo(n => n.length, () => 'hi');
| {
"end_byte": 221,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inferenceFromParameterlessLambda.ts"
} |
TypeScript/tests/cases/compiler/privacyGloImport.ts_0_5116 | //@declaration: true
module m1 {
export module m1_M1_public {
export class c1 {
}
export function f1() {
return new c1;
}
export var v1 = c1;
export var v2: c1;
}
module m1_M2_private {
export class c1 {
}
export function f... | {
"end_byte": 5116,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyGloImport.ts"
} |
TypeScript/tests/cases/compiler/unusedLocalsAndParameters.ts_0_1106 | //@noUnusedLocals:true
//@noUnusedParameters:true
export { };
// function declaration paramter
function f(a) {
}
f(0);
// function expression paramter
var fexp = function (a) {
};
fexp(0);
// arrow function paramter
var farrow = (a) => {
};
class C {
// Method declaration paramter
method(a) {
}
//... | {
"end_byte": 1106,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedLocalsAndParameters.ts"
} |
TypeScript/tests/cases/compiler/duplicateLabel2.ts_0_84 | // @allowUnusedLabels: true
target:
while (true) {
target:
while (true) {
}
} | {
"end_byte": 84,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateLabel2.ts"
} |
TypeScript/tests/cases/compiler/functionAssignabilityWithArrayLike01.ts_0_79 | // @strict: true, false
function func() {}
const array: ArrayLike<any> = func; | {
"end_byte": 79,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionAssignabilityWithArrayLike01.ts"
} |
TypeScript/tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts_0_157 | //@module: amd
// @declaration: true
export module a {
export interface I {
}
}
export module c {
export import b = a.I;
export var x: b;
}
| {
"end_byte": 157,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithExport.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.