_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts_3_273 | @outFile: outFile.js
// @module: amd
// @target: es5
// @Filename: test.ts
#!/usr/bin/env gjs
"use strict"
class Doo {}
class Scooby extends Doo {}
// @Filename: test1.ts
#!/usr/bin/env gjs
"use strict"
"Another prologue"
class Dood {}
class Scoobyd extends Dood {} | {
"end_byte": 273,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/emitBundleWithShebangAndPrologueDirectives2.ts"
} |
TypeScript/tests/cases/compiler/typeName1.ts_0_900 | interface I {
k;
}
class C {
public eek:string;
static zeek:number;
}
var x1:{ f(s:string):number;f(n:number):string; }=3;
var x2:{ f(s:string):number; } =3;
var x3:{ (s:string):number;(n:number):string; }=3;
var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3;
var x5:{ (s:string):number;(n:nu... | {
"end_byte": 900,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeName1.ts"
} |
TypeScript/tests/cases/compiler/computedPropertyNameAndTypeParameterConflict.ts_0_97 | // @declaration: true
declare const O: unique symbol;
declare class Bar<O> {
[O]: number;
}
| {
"end_byte": 97,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/computedPropertyNameAndTypeParameterConflict.ts"
} |
TypeScript/tests/cases/compiler/typeParamExtendsOtherTypeParam.ts_0_664 | class A<T, U extends T> { }
class B<T extends Object, U extends T> {
data: A<Object, Object>;
}
// Below 2 should compile without error
var x: A< { a: string }, { a: string; b: number }>;
var y: B< { a: string }, { a: string; b: number }>;
// Below should be in error
var x1: A<{ a: string;}, { b: string }>;
var... | {
"end_byte": 664,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeParamExtendsOtherTypeParam.ts"
} |
TypeScript/tests/cases/compiler/unusedImports1.ts_0_161 | //@noUnusedLocals:true
//@noUnusedParameters:true
// @Filename: file1.ts
export class Calculator {
}
// @Filename: file2.ts
import {Calculator} from "./file1" | {
"end_byte": 161,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedImports1.ts"
} |
TypeScript/tests/cases/compiler/continueTarget3.ts_0_83 | // @allowUnusedLabels: true
target1:
target2:
while (true) {
continue target1;
} | {
"end_byte": 83,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/continueTarget3.ts"
} |
TypeScript/tests/cases/compiler/requireOfJsonFileInJsFile.ts_0_558 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @strict: true
// @resolveJsonModule: true
// @Filename: /json.json
{ "a": 0 }
// @Filename: /js.js
module.exports = { a: 0 };
// @Filename: /user.js
const json0 = require("./json.json");
json0.b; // Error (good)
/** @type {{ b: number }} */
const json1 = requi... | {
"end_byte": 558,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/requireOfJsonFileInJsFile.ts"
} |
TypeScript/tests/cases/compiler/contextualTyping2.ts_0_43 | var foo: {id:number;} = {id:4, name:"foo"}; | {
"end_byte": 43,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTyping2.ts"
} |
TypeScript/tests/cases/compiler/overloadOnConstConstraintChecks2.ts_0_213 | class A {}
class B extends A {}
class C extends A {
public foo() { }
}
function foo(name: 'hi'): B;
function foo(name: 'bye'): C;
function foo(name: string): A;
function foo(name: any): A {
return null;
} | {
"end_byte": 213,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/overloadOnConstConstraintChecks2.ts"
} |
TypeScript/tests/cases/compiler/shadowPrivateMembers.ts_0_76 | class base { private n() {} }
class derived extends base { private n() {} }
| {
"end_byte": 76,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/shadowPrivateMembers.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitComputedPropertyNameSymbol2.ts_0_303 | // @strict: true
// @lib: esnext
// @declaration: true
// @emitDeclarationOnly: true
// @filename: type.ts
namespace Foo {
export const sym = Symbol();
}
export type Type = { x?: { [Foo.sym]: 0 } };
// @filename: index.ts
import { type Type } from "./type";
export const foo = { ...({} as Type) };
| {
"end_byte": 303,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitComputedPropertyNameSymbol2.ts"
} |
TypeScript/tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.ts_0_153 | // @target: ES2020
// @declaration: true
export const thing = (null! as { [K in keyof number[] as Exclude<K, "length">]: (number[])[K] }) satisfies any;
| {
"end_byte": 153,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.ts"
} |
TypeScript/tests/cases/compiler/mappedTypeAndIndexSignatureRelation.ts_0_823 | // @strict: true
type Same<T> = { [P in keyof T]: T[P] };
type T1<T extends Record<PropertyKey, number>> = T;
type T2<U extends Record<PropertyKey, number>> = T1<Same<U>>;
// Repro from #38235
type Foo<IdentifierT extends Record<PropertyKey, PropertyKey>> =
IdentifierT
;
type Bar<IdentifierT extends Record<Pro... | {
"end_byte": 823,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/mappedTypeAndIndexSignatureRelation.ts"
} |
TypeScript/tests/cases/compiler/fileWithNextLine2.ts_3_117 | Note: there is a nextline (0x85) char between the = and the 0.
// it should be treated like a space
var v =
0; | {
"end_byte": 117,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/fileWithNextLine2.ts"
} |
TypeScript/tests/cases/compiler/spreadTypeRemovesReadonly.ts_0_149 | interface ReadonlyData {
readonly value: string;
}
const data: ReadonlyData = { value: 'foo' };
const clone = { ...data };
clone.value = 'bar';
| {
"end_byte": 149,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/spreadTypeRemovesReadonly.ts"
} |
TypeScript/tests/cases/compiler/assignmentCompatability23.ts_0_341 | 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 obj = {two: [true]};
export var __val__obj = obj;
}
__test2__.__val__obj = ... | {
"end_byte": 341,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentCompatability23.ts"
} |
TypeScript/tests/cases/compiler/ifElseWithStatements1.ts_0_160 | // @allowUnreachableCode: true
if (true)
f();
else
f();
function foo(): boolean {
if (true)
return true;
else
return false;
}
| {
"end_byte": 160,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/ifElseWithStatements1.ts"
} |
TypeScript/tests/cases/compiler/specializationError.ts_0_209 | interface Promise<T> {
then<U>(value: T): void;
}
interface Bar {
bar(value: "Menu"): Promise<string>;
bar<T>(value: string, element: string): Promise<T>;
bar<T>(value: string): Promise<T>;
}
| {
"end_byte": 209,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/specializationError.ts"
} |
TypeScript/tests/cases/compiler/booleanFilterAnyArray.ts_0_674 | interface Bullean { }
interface BulleanConstructor {
new(v1?: any): Bullean;
<T>(v2?: T): v2 is T;
}
interface Ari<T> {
filter<S extends T>(cb1: (value: T) => value is S): T extends any ? Ari<any> : Ari<S>;
filter(cb2: (value: T) => unknown): Ari<T>;
}
declare var Bullean: BulleanConstructor;
declare l... | {
"end_byte": 674,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/booleanFilterAnyArray.ts"
} |
TypeScript/tests/cases/compiler/varianceAnnotationValidation.ts_0_455 | // @strict: true
// @declaration: true
// Repro from #49607
// Variance annotation error expected
interface Controller<out T> {
createAnimal: () => T;
run: (animal: T) => void;
}
interface Animal {
run(): void;
};
class Dog implements Animal {
run() {};
bark() {};
}
interface AnimalContainer<T> {
controller... | {
"end_byte": 455,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/varianceAnnotationValidation.ts"
} |
TypeScript/tests/cases/compiler/emitClassExpressionInDeclarationFile.ts_0_627 | // @declaration: true
export var simpleExample = class {
static getTags() { }
tags() { }
}
export var circularReference = class C {
static getTags(c: C): C { return c }
tags(c: C): C { return c }
}
// repro from #15066
export class FooItem {
foo(): void { }
name?: string;
}
export type Constru... | {
"end_byte": 627,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/emitClassExpressionInDeclarationFile.ts"
} |
TypeScript/tests/cases/compiler/esModuleInteropEnablesSyntheticDefaultImports.ts_0_189 | // @esModuleInterop: true
// @module: es2015
// @Filename: a.ts
import Namespace from "./b";
export var x = new Namespace.Foo();
// @Filename: b.d.ts
export class Foo {
member: string;
}
| {
"end_byte": 189,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/esModuleInteropEnablesSyntheticDefaultImports.ts"
} |
TypeScript/tests/cases/compiler/jsNegativeElementAccessNotBound.ts_0_139 | // @allowJs: true
// @checkJs: true
// @noEmit: true
// @filename: jsNegativeELementAccessNotBound.js
var indexMap = {};
indexMap[-1] = 0;
| {
"end_byte": 139,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsNegativeElementAccessNotBound.ts"
} |
TypeScript/tests/cases/compiler/argsInScope.ts_0_202 | class C {
P(ii:number, j:number, k:number) {
for (var i = 0; i < arguments.length; i++) {
// WScript.Echo("param: " + arguments[i]);
}
}
}
var c = new C();
c.P(1,2,3);
| {
"end_byte": 202,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/argsInScope.ts"
} |
TypeScript/tests/cases/compiler/commentsClass.ts_0_1437 | // @target: ES5
// @declaration: true
// @removeComments: false
/** This is class c2 without constuctor*/
class c2 {
} // trailing comment1
var i2 = new c2();
var i2_c = c2;
class c3 {
/** Constructor comment*/
constructor() {
} // trailing comment of constructor
} /* trailing comment 2 */
var i3 = new c3(... | {
"end_byte": 1437,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentsClass.ts"
} |
TypeScript/tests/cases/compiler/argumentsObjectIterator02_ES5.ts_0_281 | //@target: ES5
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let blah = arguments[Symbol.iterator];
let result = [];
for (let arg of blah()) {
result.push(arg + arg);
}
return <[any, any, any]>result;
}
| {
"end_byte": 281,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/argumentsObjectIterator02_ES5.ts"
} |
TypeScript/tests/cases/compiler/mergedModuleDeclarationCodeGen.ts_0_231 | export module X {
export module Y {
class A {
constructor(Y: any) {
new B();
}
}
}
}
export module X {
export module Y {
export class B {
}
}
} | {
"end_byte": 231,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/mergedModuleDeclarationCodeGen.ts"
} |
TypeScript/tests/cases/compiler/moduleSameValueDuplicateExportedBindings2.ts_0_186 | // @module: commonjs
// @filename: a.ts
export * from "./b";
export * from "./c";
// @filename: b.ts
export {Animals} from "./c";
// @filename: c.ts
export enum Animals {
Cat,
Dog
}; | {
"end_byte": 186,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleSameValueDuplicateExportedBindings2.ts"
} |
TypeScript/tests/cases/compiler/moduleAugmentationGlobal2.ts_0_305 | // @module: commonjs
// @declaration: true
// @filename: f1.ts
export class A {};
// @filename: f2.ts
// change the shape of Array<T>
import {A} from "./f1";
declare global {
interface Array<T> {
getCountAsString(): string;
}
}
let x = [1];
let y = x.getCountAsString().toLowerCase();
| {
"end_byte": 305,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleAugmentationGlobal2.ts"
} |
TypeScript/tests/cases/compiler/contextualTypingArrayOfLambdas.ts_0_166 | class A {
foo: string;
}
class B extends A {
bar: string;
}
class C extends A {
baz: string;
}
var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }];
| {
"end_byte": 166,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTypingArrayOfLambdas.ts"
} |
TypeScript/tests/cases/compiler/importAndVariableDeclarationConflict3.ts_0_67 | module m {
export var m = '';
}
import x = m.m;
import x = m.m;
| {
"end_byte": 67,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importAndVariableDeclarationConflict3.ts"
} |
TypeScript/tests/cases/compiler/simpleRecursionWithBaseCase1.ts_0_548 | // @strict: true
// @noImplicitAny: true
function fn1(n: number) {
if (n === 0) {
return 3;
} else {
return fn1(n - 1);
}
}
const num: number = fn1();
function fn2(n: number) {
return fn2(n);
}
const nev: never = fn2();
function fn3(n: number) {
if (n === 0) {
return 3;
... | {
"end_byte": 548,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/simpleRecursionWithBaseCase1.ts"
} |
TypeScript/tests/cases/compiler/typedArraysSubarray.ts_0_1238 | function int8ArraySubarray() {
var arr = new Int8Array(10);
arr.subarray();
arr.subarray(0);
arr.subarray(0, 10);
}
function uint8ArraySubarray() {
var arr = new Uint8Array(10);
arr.subarray();
arr.subarray(0);
arr.subarray(0, 10);
}
function uint8ClampedArraySubarray() {
var arr =... | {
"end_byte": 1238,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typedArraysSubarray.ts"
} |
TypeScript/tests/cases/compiler/chainedImportAlias.ts_0_232 | // @module: commonjs
// @Filename: chainedImportAlias_file0.ts
export module m {
export function foo() { }
}
// @Filename: chainedImportAlias_file1.ts
import x = require('./chainedImportAlias_file0');
import y = x;
y.m.foo();
| {
"end_byte": 232,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/chainedImportAlias.ts"
} |
TypeScript/tests/cases/compiler/asyncFunctionReturnExpressionErrorSpans.ts_0_318 | interface Foo {
bar: {
baz: {
inner: {
thing: string
}
}
}
}
async function asyncFoo(): Promise<Foo> {
return {
bar: {
baz: {
inner: {
thing: 1
}
}
}
}
} | {
"end_byte": 318,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/asyncFunctionReturnExpressionErrorSpans.ts"
} |
TypeScript/tests/cases/compiler/checkJsdocTypeTagOnExportAssignment1.ts_0_304 | // @allowJs: true
// @checkJs: true
// @outDir: ./out
// @filename: checkJsdocTypeTagOnExportAssignment1.js
// @Filename: a.js
/**
* @typedef {Object} Foo
* @property {boolean} a
* @property {boolean} b
*/
/** @type {Foo} */
export default { c: false };
// @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/checkJsdocTypeTagOnExportAssignment1.ts"
} |
TypeScript/tests/cases/compiler/objectFreezeLiteralsDontWiden.ts_0_196 | const PUPPETEER_REVISIONS = Object.freeze({
chromium: '1011831',
firefox: 'latest',
});
let preferredRevision = PUPPETEER_REVISIONS.chromium;
preferredRevision = PUPPETEER_REVISIONS.firefox;
| {
"end_byte": 196,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/objectFreezeLiteralsDontWiden.ts"
} |
TypeScript/tests/cases/compiler/wellKnownSymbolExpando.ts_0_88 | // @noEmit: true
// @target: esnext
function f() {}
f[Symbol.iterator] = function() {}
| {
"end_byte": 88,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/wellKnownSymbolExpando.ts"
} |
TypeScript/tests/cases/compiler/controlFlowCommaExpressionAssertionWithinTernary.ts_0_289 | // @strict: true
declare function assert(value: any): asserts value;
function foo2(param: number | null | undefined): number | null {
const val = param !== undefined;
return val ? (assert(param !== undefined), param) : null;
// ^^^^^ Still typed as number | null | undefined
} | {
"end_byte": 289,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/controlFlowCommaExpressionAssertionWithinTernary.ts"
} |
TypeScript/tests/cases/compiler/assignmentCompatability32.ts_0_339 | 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:{one:boolean[];};;
export var __val__aa = aa;
}
__test2__.__val__aa = __... | {
"end_byte": 339,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/assignmentCompatability32.ts"
} |
TypeScript/tests/cases/compiler/recursiveCloduleReference.ts_0_87 | module M
{
export class C {
}
export module C {
export var C = M.C
};
};
| {
"end_byte": 87,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/recursiveCloduleReference.ts"
} |
TypeScript/tests/cases/compiler/initializedDestructuringAssignmentTypes.ts_0_51 | const [, a = ''] = ''.match('') || [];
a.toFixed() | {
"end_byte": 51,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/initializedDestructuringAssignmentTypes.ts"
} |
TypeScript/tests/cases/compiler/typeInferenceWithTypeAnnotation.ts_0_64 | declare function f<T>(p: (t: T) => T): T;
f((n: number) => n); | {
"end_byte": 64,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeInferenceWithTypeAnnotation.ts"
} |
TypeScript/tests/cases/compiler/abstractClassInLocalScopeIsAbstract.ts_0_89 | (() => {
abstract class A {}
class B extends A {}
new A();
new B();
})()
| {
"end_byte": 89,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/abstractClassInLocalScopeIsAbstract.ts"
} |
TypeScript/tests/cases/compiler/pathsValidation2.ts_0_166 | // @filename: tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": [1]
}
}
}
// @filename: a.ts
let x = 1; | {
"end_byte": 166,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/pathsValidation2.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitDestructuringArrayPattern3.ts_0_66 | // @declaration: true
module M {
export var [a, b] = [1, 2];
} | {
"end_byte": 66,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitDestructuringArrayPattern3.ts"
} |
TypeScript/tests/cases/compiler/controlFlowForCompoundAssignmentToThisMember.ts_1_554 | class DatasourceCommandWidgetElement {
_commandBased: boolean;
_commandElement: unknown;
commandElement: unknown;
constructor(target: unknown) {
if (target instanceof DatasourceCommandWidgetElement) {
this._commandBased = true;
this._commandElement = target.commandElemen... | {
"end_byte": 554,
"start_byte": 1,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/controlFlowForCompoundAssignmentToThisMember.ts"
} |
TypeScript/tests/cases/compiler/recursiveConditionalCrash4.ts_0_455 | // @strict: true
// @noEmit: true
// Repros from #53783
type LengthDown<
Str extends string,
Length extends number | bigint,
It
> = It extends StrIter.Iterator
? StrIter.CutAt<Str, It> extends `${infer $Rest}`
? LengthDown<$Rest, Add<Length, StrIter.Value<It>>, It>
: LengthDown<Str, Length, StrIter.Pr... | {
"end_byte": 455,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/recursiveConditionalCrash4.ts"
} |
TypeScript/tests/cases/compiler/contextualSignatureInObjectFreeze.ts_0_88 | // #49101
// @target: es2020
// @lib: es2019
Object.freeze({
f: function () { }
})
| {
"end_byte": 88,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualSignatureInObjectFreeze.ts"
} |
TypeScript/tests/cases/compiler/prefixUnaryOperatorsOnExportedVariables.ts_0_211 | // @target: ES5
// @module: system
export var x = false;
export var y = 1;
if (!x) {
}
if (+x) {
}
if (-x) {
}
if (~x) {
}
if (void x) {
}
if (typeof x) {
}
if (++y) {
} | {
"end_byte": 211,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/prefixUnaryOperatorsOnExportedVariables.ts"
} |
TypeScript/tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithExport.ts_0_202 | //@module: amd
// @declaration: true
export module a {
export module b {
export class c {
}
}
}
export module c {
export import b = a.b;
export var x: b.c = new b.c();
} | {
"end_byte": 202,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithExport.ts"
} |
TypeScript/tests/cases/compiler/contextuallyTypedBooleanLiterals.ts_0_608 | // @strict: true
// @declaration: true
// @strict: true
// @declaration: true
// Repro from #48363
type Box<T> = {
get: () => T,
set: (value: T) => void
}
declare function box<T>(value: T): Box<T>;
const bn1 = box(0); // Box<number>
const bn2: Box<number> = box(0); // Ok
const bb1 = box(false); // Box<... | {
"end_byte": 608,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextuallyTypedBooleanLiterals.ts"
} |
TypeScript/tests/cases/compiler/noImplicitAnyWithOverloads.ts_0_218 | // @noimplicitany: true
interface A {
foo;
}
interface B { }
function callb(lam: (l: A) => void);
function callb(lam: (n: B) => void);
function callb(a) { }
callb((a) => { a.foo; }); // error, chose first overload | {
"end_byte": 218,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noImplicitAnyWithOverloads.ts"
} |
TypeScript/tests/cases/compiler/es6-sourcemap-amd.ts_0_143 | // @target: ES6
// @sourcemap: true
// @module: amd
class A
{
constructor ()
{
}
public B()
{
return 42;
}
} | {
"end_byte": 143,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6-sourcemap-amd.ts"
} |
TypeScript/tests/cases/compiler/instantiateContextuallyTypedGenericThis.ts_0_218 | interface JQuery {
each<T>(
collection: T[], callback: (this: T, dit: T) => T
): T[];
}
let $: JQuery;
let lines: string[];
$.each(lines, function(dit) {
return dit.charAt(0) + this.charAt(1);
});
| {
"end_byte": 218,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/instantiateContextuallyTypedGenericThis.ts"
} |
TypeScript/tests/cases/compiler/reExportGlobalDeclaration1.ts_0_322 | // @module: commonjs
// @filename: file1.d.ts
declare var x: number;
declare var x1: number;
declare let {a, b}: {a: number, b: number};
// @filename: file2.ts
export {x, x as y};
export {x1, x1 as y1};
export {a, a as a1};
export {b, b as b1};
export {x as z};
export {x1 as z1};
export {a as a2};
export {b as b2}... | {
"end_byte": 322,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/reExportGlobalDeclaration1.ts"
} |
TypeScript/tests/cases/compiler/objectCreationOfElementAccessExpression.ts_0_1625 | class Food {
private amount: number;
constructor(public name: string) {
this.amount = 100;
}
public eat(amountToEat: number): boolean {
this.amount -= amountToEat;
if (this.amount <= 0) {
this.amount = 0;
return false;
}
else {
... | {
"end_byte": 1625,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/objectCreationOfElementAccessExpression.ts"
} |
TypeScript/tests/cases/compiler/unusedVariablesinNamespaces1.ts_0_116 | //@noUnusedLocals:true
//@noUnusedParameters:true
namespace Validation {
const lettersRegexp = /^[A-Za-z]+$/;
} | {
"end_byte": 116,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedVariablesinNamespaces1.ts"
} |
TypeScript/tests/cases/compiler/deeplyNestedConditionalTypes.ts_0_2685 | // @strict: true
// @declaration: true
type Foo<T> =
T extends 0 ? '0' :
T extends 1 ? '1' :
T extends 2 ? '2' :
T extends 3 ? '3' :
T extends 4 ? '4' :
T extends 5 ? '5' :
T extends 6 ? '6' :
T extends 7 ? '7' :
T extends 8 ? '8' :
T extends 9 ? '9' :
T extends 10 ? '10' :
... | {
"end_byte": 2685,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/deeplyNestedConditionalTypes.ts"
} |
TypeScript/tests/cases/compiler/constantEnumAssert.ts_0_595 | enum E1 {
a,
b
}
enum E2 {
a = 'a',
b = 'b'
}
enum E3 {
a = 1,
b = a << 1,
c = a << 2,
}
const enum E4 {
a,
b
}
const E5 = {
a: 'a',
b: 'b'
}
const foo1 = { a: E1.a }
const foo2 = { a: E2.a }
const foo3 = { a: E1.a } as const
const foo4 = { a: E2.a } as const
const f... | {
"end_byte": 595,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/constantEnumAssert.ts"
} |
TypeScript/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts_0_112 | // @target: es6
module M {
export class C { }
}
module M {
{
let M = 0;
new C();
}
} | {
"end_byte": 112,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nameCollisionWithBlockScopedVariable1.ts"
} |
TypeScript/tests/cases/compiler/noImplicitAnyParametersInInterface.ts_3_1143 | @noImplicitAny: true
interface I {
// Implicit-'any' errors for first two call signatures, x1, x2, z2.
();
(x1);
(x2, y2: string, z2): any;
// No implicit-'any' errors.
f1(): void;
// Implicit-'any' errors for x.
f2(x): void;
// No implicit-'any' errors.
f3(x: any): void;
... | {
"end_byte": 1143,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noImplicitAnyParametersInInterface.ts"
} |
TypeScript/tests/cases/compiler/declarationImportTypeAliasInferredAndEmittable.ts_0_308 | // @declaration: true
// @filename: foo.ts
class Conn {
constructor() { }
item = 3;
method() { }
}
export = Conn;
// @filename: usage.ts
type Conn = import("./foo");
declare var x: Conn;
export class Wrap {
connItem: number;
constructor(c = x) {
this.connItem = c.item;
}
}
| {
"end_byte": 308,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationImportTypeAliasInferredAndEmittable.ts"
} |
TypeScript/tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.ts_0_224 | //@module: commonjs
// @declaration: true
export module x {
export class c {
foo(a: number) {
return a;
}
}
}
import xc = x.c;
export var cProp = new xc();
var cReturnVal = cProp.foo(10); | {
"end_byte": 224,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitClassMemberNameConflict.ts_0_656 | // @target: es5
// @module: commonjs
// @declaration: true
export class C1 {
C1() { } // has to be the same as the class name
bar() {
return function (t: typeof C1) {
};
}
}
export class C2 {
C2: any // has to be the same as the class name
bar() {
return function (t: type... | {
"end_byte": 656,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitClassMemberNameConflict.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_0_104 | // @strict: true
// Repro from #29926 (expanded 10x for good measure)
const foo = function (this: any) | {
"end_byte": 104,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_105_4336 | {
var a, b, c, d, ab, bc, cd, da, blocks = this.blocks;
if (this.first) {
a = blocks[0] - 1;
a = (a << 3) | (a >>> 29);
d = ((a & 0xefcdab89) | (~a & 0x98badcfe)) + blocks[1] + 271733878;
d = (d << 7) | (d >>> 25);
c = ((d & a) | (~d & 0xefcdab89)) + blocks[2] - 17325841... | {
"end_byte": 4336,
"start_byte": 105,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_4341_8477 | d = (d << 9) | (d >>> 23);
da = d ^ a;
c += (da ^ b) + blocks[5] + 1859775393;
c = (c << 11) | (c >>> 21);
b += (da ^ c) + blocks[13] + 1859775393;
b = (b << 15) | (b >>> 17);
bc = b ^ c;
a += (bc ^ d) + blocks[3] + 1859775393;
a = (a << 3) | (a >>> 29);
d += (bc ^ a) + blocks[11] + ... | {
"end_byte": 8477,
"start_byte": 4341,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_8482_12602 | a = (a << 3) | (a >>> 29);
d += (bc ^ a) + blocks[11] + 1859775393;
d = (d << 9) | (d >>> 23);
da = d ^ a;
c += (da ^ b) + blocks[7] + 1859775393;
c = (c << 11) | (c >>> 21);
b += (da ^ c) + blocks[15] + 1859775393;
b = (b << 15) | (b >>> 17);
a += ((b & c) | (~b & d)) + blocks[4];
... | {
"end_byte": 12602,
"start_byte": 8482,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_12607_16739 | b = (b << 15) | (b >>> 17);
a += ((b & c) | (~b & d)) + blocks[4];
a = (a << 3) | (a >>> 29);
d += ((a & b) | (~a & c)) + blocks[5];
d = (d << 7) | (d >>> 25);
c += ((d & a) | (~d & b)) + blocks[6];
c = (c << 11) | (c >>> 21);
b += ((c & d) | (~c & a)) + blocks[7];
b = (b << 19) | (b >>... | {
"end_byte": 16739,
"start_byte": 12607,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_16744_20843 | b += ((c & d) | (~c & a)) + blocks[7];
b = (b << 19) | (b >>> 13);
a += ((b & c) | (~b & d)) + blocks[8];
a = (a << 3) | (a >>> 29);
d += ((a & b) | (~a & c)) + blocks[9];
d = (d << 7) | (d >>> 25);
c += ((d & a) | (~d & b)) + blocks[10];
c = (c << 11) | (c >>> 21);
b += ((c & d) | (~c &... | {
"end_byte": 20843,
"start_byte": 16744,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_20848_24951 | c += ((d & a) | (~d & b)) + blocks[10];
c = (c << 11) | (c >>> 21);
b += ((c & d) | (~c & a)) + blocks[11];
b = (b << 19) | (b >>> 13);
a += ((b & c) | (~b & d)) + blocks[12];
a = (a << 3) | (a >>> 29);
d += ((a & b) | (~a & c)) + blocks[13];
d = (d << 7) | (d >>> 25);
c += ((d & a) | (~... | {
"end_byte": 24951,
"start_byte": 20848,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_24956_29076 | d += ((a & b) | (~a & c)) + blocks[13];
d = (d << 7) | (d >>> 25);
c += ((d & a) | (~d & b)) + blocks[14];
c = (c << 11) | (c >>> 21);
b += ((c & d) | (~c & a)) + blocks[15];
b = (b << 19) | (b >>> 13);
bc = b & c;
a += (bc | (b & d) | (c & d)) + blocks[0] + 1518500249;
a = (a << 3) | (... | {
"end_byte": 29076,
"start_byte": 24956,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_29081_33166 | a += (bc | (b & d) | (c & d)) + blocks[0] + 1518500249;
a = (a << 3) | (a >>> 29);
ab = a & b;
d += (ab | (a & c) | bc) + blocks[4] + 1518500249;
d = (d << 5) | (d >>> 27);
da = d & a;
c += (da | (d & b) | ab) + blocks[8] + 1518500249;
c = (c << 9) | (c >>> 23);
cd = c & d;
b += (cd ... | {
"end_byte": 33166,
"start_byte": 29081,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_33171_37253 | c += (da | (d & b) | ab) + blocks[8] + 1518500249;
c = (c << 9) | (c >>> 23);
cd = c & d;
b += (cd | (c & a) | da) + blocks[12] + 1518500249;
b = (b << 13) | (b >>> 19);
bc = b & c;
a += (bc | (b & d) | cd) + blocks[1] + 1518500249;
a = (a << 3) | (a >>> 29);
ab = a & b;
d += (ab | (... | {
"end_byte": 37253,
"start_byte": 33171,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_37258_41338 | a += (bc | (b & d) | cd) + blocks[1] + 1518500249;
a = (a << 3) | (a >>> 29);
ab = a & b;
d += (ab | (a & c) | bc) + blocks[5] + 1518500249;
d = (d << 5) | (d >>> 27);
da = d & a;
c += (da | (d & b) | ab) + blocks[9] + 1518500249;
c = (c << 9) | (c >>> 23);
cd = c & d;
b += (cd | (c ... | {
"end_byte": 41338,
"start_byte": 37258,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts_41343_44053 | c += (da | (d & b) | ab) + blocks[9] + 1518500249;
c = (c << 9) | (c >>> 23);
cd = c & d;
b += (cd | (c & a) | da) + blocks[13] + 1518500249;
b = (b << 13) | (b >>> 19);
bc = b & c;
a += (bc | (b & d) | cd) + blocks[2] + 1518500249;
a = (a << 3) | (a >>> 29);
ab = a & b;
d += (ab | (... | {
"end_byte": 44053,
"start_byte": 41343,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/binaryArithmeticControlFlowGraphNotTooLarge.ts"
} |
TypeScript/tests/cases/compiler/indexSignatureWithTrailingComma.ts_0_126 | type A = {
[key: string,]: string;
};
interface B {
[key: string,]: string;
}
class C {
[key: string,]: null;
}
| {
"end_byte": 126,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexSignatureWithTrailingComma.ts"
} |
TypeScript/tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts_0_333 | function f<x, x>() { }
function f2<X, X>(a: X, b: X): X { return null; }
class C<X, X> {
public f<x, x>() {}
public f2<X, X>(a: X, b: X): X { return null; }
}
interface I<X, X> {
f<X, X>();
f2<X, X>(a: X, b: X): X;
}
var m = {
a: function f<X, X>() {},
b: function f2<X, X>(a: X, b: X): X { ret... | {
"end_byte": 333,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericsWithDuplicateTypeParameters1.ts"
} |
TypeScript/tests/cases/compiler/testTypings.ts_0_127 | interface IComparable<T> {
compareTo(other: T);
}
declare function sort<U extends IComparable<U>>(items: U[]): U[];
| {
"end_byte": 127,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/testTypings.ts"
} |
TypeScript/tests/cases/compiler/moduleResolutionWithSuffixes_one_jsonModule.ts_0_542 | // moduleSuffixes has one entry and there's a matching file. module name explicitly includes JSON file extension.
// @fullEmitPaths: true
// @filename: /tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"resolveJsonModule": true,
"outDir": "bin",
"moduleResolution": "node",
"traceResolution": tru... | {
"end_byte": 542,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleResolutionWithSuffixes_one_jsonModule.ts"
} |
TypeScript/tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts_0_258 | // @target: es6
var a = () => <Error>{ name: "foo", message: "bar" };
var b = () => (<Error>{ name: "foo", message: "bar" });
var c = () => ({ name: "foo", message: "bar" });
var d = () => ((<Error>({ name: "foo", message: "bar" }))); | {
"end_byte": 258,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts"
} |
TypeScript/tests/cases/compiler/isolatedModulesSpecifiedModule.ts_0_83 | // @isolatedModules: true
// @module: commonjs
// @filename: file1.ts
export var x; | {
"end_byte": 83,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/isolatedModulesSpecifiedModule.ts"
} |
TypeScript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements16.ts_0_71 | var v: any[];
function foo(a = bar()) { }
function bar(a = foo()) {
} | {
"end_byte": 71,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionWithDefaultParameterWithNoStatements16.ts"
} |
TypeScript/tests/cases/compiler/genericClassWithStaticFactory.ts_0_3928 | module Editor {
export class List<T> {
public next: List<T>;
public prev: List<T>;
private listFactory: ListFactory<T>;
constructor(public isHead: boolean, public data: T) {
this.listFactory = new ListFactory<T>();
}
public add(data: T): Lis... | {
"end_byte": 3928,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericClassWithStaticFactory.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.ts_3_46 | @sourcemap: true
var [x = 20] = [1, 2]; | {
"end_byte": 46,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.ts"
} |
TypeScript/tests/cases/compiler/ambientStatement1.ts_4_86 | declare module M1 {
while(true);
export var v1 = () => false;
} | {
"end_byte": 86,
"start_byte": 4,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/ambientStatement1.ts"
} |
TypeScript/tests/cases/compiler/arrayAssignmentTest5.ts_0_1074 | module Test {
interface IState {
}
interface IToken {
startIndex: number;
}
interface IStateToken extends IToken {
state: IState;
}
interface ILineTokens {
tokens: IToken[];
endState: IState;
}
interface IAction {
}
interface IMode {
on... | {
"end_byte": 1074,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrayAssignmentTest5.ts"
} |
TypeScript/tests/cases/compiler/discriminantsAndNullOrUndefined.ts_0_421 | // @strictNullChecks: true
// Repro from #10228
interface A { kind: 'A'; }
interface B { kind: 'B'; }
type C = A | B | undefined;
function never(_: never): never {
throw new Error();
}
function useA(_: A): void { }
function useB(_: B): void { }
declare var c: C;
if (c !== undefined) {
switch (c.kind) {
... | {
"end_byte": 421,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/discriminantsAndNullOrUndefined.ts"
} |
TypeScript/tests/cases/compiler/unusedVariablesinForLoop4.ts_0_151 | //@noUnusedLocals:true
//@noUnusedParameters:true
function f1 () {
for (const elem of ["a", "b", "c"]) {
elem;
var x = 20;
}
} | {
"end_byte": 151,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedVariablesinForLoop4.ts"
} |
TypeScript/tests/cases/compiler/privacyImport.ts_0_3214 | //@module: commonjs
//@declaration: true
export 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 {
... | {
"end_byte": 3214,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyImport.ts"
} |
TypeScript/tests/cases/compiler/privacyImport.ts_3216_9657 | module m2 {
export module m2_M1_public {
export class c1 {
}
export function f1() {
return new c1;
}
export var v1 = c1;
export var v2: c1;
}
module m2_M2_private {
export class c1 {
}
export function f1() {
ret... | {
"end_byte": 9657,
"start_byte": 3216,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyImport.ts"
} |
TypeScript/tests/cases/compiler/privacyImport.ts_9658_12776 | // export var use_glo_M1_public_v3_public: () => use_glo_M1_public.c1;
// var use_glo_M1_public_v1_private: { new (): use_glo_M1_public.c1; };
// var use_glo_M1_public_v2_private: use_glo_M1_public;
// var use_glo_M1_public_v3_private: () => use_glo_M1_public.c1;
// import use_glo_M2_public = require("g... | {
"end_byte": 12776,
"start_byte": 9658,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyImport.ts"
} |
TypeScript/tests/cases/compiler/withStatementNestedScope.ts_0_114 | var x = 1;
with (x) {
function f(a: number) {
return 1;
}
// should be any
var r = f(1);
} | {
"end_byte": 114,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/withStatementNestedScope.ts"
} |
TypeScript/tests/cases/compiler/crossFileOverloadModifierConsistency.ts_0_465 | // @strict: true
// @module: preserve
// @noEmit: true
// @noTypesAndSymbols: true
// @Filename: node_modules/library/index.d.ts
declare function get(): string;
export { get };
// @Filename: node_modules/non-ambient/index.ts
export function real(arg?: string): any {}
// @Filename: augmentations.d.ts
export {};
dec... | {
"end_byte": 465,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/crossFileOverloadModifierConsistency.ts"
} |
TypeScript/tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts_0_495 | class A { a }
class B extends A { b }
class C<T> extends Array<T> { c }
declare var ara: A[];
declare var arb: B[];
declare var cra: C<A>;
declare var crb: C<B>;
declare var rra: ReadonlyArray<A>;
declare var rrb: ReadonlyArray<B>;
rra = ara;
rrb = arb; // OK, Array<B> is assignable to ReadonlyArray<A>
rra = arb;
rrb =... | {
"end_byte": 495,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts"
} |
TypeScript/tests/cases/compiler/declarationsIndirectGeneratedAliasReference.ts_0_521 | // @declaration: true
// @filename: node_modules/mod/ctor.d.ts
export interface Ctor {
x: number;
}
export type ExtendedCtor<T> = {x: number, ext: T};
export interface CtorConstructor {
extends<T>(x: T): ExtendedCtor<T extends unknown ? Ctor : undefined>;
}
export const Ctor: CtorConstructor;
// @filename: node... | {
"end_byte": 521,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationsIndirectGeneratedAliasReference.ts"
} |
TypeScript/tests/cases/compiler/MemberAccessorDeclaration15.ts_0_44 | class C {
set Foo(public a: number) { }
} | {
"end_byte": 44,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/MemberAccessorDeclaration15.ts"
} |
TypeScript/tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts_0_367 | export type Blah =
| { type: "foo", abc: string }
| { type: "bar", xyz: number, extra: any };
declare function thing(blah: Blah): void;
let foo1 = "foo";
thing({
type: foo1,
abc: "hello!"
});
let foo2 = "foo";
thing({
type: foo2,
abc: "hello!",
extra: 123,
});
let bar = "bar";
thing({
... | {
"end_byte": 367,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indirectDiscriminantAndExcessProperty.ts"
} |
TypeScript/tests/cases/compiler/anyDeclare.ts_0_76 | declare var x: any;
module myMod {
var myFn;
function myFn() { }
}
| {
"end_byte": 76,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/anyDeclare.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.