_id
stringlengths
21
254
text
stringlengths
1
93.7k
metadata
dict
TypeScript/tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts_0_146
class a { static x: string; } class b extends a { static get x() { return "20"; } static set x(aValue: string) { } }
{ "end_byte": 146, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inheritanceStaticAccessorOverridingProperty.ts" }
TypeScript/tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts_0_132
interface Foo { (bar:number): string; } interface Bar extends Foo { (key: string): string; } var a: Bar; var kitty = a(1);
{ "end_byte": 132, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts" }
TypeScript/tests/cases/compiler/callbacksDontShareTypes.ts_0_599
interface Collection<T> { length: number; add(x: T): void; remove(x: T): boolean; } interface Combinators { map<T, U>(c: Collection<T>, f: (x: T) => U): Collection<U>; map<T>(c: Collection<T>, f: (x: T) => any): Collection<any>; } var _: Combinators; var c2: Collection<number>; var rf1 = (x: numbe...
{ "end_byte": 599, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/callbacksDontShareTypes.ts" }
TypeScript/tests/cases/compiler/letInLetDeclarations_ES6.ts_0_126
// @target: es6 // All use of let in const declaration should be an error let x = 50, let = 5; { let x = 10, let = 20; }
{ "end_byte": 126, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/letInLetDeclarations_ES6.ts" }
TypeScript/tests/cases/compiler/contextualTyping11.ts_0_54
class foo { public bar:{id:number;}[] = [<foo>({})]; }
{ "end_byte": 54, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTyping11.ts" }
TypeScript/tests/cases/compiler/jsxComponentTypeErrors.tsx_0_816
// @strict: true // @jsx: preserve namespace JSX { export interface Element { type: 'element'; } export interface ElementClass { type: 'element-class'; } } function FunctionComponent<T extends string>({type}: {type?: T}) { return { type } } FunctionComponent.useThis = function() { return <thi...
{ "end_byte": 816, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxComponentTypeErrors.tsx" }
TypeScript/tests/cases/compiler/argumentsReferenceInMethod1_Js.ts_0_214
// @declaration: true // @allowJs: true // @emitDeclarationOnly: true // @filename: /a.js class A { /** * @param {object} [foo={}] */ m(foo = {}) { /** * @type object */ this.arguments = foo; } }
{ "end_byte": 214, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/argumentsReferenceInMethod1_Js.ts" }
TypeScript/tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts_0_227
interface I { f: (a: { a: number }) => void } class X<T extends { a: string }> implements I { f(a: T): void { } } var x = new X<{ a: string }>(); var i: I = x; // Should not be allowed -- type of 'f' is incompatible with 'I'
{ "end_byte": 227, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericTypeWithNonGenericBaseMisMatch.ts" }
TypeScript/tests/cases/compiler/constructorArgsErrors2.ts_0_64
class foo { constructor (public static a: number) { } }
{ "end_byte": 64, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/constructorArgsErrors2.ts" }
TypeScript/tests/cases/compiler/isolatedModulesWithDeclarationFile.ts_0_135
// @isolatedModules: true // @target: es6 // @filename: file1.d.ts declare function foo(): void; // @filename: file1.ts export var x;
{ "end_byte": 135, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/isolatedModulesWithDeclarationFile.ts" }
TypeScript/tests/cases/compiler/declareDottedExtend.ts_0_114
declare module A.B { export class C{ } } import ab = A.B; class D extends ab.C{ } class E extends A.B.C{ }
{ "end_byte": 114, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declareDottedExtend.ts" }
TypeScript/tests/cases/compiler/switchAssignmentCompat.ts_0_69
class Foo { } switch (0) { case Foo: break; // Error expected }
{ "end_byte": 69, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/switchAssignmentCompat.ts" }
TypeScript/tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExportAccessError.ts_0_149
//@module: commonjs export module a { export var x = 10; } export module c { import b = a.x; export var bVal = b; } export var z = c.b;
{ "end_byte": 149, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasVarInsideLocalModuleWithoutExportAccessError.ts" }
TypeScript/tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts_0_418
declare function Callbacks(flags?: string): void; declare function Callbacks<T>(flags?: string): void; declare function Callbacks<T1, T2>(flags?: string): void; Callbacks<number, string, boolean>('s'); // wrong number of type arguments new Callbacks<number, string, boolean>('s'); // wrong number of type arguments dec...
{ "end_byte": 418, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/overloadsAndTypeArgumentArityErrors.ts" }
TypeScript/tests/cases/compiler/implementGenericWithMismatchedTypes.ts_0_473
// no errors because in the derived types the best common type for T's value is Object // and that matches the original signature for assignability since we treat its T's as Object interface IFoo<T> { foo(x: T): T; } class C<T> implements IFoo<T> { // error foo(x: string): number { return null; } }...
{ "end_byte": 473, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/implementGenericWithMismatchedTypes.ts" }
TypeScript/tests/cases/compiler/arrowFunctionJSDocAnnotation.ts_0_274
// @checkJs: true // @allowJs: true // @noEmit: true // @strict: true // @filename: index.js /** * @param {any} v */ function identity(v) { return v; } const x = identity( /** * @param {number} param * @returns {number=} */ param => param );
{ "end_byte": 274, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrowFunctionJSDocAnnotation.ts" }
TypeScript/tests/cases/compiler/jsdocTypeGenericInstantiationAttempt.ts_0_152
// @allowJs: true // @noEmit: true // @checkJs: true // @filename: index.js /** * @param {Array<*>} list */ function thing(list) { return list; }
{ "end_byte": 152, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsdocTypeGenericInstantiationAttempt.ts" }
TypeScript/tests/cases/compiler/autonumberingInEnums.ts_0_62
enum Foo { a = 1 } enum Foo { b // should work fine }
{ "end_byte": 62, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/autonumberingInEnums.ts" }
TypeScript/tests/cases/compiler/homomorphicMappedTypeNesting.ts_0_361
// @strict: true // @noEmit: true // Repro from #58060 type Box<T extends string> = { v: T }; type Test<T extends string[]> = T type UnboxArray<T> = { [K in keyof T]: T[K] extends Box<infer R> ? R : never; }; type Identity<T> = { [K in keyof T]: T[K] }; declare function fnBad<T extends Array<Box<string>>>(......
{ "end_byte": 361, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/homomorphicMappedTypeNesting.ts" }
TypeScript/tests/cases/compiler/withStatement.ts_0_187
declare var ooo:any; with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error bing = true; // no error bang = true; // no error function bar() {} bar(); }
{ "end_byte": 187, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/withStatement.ts" }
TypeScript/tests/cases/compiler/es6ClassTest9.ts_0_39
declare class foo(); function foo() {}
{ "end_byte": 39, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ClassTest9.ts" }
TypeScript/tests/cases/compiler/numberOnLeftSideOfInExpression.ts_0_48
var left: number; var right: any; left in right;
{ "end_byte": 48, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/numberOnLeftSideOfInExpression.ts" }
TypeScript/tests/cases/compiler/es6ImportWithJsDocTags.ts_0_199
// @allowJs: true // @checkJs: true // @noEmit: true // @filename: ./a.js export const foo = 1; // @filename: ./b.js 'use strict'; /** @private */ import { foo } from './a.js'; console.log(foo);
{ "end_byte": 199, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportWithJsDocTags.ts" }
TypeScript/tests/cases/compiler/classOverloadForFunction.ts_0_33
class foo { }; function foo() {}
{ "end_byte": 33, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/classOverloadForFunction.ts" }
TypeScript/tests/cases/compiler/instantiationExpressionErrorNoCrash.ts_0_379
const createCacheReducer = <N extends string, QR>( queries: Cache<N, QR>["queries"], ) => { const queriesMap = {} as QR; const initialState = { queries: queriesMap, }; return (state = initialState) => state; }; export type Cache<N extends string, QR> = { queries: { [QK in keyo...
{ "end_byte": 379, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/instantiationExpressionErrorNoCrash.ts" }
TypeScript/tests/cases/compiler/noImplicitUseStrict_system.ts_0_67
// @module: system // @noImplicitUseStrict: true export var x = 0;
{ "end_byte": 67, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noImplicitUseStrict_system.ts" }
TypeScript/tests/cases/compiler/externalModuleResolution2.ts_0_256
//@module: commonjs // @Filename: foo.ts module M2 { export var X = 1; } export = M2 // @Filename: foo.d.ts declare module M1 { export var Y:number; } export = M1 // @Filename: consumer.ts import x = require('./foo'); x.X // .ts should be picked
{ "end_byte": 256, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/externalModuleResolution2.ts" }
TypeScript/tests/cases/compiler/typeParametersAndParametersInComputedNames.ts_0_97
function foo<T>(a: T) : string { return ""; } class A { [foo<T>(a)]<T>(a: T) { } }
{ "end_byte": 97, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeParametersAndParametersInComputedNames.ts" }
TypeScript/tests/cases/compiler/symlinkedWorkspaceDependenciesNoDirectLinkOptionalGeneratesNonrelativeName.ts_0_915
// @declaration: true // @filename: workspace/packageA/index.d.ts export declare class Foo { private f: any; } // @filename: workspace/packageB/package.json { "private": true, "dependencies": { "package-a": "file:../packageA" } } // @filename: workspace/packageB/index.d.ts import { Foo } from "p...
{ "end_byte": 915, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/symlinkedWorkspaceDependenciesNoDirectLinkOptionalGeneratesNonrelativeName.ts" }
TypeScript/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts_0_199
// @declaration: true export interface Foo { preFetch: <T1 extends T2> (c: T1) => void; // Type T2 is not defined preFetcher: new <T1 extends T2> (c: T1) => void; // Type T2 is not defined }
{ "end_byte": 199, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitLambdaWithMissingTypeParameterNoCrash.ts" }
TypeScript/tests/cases/compiler/bigintWithoutLib.ts_0_2491
// @target: es5 // Every line should error because these builtins are not declared // Test BigInt functions let bigintVal: bigint = BigInt(123); bigintVal = BigInt("456"); new BigInt(123); bigintVal = BigInt.asIntN(8, 0xFFFFn); bigintVal = BigInt.asUintN(8, 0xFFFFn); bigintVal = bigintVal.valueOf(); // should error -...
{ "end_byte": 2491, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/bigintWithoutLib.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_0_7256
// @target: es5 export const exp0 = "test"; export const exp1 = "test"; export const exp2 = "test"; export const exp3 = "test"; export const exp4 = "test"; export const exp5 = "test"; export const exp6 = "test"; export const exp7 = "test"; export const exp8 = "test"; export const exp9 = "test"; export const exp10 = "t...
{ "end_byte": 7256, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_7257_14606
export const exp245 = "test"; export const exp246 = "test"; export const exp247 = "test"; export const exp248 = "test"; export const exp249 = "test"; export const exp250 = "test"; export const exp251 = "test"; export const exp252 = "test"; export const exp253 = "test"; export const exp254 = "test"; export const exp255 ...
{ "end_byte": 14606, "start_byte": 7257, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_14607_21956
export const exp490 = "test"; export const exp491 = "test"; export const exp492 = "test"; export const exp493 = "test"; export const exp494 = "test"; export const exp495 = "test"; export const exp496 = "test"; export const exp497 = "test"; export const exp498 = "test"; export const exp499 = "test"; export const exp500 ...
{ "end_byte": 21956, "start_byte": 14607, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_21957_29306
export const exp735 = "test"; export const exp736 = "test"; export const exp737 = "test"; export const exp738 = "test"; export const exp739 = "test"; export const exp740 = "test"; export const exp741 = "test"; export const exp742 = "test"; export const exp743 = "test"; export const exp744 = "test"; export const exp745 ...
{ "end_byte": 29306, "start_byte": 21957, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_29307_36106
export const exp980 = "test"; export const exp981 = "test"; export const exp982 = "test"; export const exp983 = "test"; export const exp984 = "test"; export const exp985 = "test"; export const exp986 = "test"; export const exp987 = "test"; export const exp988 = "test"; export const exp989 = "test"; export const exp990 ...
{ "end_byte": 36106, "start_byte": 29307, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_36107_42864
export const exp1200 = "test"; export const exp1201 = "test"; export const exp1202 = "test"; export const exp1203 = "test"; export const exp1204 = "test"; export const exp1205 = "test"; export const exp1206 = "test"; export const exp1207 = "test"; export const exp1208 = "test"; export const exp1209 = "test"; export con...
{ "end_byte": 42864, "start_byte": 36107, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_42865_49622
export const exp1418 = "test"; export const exp1419 = "test"; export const exp1420 = "test"; export const exp1421 = "test"; export const exp1422 = "test"; export const exp1423 = "test"; export const exp1424 = "test"; export const exp1425 = "test"; export const exp1426 = "test"; export const exp1427 = "test"; export con...
{ "end_byte": 49622, "start_byte": 42865, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_49623_56380
export const exp1636 = "test"; export const exp1637 = "test"; export const exp1638 = "test"; export const exp1639 = "test"; export const exp1640 = "test"; export const exp1641 = "test"; export const exp1642 = "test"; export const exp1643 = "test"; export const exp1644 = "test"; export const exp1645 = "test"; export con...
{ "end_byte": 56380, "start_byte": 49623, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_56381_63138
export const exp1854 = "test"; export const exp1855 = "test"; export const exp1856 = "test"; export const exp1857 = "test"; export const exp1858 = "test"; export const exp1859 = "test"; export const exp1860 = "test"; export const exp1861 = "test"; export const exp1862 = "test"; export const exp1863 = "test"; export con...
{ "end_byte": 63138, "start_byte": 56381, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_63139_69896
export const exp2072 = "test"; export const exp2073 = "test"; export const exp2074 = "test"; export const exp2075 = "test"; export const exp2076 = "test"; export const exp2077 = "test"; export const exp2078 = "test"; export const exp2079 = "test"; export const exp2080 = "test"; export const exp2081 = "test"; export con...
{ "end_byte": 69896, "start_byte": 63139, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_69897_76654
export const exp2290 = "test"; export const exp2291 = "test"; export const exp2292 = "test"; export const exp2293 = "test"; export const exp2294 = "test"; export const exp2295 = "test"; export const exp2296 = "test"; export const exp2297 = "test"; export const exp2298 = "test"; export const exp2299 = "test"; export con...
{ "end_byte": 76654, "start_byte": 69897, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_76655_83412
export const exp2508 = "test"; export const exp2509 = "test"; export const exp2510 = "test"; export const exp2511 = "test"; export const exp2512 = "test"; export const exp2513 = "test"; export const exp2514 = "test"; export const exp2515 = "test"; export const exp2516 = "test"; export const exp2517 = "test"; export con...
{ "end_byte": 83412, "start_byte": 76655, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_83413_90170
export const exp2726 = "test"; export const exp2727 = "test"; export const exp2728 = "test"; export const exp2729 = "test"; export const exp2730 = "test"; export const exp2731 = "test"; export const exp2732 = "test"; export const exp2733 = "test"; export const exp2734 = "test"; export const exp2735 = "test"; export con...
{ "end_byte": 90170, "start_byte": 83413, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_90171_96928
export const exp2944 = "test"; export const exp2945 = "test"; export const exp2946 = "test"; export const exp2947 = "test"; export const exp2948 = "test"; export const exp2949 = "test"; export const exp2950 = "test"; export const exp2951 = "test"; export const exp2952 = "test"; export const exp2953 = "test"; export con...
{ "end_byte": 96928, "start_byte": 90171, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_96929_103686
export const exp3162 = "test"; export const exp3163 = "test"; export const exp3164 = "test"; export const exp3165 = "test"; export const exp3166 = "test"; export const exp3167 = "test"; export const exp3168 = "test"; export const exp3169 = "test"; export const exp3170 = "test"; export const exp3171 = "test"; export con...
{ "end_byte": 103686, "start_byte": 96929, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_103687_110444
export const exp3380 = "test"; export const exp3381 = "test"; export const exp3382 = "test"; export const exp3383 = "test"; export const exp3384 = "test"; export const exp3385 = "test"; export const exp3386 = "test"; export const exp3387 = "test"; export const exp3388 = "test"; export const exp3389 = "test"; export con...
{ "end_byte": 110444, "start_byte": 103687, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_110445_117202
export const exp3598 = "test"; export const exp3599 = "test"; export const exp3600 = "test"; export const exp3601 = "test"; export const exp3602 = "test"; export const exp3603 = "test"; export const exp3604 = "test"; export const exp3605 = "test"; export const exp3606 = "test"; export const exp3607 = "test"; export con...
{ "end_byte": 117202, "start_byte": 110445, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_117203_123960
export const exp3816 = "test"; export const exp3817 = "test"; export const exp3818 = "test"; export const exp3819 = "test"; export const exp3820 = "test"; export const exp3821 = "test"; export const exp3822 = "test"; export const exp3823 = "test"; export const exp3824 = "test"; export const exp3825 = "test"; export con...
{ "end_byte": 123960, "start_byte": 117203, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_123961_130718
export const exp4034 = "test"; export const exp4035 = "test"; export const exp4036 = "test"; export const exp4037 = "test"; export const exp4038 = "test"; export const exp4039 = "test"; export const exp4040 = "test"; export const exp4041 = "test"; export const exp4042 = "test"; export const exp4043 = "test"; export con...
{ "end_byte": 130718, "start_byte": 123961, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_130719_137476
export const exp4252 = "test"; export const exp4253 = "test"; export const exp4254 = "test"; export const exp4255 = "test"; export const exp4256 = "test"; export const exp4257 = "test"; export const exp4258 = "test"; export const exp4259 = "test"; export const exp4260 = "test"; export const exp4261 = "test"; export con...
{ "end_byte": 137476, "start_byte": 130719, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_137477_144234
export const exp4470 = "test"; export const exp4471 = "test"; export const exp4472 = "test"; export const exp4473 = "test"; export const exp4474 = "test"; export const exp4475 = "test"; export const exp4476 = "test"; export const exp4477 = "test"; export const exp4478 = "test"; export const exp4479 = "test"; export con...
{ "end_byte": 144234, "start_byte": 137477, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_144235_150992
export const exp4688 = "test"; export const exp4689 = "test"; export const exp4690 = "test"; export const exp4691 = "test"; export const exp4692 = "test"; export const exp4693 = "test"; export const exp4694 = "test"; export const exp4695 = "test"; export const exp4696 = "test"; export const exp4697 = "test"; export con...
{ "end_byte": 150992, "start_byte": 144235, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/manyConstExports.ts_150993_153906
export const exp4906 = "test"; export const exp4907 = "test"; export const exp4908 = "test"; export const exp4909 = "test"; export const exp4910 = "test"; export const exp4911 = "test"; export const exp4912 = "test"; export const exp4913 = "test"; export const exp4914 = "test"; export const exp4915 = "test"; export con...
{ "end_byte": 153906, "start_byte": 150993, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/manyConstExports.ts" }
TypeScript/tests/cases/compiler/jsFileCompilationBindDuplicateIdentifier.ts_0_95
// @allowJs: true // @checkJs: true // @noEmit: true // @filename: a.js var a = 10; class a { }
{ "end_byte": 95, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationBindDuplicateIdentifier.ts" }
TypeScript/tests/cases/compiler/concatTuples.ts_0_76
let ijs: [number, number][] = [[1, 2]]; ijs = ijs.concat([[3, 4], [5, 6]]);
{ "end_byte": 76, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/concatTuples.ts" }
TypeScript/tests/cases/compiler/letInVarDeclOfForOf_ES6.ts_0_105
// @target: es6 // should not be an error for (var let of [1,2,3]) {} { for (var let of [1,2,3]) {} }
{ "end_byte": 105, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/letInVarDeclOfForOf_ES6.ts" }
TypeScript/tests/cases/compiler/importPropertyFromMappedType.ts_0_287
// #42957 // @filename: errors.d.ts export = createHttpError; declare const createHttpError: createHttpError.NamedConstructors; declare namespace createHttpError { type NamedConstructors = { [P in 'NotFound']: unknown;} } // @filename: main.ts import { NotFound } from './errors'
{ "end_byte": 287, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importPropertyFromMappedType.ts" }
TypeScript/tests/cases/compiler/genericInterfaceImplementation.ts_0_220
interface IOption<A> { get(): A; flatten<B>(): IOption<B>; } class None<T> implements IOption<T>{ get(): T { throw null; } flatten<U>() : IOption<U> { return new None<U>(); } }
{ "end_byte": 220, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericInterfaceImplementation.ts" }
TypeScript/tests/cases/compiler/importHelpersWithImportStarAs.ts_0_312
// @importHelpers: true // @target: es2017 // @module: commonjs,system,amd,es2015,es2020 // @esModuleInterop: true,false // @filename: a.ts export class A { } // @filename: b.ts import * as a from "./a"; export { a }; // @filename: tslib.d.ts declare module "tslib" { function __importStar(m: any): void; }
{ "end_byte": 312, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importHelpersWithImportStarAs.ts" }
TypeScript/tests/cases/compiler/commentInNamespaceDeclarationWithIdentifierPathName.ts_3_72
mespace hello.hi.world { function foo() {} // TODO, blah }
{ "end_byte": 72, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentInNamespaceDeclarationWithIdentifierPathName.ts" }
TypeScript/tests/cases/compiler/genericClassesInModule.ts_0_116
// @declaration: true module Foo { export class B<T>{ } export class A { } } var a = new Foo.B<Foo.A>();
{ "end_byte": 116, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericClassesInModule.ts" }
TypeScript/tests/cases/compiler/forIn2.ts_0_20
for (var i in 1) { }
{ "end_byte": 20, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/forIn2.ts" }
TypeScript/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts_0_205
// @declaration: true // @target: es5 function /*1*/makePoint(x: number) { return { b: 10, set x(a: number) { this.b = a; } }; }; var /*3*/point = makePoint(2); point./*2*/x = 30;
{ "end_byte": 205, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declFileObjectLiteralWithOnlySetter.ts" }
TypeScript/tests/cases/compiler/reactTagNameComponentWithPropsNoOOM2.tsx_0_305
// @jsx: react // @strict: true /// <reference path="/.lib/react16.d.ts" /> import * as React from "react"; declare const Tag: keyof React.ReactHTML; const classes = ""; const rest: React.HTMLAttributes<HTMLElement> = {}; const children: any[] = []; <Tag className={classes} {...rest}> {children} </Tag>
{ "end_byte": 305, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/reactTagNameComponentWithPropsNoOOM2.tsx" }
TypeScript/tests/cases/compiler/genericFunduleInModule.ts_0_132
module A { export function B<T>(x: T) { return x; } export module B { export var x = 1; } } var b: A.B; A.B(1);
{ "end_byte": 132, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericFunduleInModule.ts" }
TypeScript/tests/cases/compiler/contextualTypeObjectSpreadExpression.ts_0_61
interface I { a: "a"; } let i: I; i = { ...{ a: "a" } };
{ "end_byte": 61, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTypeObjectSpreadExpression.ts" }
TypeScript/tests/cases/compiler/expandoFunctionContextualTypesJSDocInTs.ts_0_127
export function Foo() { } // This comment should have no effect; this is a TS file. /** @type {never} */ Foo.bar = () => { };
{ "end_byte": 127, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/expandoFunctionContextualTypesJSDocInTs.ts" }
TypeScript/tests/cases/compiler/contextualTyping25.ts_0_60
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
{ "end_byte": 60, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTyping25.ts" }
TypeScript/tests/cases/compiler/doWhileLoop.ts_0_28
do { } while (false); var n;
{ "end_byte": 28, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/doWhileLoop.ts" }
TypeScript/tests/cases/compiler/staticMemberAccessOffDerivedType1.ts_0_136
class SomeBase { static GetNumber() { return 2; } } class P extends SomeBase { static SomeNumber = P.GetNumber(); }
{ "end_byte": 136, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/staticMemberAccessOffDerivedType1.ts" }
TypeScript/tests/cases/compiler/controlFlowNullTypeAndLiteral.ts_0_626
// @strict: true // Repros from #23771 const myNull: null = null; const objWithValMaybeNull: { val: number | null } = { val: 1 }; const addOne = function (num: number) { return num + 1; } if (objWithValMaybeNull.val !== null) addOne(objWithValMaybeNull.val); if (objWithValMaybeNull.val !== myNull) addOne...
{ "end_byte": 626, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/controlFlowNullTypeAndLiteral.ts" }
TypeScript/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts_0_597
// @target: ES5 // @module: commonjs // @declaration: true module m { class private1 { } export class public1 { } // Directly using names from this module var x: private1; var y = new private1(); export var k: private1; export var l = new private1(); var x2: public1; var...
{ "end_byte": 597, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declFileTypeAnnotationVisibilityErrorVariableDeclaration.ts" }
TypeScript/tests/cases/compiler/FunctionDeclaration3.ts_0_15
function foo();
{ "end_byte": 15, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/FunctionDeclaration3.ts" }
TypeScript/tests/cases/compiler/multiCallOverloads.ts_0_286
interface ICallback { (x?: string):void; } function load(f: ICallback) {} var f1: ICallback = function(z?) {} var f2: ICallback = function(z?) {} load(f1) // ok load(f2) // ok load(function() {}) // this shouldn’t be an error load(function(z?) {}) // this shouldn't be an error
{ "end_byte": 286, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/multiCallOverloads.ts" }
TypeScript/tests/cases/compiler/privacyGloImportParseErrors.ts_0_5028
//@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": 5028, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyGloImportParseErrors.ts" }
TypeScript/tests/cases/compiler/argumentsReferenceInMethod3_Js.ts_0_336
// @declaration: true // @allowJs: true // @emitDeclarationOnly: true // @filename: /a.js class A { get arguments() { return { bar: {} }; } } class B extends A { /** * @param {object} [foo={}] */ m(foo = {}) { /** * @type object */ this.x = foo; /** * @type object */ this.y = super.argu...
{ "end_byte": 336, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/argumentsReferenceInMethod3_Js.ts" }
TypeScript/tests/cases/compiler/declarationEmitMethodDeclaration.ts_0_166
// @allowJs: true // @checkJs: true // @declaration: true // @emitDeclarationOnly: true // @filename: /a.js export default { methods: { foo() { } } }
{ "end_byte": 166, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitMethodDeclaration.ts" }
TypeScript/tests/cases/compiler/jsFileMethodOverloads.ts_0_765
// @allowJs: true // @outDir: dist/ // @declaration: true // @filename: jsFileMethodOverloads.js /** * @template T */ class Example { /** * @param {T} value */ constructor(value) { this.value = value; } /** * @overload * @param {Example<number>} this * @returns {'number'} */ /** ...
{ "end_byte": 765, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileMethodOverloads.ts" }
TypeScript/tests/cases/compiler/jsFileCompilationConstructorOverloadSyntax.ts_0_83
// @allowJs: true // @noEmit: true // @filename: a.js class A { constructor(); }
{ "end_byte": 83, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationConstructorOverloadSyntax.ts" }
TypeScript/tests/cases/compiler/noCrashUMDMergedWithGlobalValue.ts_0_223
//@filename: /other.d.ts export as namespace SomeInterface; export type Action = "PUSH" | "POP" | "REPLACE"; //@filename: /main.ts interface SomeInterface { readonly length: number; } declare const value: SomeInterface;
{ "end_byte": 223, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noCrashUMDMergedWithGlobalValue.ts" }
TypeScript/tests/cases/compiler/alwaysStrictModule4.ts_3_85
@alwaysStrict: true // @module: commonjs // Module commonjs export const a = 1
{ "end_byte": 85, "start_byte": 3, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/alwaysStrictModule4.ts" }
TypeScript/tests/cases/compiler/jsFileCompilationPublicParameterModifier.ts_0_73
// @allowJs: true // @filename: a.js class C { constructor(public x) { }}
{ "end_byte": 73, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationPublicParameterModifier.ts" }
TypeScript/tests/cases/compiler/undefinedTypeAssignment4.ts_0_162
class undefined { foo: string; } interface undefined { member: number; } namespace undefined { export var x = 42; } var x: undefined; var y: typeof undefined;
{ "end_byte": 162, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/undefinedTypeAssignment4.ts" }
TypeScript/tests/cases/compiler/isolatedModulesDeclaration.ts_0_101
// @isolatedModules: true // @declaration: true // @target: es6 // @filename: file1.ts export var x;
{ "end_byte": 101, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/isolatedModulesDeclaration.ts" }
TypeScript/tests/cases/compiler/augmentedTypesClass2a.ts_0_109
//// class then function class c2 { public foo() { } } // error function c2() { } // error var c2 = () => { }
{ "end_byte": 109, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/augmentedTypesClass2a.ts" }
TypeScript/tests/cases/compiler/declarationEmitClassMixinLocalClassDeclaration.ts_0_657
// @declaration: true export type AnyFunction<Result = any> = (...input: any[]) => Result export type AnyConstructor<Instance extends object = object, Static extends object = object> = (new (...input: any[]) => Instance) & Static type MixinHelperFunc = <A extends AnyConstructor, T>(required: [A], arg: T) => T ex...
{ "end_byte": 657, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitClassMixinLocalClassDeclaration.ts" }
TypeScript/tests/cases/compiler/returnInConstructor1.ts_0_809
class A { foo() { } constructor() { return; } } class B { foo() { } constructor() { return 1; // error } } class C { foo() { } constructor() { return this; } } class D { foo() { } constructor() { return "test"; // error } } class E { ...
{ "end_byte": 809, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/returnInConstructor1.ts" }
TypeScript/tests/cases/compiler/genericStaticAnyTypeFunction.ts_0_229
class A { static one<T>(source: T, value: number): T { return source; } static goo() { return 0; } static two<T>(source: T): T { return this.one<T>(source, 42); // should not error } }
{ "end_byte": 229, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericStaticAnyTypeFunction.ts" }
TypeScript/tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithExport.ts_0_231
//@module: commonjs // @declaration: true export module x { export class c { foo(a: number) { return a; } } } export import xc = x.c; export var cProp = new xc(); var cReturnVal = cProp.foo(10);
{ "end_byte": 231, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithExport.ts" }
TypeScript/tests/cases/compiler/templateLiteralIntersection4.ts_0_471
// @strict: true type StateHook<S> = () => [S, unknown]; type StoreUtils<Store extends { [K: string]: any }> = Omit<{ [K in keyof Store as `use${Capitalize<string & K>}`]: StateHook<Store[K]> }, 'useStore'> & { Provider: unknown, useStore: StateHook<Store> }; declare function createStore<Store extends { [K: ...
{ "end_byte": 471, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/templateLiteralIntersection4.ts" }
TypeScript/tests/cases/compiler/voidAsOperator.ts_0_65
if (!void 0 !== true) { } //CHECK#2 if (!null !== true) { }
{ "end_byte": 65, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/voidAsOperator.ts" }
TypeScript/tests/cases/compiler/umdNamedAmdMode.ts_0_84
// @module: umd // @filename: main.ts /// <amd-module name="a"/> export const a = 1;
{ "end_byte": 84, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/umdNamedAmdMode.ts" }
TypeScript/tests/cases/compiler/declarationEmitTopLevelNodeFromCrossFile2.ts_0_486
// @strict: true // @declaration: true // @filename: a.ts import { boxedBox } from "./boxedBox"; export const _ = boxedBox; // At index 83 /** * wat */ // @filename: boxedBox.d.ts export declare const boxedBox: import("./box").Box<{ boxed: import("./box").Box<number>; }>; // ^This is in...
{ "end_byte": 486, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitTopLevelNodeFromCrossFile2.ts" }
TypeScript/tests/cases/compiler/recursiveConditionalTypes2.ts_0_1654
// @strict: true // @lib: esnext // @noEmit: true // repro from https://github.com/microsoft/TypeScript/issues/43877 type UnionToIntersection<U> = ( U extends any ? (k: U) => unknown : never ) extends (k: infer I) => unknown ? I : never; interface ClassSpec { public?: object; private?: object; publicExte...
{ "end_byte": 1654, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/recursiveConditionalTypes2.ts" }
TypeScript/tests/cases/compiler/continueNotInIterationStatement3.ts_0_39
switch (0) { default: continue; }
{ "end_byte": 39, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/continueNotInIterationStatement3.ts" }
TypeScript/tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding.ts_0_366
// @target: es6 // @declaration: true // @declaration: true // @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_0.ts export var a = 10; // @filename: es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceB...
{ "end_byte": 366, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding.ts" }
TypeScript/tests/cases/compiler/acceptSymbolAsWeakType.ts_0_366
// @strict: true // @lib: esnext // @target: esnext const s: symbol = Symbol('s'); const ws = new WeakSet([s]); ws.add(s); ws.has(s); ws.delete(s); const wm = new WeakMap([[s, false]]); wm.set(s, true); wm.has(s); wm.get(s); wm.delete(s); const wr = new WeakRef(s); wr.deref(); const f = new FinalizationRegistry(()...
{ "end_byte": 366, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/acceptSymbolAsWeakType.ts" }
TypeScript/tests/cases/compiler/contextualReturnTypeOfIIFE2.ts_0_213
// @lib: esnext // @noImplicitAny: true declare namespace app { function foo(): void; } app.foo.bar = (function () { const someFun = (arg: number) => {}; return { someFun }; })(); app.foo.bar.someFun(1);
{ "end_byte": 213, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualReturnTypeOfIIFE2.ts" }
TypeScript/tests/cases/compiler/instanceofOnInstantiationExpression.ts_0_357
declare class Box<T> { value: T; } declare const maybeBox: unknown; maybeBox instanceof Box; // OK maybeBox instanceof Box<number>; // error maybeBox instanceof (Box<number>); // error maybeBox instanceof ((Box<number>)); // error Box<number> instanceof Object; // OK (Box<number>) instanceof Object; // OK ((Bo...
{ "end_byte": 357, "start_byte": 0, "url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/instanceofOnInstantiationExpression.ts" }