_id stringlengths 21 254 | text stringlengths 1 93.7k | metadata dict |
|---|---|---|
TypeScript/tests/cases/compiler/modularizeLibrary_Dom.asynciterable.ts_3_225 | @skipLibCheck: true
// @lib: es2018,dom,dom.asynciterable
// @target: es2018
navigator.storage.getDirectory().then(async directory => {
for await (const [key, handle] of directory) {
handle.kind;
}
});
| {
"end_byte": 225,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/modularizeLibrary_Dom.asynciterable.ts"
} |
TypeScript/tests/cases/compiler/pathMappingWithoutBaseUrl2.ts_0_401 | // @noTypesAndSymbols: true
// @Filename: /other/tsconfig.base.json
{
"compilerOptions": {
"paths": {
"p1": ["./lib/p1"]
}
}
}
// @Filename: /project/tsconfig.json
{
"extends": "../other/tsconfig.base.json",
"compilerOptions": {
"module": "commonjs"
}
}
// @Filename: /other/lib/p1/index.t... | {
"end_byte": 401,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/pathMappingWithoutBaseUrl2.ts"
} |
TypeScript/tests/cases/compiler/overloadOnConstNoNonSpecializedSignature.ts_0_105 | class C {
x1(a: 'hi'); // error, no non-specialized signature in overload list
x1(a: string) { }
}
| {
"end_byte": 105,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/overloadOnConstNoNonSpecializedSignature.ts"
} |
TypeScript/tests/cases/compiler/pathMappingBasedModuleResolution4_classic.ts_0_607 | // @moduleResolution: classic
// @module: amd
// @traceResolution: true
// baseUrl set via command line
// @filename: c:/root/tsconfig.json
{
"compilerOptions": {
"baseUrl": "."
}
}
// @filename: c:/root/folder1/file1.ts
import {x} from "folder2/file2"
declare function use(a: any): void;
use(x.toExpo... | {
"end_byte": 607,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/pathMappingBasedModuleResolution4_classic.ts"
} |
TypeScript/tests/cases/compiler/capturedLetConstInLoop9_ES6.ts_0_2377 | // @target: ES6
for (let x = 0; x < 1; ++x) {
let x;
(function() { return x });
{
let x;
(function() { return x });
}
try { }
catch (e) {
let x;
(function() { return x });
}
switch (x) {
case 1:
let x;
(function() { retur... | {
"end_byte": 2377,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/capturedLetConstInLoop9_ES6.ts"
} |
TypeScript/tests/cases/compiler/requireOfJsonFileWithAlwaysStrictWithoutErrors.ts_0_301 | // @module: commonjs
// @outdir: out/
// @resolveJsonModule: true
// @alwaysStrict: 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": 301,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/requireOfJsonFileWithAlwaysStrictWithoutErrors.ts"
} |
TypeScript/tests/cases/compiler/lift.ts_0_330 | class B {
constructor(public y:number) {
}
public ll:number; // to be shadowed
}
class C extends B {
constructor(y:number,z:number,w:number) {
super(y)
var x=10+w;
var ll=x*w;
}
public liftxyz () { return x+z+this.y; }
public liftxylocllz () { return x+z+this.y+thi... | {
"end_byte": 330,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/lift.ts"
} |
TypeScript/tests/cases/compiler/indexSignatureWithInitializer.ts_0_133 | // These used to be indexers, now they are computed properties
interface I {
[x = '']: string;
}
class C {
[x = 0]: string
} | {
"end_byte": 133,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexSignatureWithInitializer.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitAmdModuleNameDirective.ts_0_230 | // @declaration: true
// @module: umd
// @filename: foo.ts
/// <amd-module name="name_of_foo"/>
export const foo = 1;
// @filename: bar.ts
/// <amd-dependency name="name_of_foo" path="./foo" />
import {foo} from './foo';
void foo; | {
"end_byte": 230,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitAmdModuleNameDirective.ts"
} |
TypeScript/tests/cases/compiler/moduleDetectionIsolatedModulesCjsFileScope.ts_0_192 | // @target: esnext
// @module: esnext
// @declaration: true
// @moduleResolution: node
// @isolatedModules: true
// @filename: filename.cts
const a = 2;
// @filename: filename.mts
const a = 2; | {
"end_byte": 192,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleDetectionIsolatedModulesCjsFileScope.ts"
} |
TypeScript/tests/cases/compiler/dtsEmitTripleSlashAvoidUnnecessaryResolutionMode.ts_0_648 | // @Filename: /tsconfig.json
{
"compilerOptions": {
"module": "nodenext",
"types": [],
"declaration": true,
"emitDeclarationOnly": true,
}
}
// @Filename: /node_modules/@types/node/package.json
{
"name": "@types/node",
"version": "1.0.0",
"types": "index.d.ts"
}
// @Filename: /node_modules/@... | {
"end_byte": 648,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/dtsEmitTripleSlashAvoidUnnecessaryResolutionMode.ts"
} |
TypeScript/tests/cases/compiler/newLineFlagWithCRLF.ts_0_33 | // @newline: CRLF
var x=1;
x=2;
| {
"end_byte": 33,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/newLineFlagWithCRLF.ts"
} |
TypeScript/tests/cases/compiler/es6ModuleVariableStatement.ts_0_358 | // @target: ES6
export var a = "hello";
export var x: string = a, y = x;
var b = y;
var c: string = b, d = c;
export module m1 {
export var k = a;
export var l: string = b, m = k;
var n = m1.k;
var o: string = n, p = k;
}
module m2 {
export var k = a;
export var l: string = b, m = k;
var n =... | {
"end_byte": 358,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ModuleVariableStatement.ts"
} |
TypeScript/tests/cases/compiler/genericTypeParameterEquivalence2.ts_0_1422 | // compose :: (b->c) -> (a->b) -> (a->c)
function compose<A, B, C>(f: (b: B) => C, g: (a:A) => B): (a:A) => C {
return function (a:A) : C {
return f(g.apply(null, a));
};
}
// forEach :: [a] -> (a -> ()) -> ()
function forEach<A>(list: A[], f: (a: A, n?: number) => void ): void {
for (var i = 0; i ... | {
"end_byte": 1422,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/genericTypeParameterEquivalence2.ts"
} |
TypeScript/tests/cases/compiler/contextualTyping29.ts_0_44 | function foo(param:number[]){}; foo([1, 3]); | {
"end_byte": 44,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTyping29.ts"
} |
TypeScript/tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts_0_186 | class a {
get x() {
return "20";
}
set x(aValue: string) {
}
}
class b extends a {
get x() {
return "20";
}
set x(aValue: string) {
}
} | {
"end_byte": 186,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inheritanceMemberAccessorOverridingAccessor.ts"
} |
TypeScript/tests/cases/compiler/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.ts_0_265 | // @Filename: test.d.ts
declare class Something
{
private static someStaticVar;
private someVar;
private get getter();
private set setter(v);
}
// @noimplicitany: true
// @Filename:app.ts
/// <reference path="test.d.ts" />
var x = new Something();
| {
"end_byte": 265,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noImplicitAnyAndPrivateMembersWithoutTypeAnnotations.ts"
} |
TypeScript/tests/cases/compiler/strictBooleanMemberAssignability.ts_0_97 | // @strict: true
class Abc {
def: boolean
constructor() {
this.def = true
}
} | {
"end_byte": 97,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/strictBooleanMemberAssignability.ts"
} |
TypeScript/tests/cases/compiler/commonMissingSemicolons.ts_0_1403 | // @noEmit: true
// @noTypesAndSymbols: true
async function myAsyncFunction1() {}
asynd function myAsyncFunction2() {}
sasync function myAsyncFunction3() {}
// Arrow functions don't (yet?) parse as nicely as standalone functions.
// Eventually it would be good to get them the same "did you mean" for typos such as "as... | {
"end_byte": 1403,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commonMissingSemicolons.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitClassSetAccessorParamNameInJs2.ts_0_210 | // @declaration: true
// @emitDeclarationOnly: true
// @allowJs: true
// @filename: foo.js
export class Foo {
/**
* Bar.
*
* @param {{ prop: string }} baz Baz.
*/
set bar({}) {}
}
| {
"end_byte": 210,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitClassSetAccessorParamNameInJs2.ts"
} |
TypeScript/tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile3.ts_3_131 | @module: none
// @filename: 0.d.ts
export = a;
declare var a: number;
// @filename: 1.ts
export var j = "hello"; // error
| {
"end_byte": 131,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/noErrorUsingImportExportModuleAugmentationInDeclarationFile3.ts"
} |
TypeScript/tests/cases/compiler/duplicateIdentifierRelatedSpans4.ts_0_557 | // @pretty: true
// @filename: file1.ts
interface TopLevel {
duplicate1: () => string;
duplicate2: () => string;
duplicate3: () => string;
duplicate4: () => string;
duplicate5: () => string;
duplicate6: () => string;
duplicate7: () => string;
duplicate8: () => string;
}
// @filename: fil... | {
"end_byte": 557,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateIdentifierRelatedSpans4.ts"
} |
TypeScript/tests/cases/compiler/internalAliasUninitializedModule.ts_0_190 | // @declaration: true
module a {
export module b {
export interface I {
foo();
}
}
}
module c {
import b = a.b;
export var x: b.I;
x.foo();
} | {
"end_byte": 190,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasUninitializedModule.ts"
} |
TypeScript/tests/cases/compiler/structuralTypeInDeclareFileForModule.ts_0_60 | // @declaration: true
module M { export var x; }
var m = M; | {
"end_byte": 60,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/structuralTypeInDeclareFileForModule.ts"
} |
TypeScript/tests/cases/compiler/didYouMeanStringLiteral.ts_0_245 | type T1 = "string" | "number" | "boolean";
type T2 = T1 & ("number" | "boolean"); // "number" | "boolean"
type T3 = T1 & ("string" | "boolean"); // "string" | "boolean"
const t1: T1 = "strong";
const t2: T2 = "strong";
const t3: T3 = "strong";
| {
"end_byte": 245,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/didYouMeanStringLiteral.ts"
} |
TypeScript/tests/cases/compiler/discriminateObjectTypesOnly.ts_0_403 | // @strict: true
type Thing = number | object;
const k: Thing = { toFixed: null }; // OK, satisfies object
type Thing2 = number | { toFixed: null } | object;
const q: Thing2 = { toFixed: null };
const h: Thing2 = { toString: null }; // OK, satisfies object
type Thing3 = number | { toFixed: null, toString: undefined }... | {
"end_byte": 403,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/discriminateObjectTypesOnly.ts"
} |
TypeScript/tests/cases/compiler/downlevelLetConst2.ts_0_7 | const a | {
"end_byte": 7,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/downlevelLetConst2.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts_0_788 | // @lib: es5
// @sourcemap: true
declare var console: {
log(msg: any): void;
}
type Robot = [number, string, string];
var robotA: Robot = [1, "mower", "mowing"];
function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) {
console.log(nameA);
}
function foo2([numberB = -1]: Robot = [-1, "name", "skill... | {
"end_byte": 788,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts"
} |
TypeScript/tests/cases/compiler/conditionalExpression1.ts_0_55 | var x: boolean = (true ? 1 : ""); // should be an error | {
"end_byte": 55,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/conditionalExpression1.ts"
} |
TypeScript/tests/cases/compiler/forwardRefInTypeDeclaration.ts_0_689 | // @strict: true,false
// forward ref ignored in a typeof
declare let s: typeof s1;
const s1 = "x";
// ignored anywhere in an interface (#35947)
interface Foo2 { [s2]: number; }
const s2 = "x";
// or in a type definition
type Foo3 = { [s3]: number; }
const s3 = "x";
// or in a type literal
declare const foo4: { [s4... | {
"end_byte": 689,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/forwardRefInTypeDeclaration.ts"
} |
TypeScript/tests/cases/compiler/moduleNoEmit.ts_0_20 | module Foo {
1+1;
} | {
"end_byte": 20,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleNoEmit.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitJsReExportDefault.ts_0_392 | // @noTypesAndSymbols: true
// @filename: /node_modules/a/package.json
{"name": "a", "version": "0.0.0"}
// @filename: /node_modules/a/index.d.ts
export const a = 123;
// @filename: /tsconfig.json
{
"compilerOptions": {
"module": "node16",
"declaration": true,
"emitDeclarationOnly": true,
"checkJs":... | {
"end_byte": 392,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitJsReExportDefault.ts"
} |
TypeScript/tests/cases/compiler/indexerAssignability.ts_0_119 | var a: { [s: string]: string; };
var b: { [n: number]: string; };
var c: {};
a = b;
a = c;
b = a;
b = c;
c = a;
c = b; | {
"end_byte": 119,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexerAssignability.ts"
} |
TypeScript/tests/cases/compiler/contextualTypingWithGenericSignature.ts_3_473 | If e is a FunctionExpression or ArrowFunctionExpression with no type parameters and no parameter or return type annotations, and T is a function type with EXACTLY ONE non - generic call signature, then any inferences made for type parameters referenced by the parameters of T’s call signature are fixed(section 4.12.2) ... | {
"end_byte": 473,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualTypingWithGenericSignature.ts"
} |
TypeScript/tests/cases/compiler/moduleAugmentationImportsAndExports6.ts_0_631 | // @module: commonjs
// @declaration: true
// @filename: f1.ts
export class A {}
// @filename: f2.ts
export class B {
n: number;
}
// @filename: f3.ts
import {A} from "./f1";
import {B} from "./f2";
A.prototype.foo = function () { return undefined; }
export namespace N {
export interface Ifc { a: number; }... | {
"end_byte": 631,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/moduleAugmentationImportsAndExports6.ts"
} |
TypeScript/tests/cases/compiler/staticMethodWithTypeParameterExtendsClauseDeclFile.ts_0_682 | // @module: commonjs
// @declaration: true
class privateClass {
}
export class publicClass {
}
export class publicClassWithWithPrivateTypeParameters {
private static myPrivateStaticMethod1<T extends privateClass>() { // do not emit extends clause
}
private myPrivateMethod1<T extends privateClass>() { // d... | {
"end_byte": 682,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/staticMethodWithTypeParameterExtendsClauseDeclFile.ts"
} |
TypeScript/tests/cases/compiler/declFileConstructors.ts_0_2166 | // @target: ES5
// @declaration: true
// @removeComments: false
// @module: commonjs
// @Filename: declFileConstructors_0.ts
export class SimpleConstructor {
/** This comment should appear for foo*/
constructor() {
}
}
export class ConstructorWithParameters {
/** This is comment for function signature*... | {
"end_byte": 2166,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declFileConstructors.ts"
} |
TypeScript/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts_0_204 | // @allowJs: true
// @outFile: out.js
// @declaration: true
// @filename: a.ts
var x = 10;
// @filename: b.js
var x = "hello"; // Error is recorded here, but suppressed because the js file isn't checked
| {
"end_byte": 204,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationDuplicateVariable.ts"
} |
TypeScript/tests/cases/compiler/privacyCheckOnTypeParameterReferenceInConstructorParameter.ts_0_204 | //@module: amd
//@declaration: true
export class A<T1>{
constructor(callback: (self: A<T1>) => void) {
var child = new B(this);
}
}
export class B<T2> {
constructor(parent: T2) { }
}
| {
"end_byte": 204,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/privacyCheckOnTypeParameterReferenceInConstructorParameter.ts"
} |
TypeScript/tests/cases/compiler/duplicateIdentifiersAcrossFileBoundaries.ts_0_714 | // @declaration: true
// @Filename: file1.ts
interface I { }
class C1 { }
class C2 { }
function f() { }
var v = 3;
class Foo {
static x: number;
}
module N {
export module F {
var t;
}
}
// @Filename: file2.ts
class I { } // error -- cannot merge interface with non-ambient class
interface C1 { }... | {
"end_byte": 714,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateIdentifiersAcrossFileBoundaries.ts"
} |
TypeScript/tests/cases/compiler/es5-umd2.ts_0_175 | // @target: ES5
// @sourcemap: false
// @declaration: false
// @module: umd
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
| {
"end_byte": 175,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es5-umd2.ts"
} |
TypeScript/tests/cases/compiler/shorthand-property-es6-amd.ts_0_146 | // @target: ES6
// @module: amd
// @declaration: true
// @filename: test.ts
import {foo} from './foo';
const baz = 42;
const bar = { foo, baz };
| {
"end_byte": 146,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/shorthand-property-es6-amd.ts"
} |
TypeScript/tests/cases/compiler/commentsTypeParameters.ts_0_520 | // @declaration: true
// @removeComments: false
class C</**docComment for type parameter*/ T> {
method</**docComment of method type parameter */ U extends T>(a: U) {
}
static staticmethod</**docComment of method type parameter */ U>(a: U) {
}
private privatemethod</**docComment of method type param... | {
"end_byte": 520,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/commentsTypeParameters.ts"
} |
TypeScript/tests/cases/compiler/sourceMapValidationLabeled.ts_0_63 | // @allowUnusedLabels: true
// @sourcemap: true
x:
var b = 10; | {
"end_byte": 63,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMapValidationLabeled.ts"
} |
TypeScript/tests/cases/compiler/nestedBlockScopedBindings7.ts_0_72 | for (let x; false;) {
() => x;
}
for (let y; false;) {
y = 1;
} | {
"end_byte": 72,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nestedBlockScopedBindings7.ts"
} |
TypeScript/tests/cases/compiler/contextualSigInstantiationRestParams.ts_0_151 | declare function toInstantiate<A, B>(a?: A, b?: B): B;
declare function contextual(...s: string[]): string
var sig: typeof contextual = toInstantiate; | {
"end_byte": 151,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextualSigInstantiationRestParams.ts"
} |
TypeScript/tests/cases/compiler/anonymousClassExpression1.ts_0_59 | function f() {
return typeof class {} === "function";
} | {
"end_byte": 59,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/anonymousClassExpression1.ts"
} |
TypeScript/tests/cases/compiler/contextuallyTypingRestParameters.ts_0_248 | var x: (...y: string[]) => void = function (.../*3*/y) {
var t = y;
var x2: string = t; // This should be error
var x3: string[] = t; // No error
var y2: string = y; // This should be error
var y3: string[] = y; // No error
}; | {
"end_byte": 248,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/contextuallyTypingRestParameters.ts"
} |
TypeScript/tests/cases/compiler/truthinessCallExpressionCoercion.ts_0_1665 | // @strictNullChecks:true
function onlyErrorsWhenTestingNonNullableFunctionType(required: () => boolean, optional?: () => boolean) {
if (required) { // error
}
if (optional) { // ok
}
if (!!required) { // ok
}
if (required()) { // ok
}
}
function onlyErrorsWhenUnusedInBody() {
f... | {
"end_byte": 1665,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/truthinessCallExpressionCoercion.ts"
} |
TypeScript/tests/cases/compiler/useBeforeDefinitionInDeclarationFiles.ts_0_344 | // @filename: declaration.d.ts
export declare class ClassWithSymbols {
public readonly [Namespace.locallyExportedCustomSymbol]: string;
public [Namespace.fullyExportedCustomSymbol](): void;
}
export namespace Namespace {
export const locallyExportedCustomSymbol: unique symbol;
export const fullyExportedCustomS... | {
"end_byte": 344,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/useBeforeDefinitionInDeclarationFiles.ts"
} |
TypeScript/tests/cases/compiler/exportDefaultAlias_excludesEverything.ts_0_63 | export default interface A {}
interface B {}
export default B;
| {
"end_byte": 63,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/exportDefaultAlias_excludesEverything.ts"
} |
TypeScript/tests/cases/compiler/awaitedTypeJQuery.ts_0_5527 | /// <reference lib="dom" />
interface Thenable<T> extends PromiseLike<T> { }
// JQuery's Promise type
interface PromiseBase<TR, TJ, TN,
UR, UJ, UN,
VR, VJ, VN,
SR, SJ, SN> {
then<ARD = never, AJD = never, AND = never,
BRD = never, BJD = never, BND = never,
CRD = never, CJD = never, CND... | {
"end_byte": 5527,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/awaitedTypeJQuery.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitUsingTypeAlias2.ts_0_1844 | // @strict: true
// @declaration: true
// @module: nodenext
// @filename: node_modules/some-dep/dist/inner.d.ts
export declare type Other = { other: string };
export declare type SomeType = { arg: Other };
// @filename: node_modules/some-dep/dist/other.d.ts
export declare const shouldLookupName: unique symbol;
export... | {
"end_byte": 1844,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitUsingTypeAlias2.ts"
} |
TypeScript/tests/cases/compiler/definiteAssignmentWithErrorStillStripped.ts_0_72 | // @target: esnext
// @useDefineForClassFields: true
class C {
p!;
} | {
"end_byte": 72,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/definiteAssignmentWithErrorStillStripped.ts"
} |
TypeScript/tests/cases/compiler/constructorAsType.ts_0_133 | var Person:new () => {name: string;} = function () {return {name:"joe"};};
var Person2:{new() : {name:string;};};
Person = Person2; | {
"end_byte": 133,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/constructorAsType.ts"
} |
TypeScript/tests/cases/compiler/allowSyntheticDefaultImports9.ts_0_207 | // @allowSyntheticDefaultImports: true
// @module: commonjs
// @Filename: b.d.ts
export function foo();
export function bar();
// @Filename: a.ts
import { default as Foo } from "./b";
Foo.bar();
Foo.foo(); | {
"end_byte": 207,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/allowSyntheticDefaultImports9.ts"
} |
TypeScript/tests/cases/compiler/detachedCommentAtStartOfLambdaFunction1.ts_0_298 | class TestFile {
name: string;
foo(message: string): () => string {
return (...x: string[]) =>
/// <summary>Test summary</summary>
/// <param name="message" type="String" />
/// <returns type="Function" />
message + this.name;
}
} | {
"end_byte": 298,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/detachedCommentAtStartOfLambdaFunction1.ts"
} |
TypeScript/tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithoutExport.ts_0_192 | //@module: amd
// @declaration: true
export module a {
export enum weekend {
Friday,
Saturday,
Sunday
}
}
import b = a.weekend;
export var bVal: b = b.Sunday;
| {
"end_byte": 192,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithoutExport.ts"
} |
TypeScript/tests/cases/compiler/es6ImportDefaultBindingDts.ts_0_310 | // @module: commonjs
// @declaration: true
// @target: ES5
// @filename: server.ts
class c { }
export default c;
// @filename: client.ts
import defaultBinding from "./server";
export var x = new defaultBinding();
import defaultBinding2 from "./server"; // elide this import since defaultBinding2 is not used
| {
"end_byte": 310,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ImportDefaultBindingDts.ts"
} |
TypeScript/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts_1_153 | class A<T1, T2> {
constructor(private map: (value: T1) => T2) {
}
}
class B extends A {
constructor() { super(value => String(value)); }
} | {
"end_byte": 153,
"start_byte": 1,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts"
} |
TypeScript/tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts_0_50 | function foo(a = ``) { }
function bar(a = ``) {
} | {
"end_byte": 50,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/functionWithDefaultParameterWithNoStatements4.ts"
} |
TypeScript/tests/cases/compiler/jsxIntrinsicElementsExtendsRecord.tsx_0_138 | // @jsx: preserve
// @filename: index.tsx
declare namespace JSX {
interface IntrinsicElements extends Record<string, any> {}
}
<a />;
| {
"end_byte": 138,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsxIntrinsicElementsExtendsRecord.tsx"
} |
TypeScript/tests/cases/compiler/declFileImportedTypeUseInTypeArgPosition.ts_0_179 | // @declaration: true
class List<T> { }
declare module 'mod1' {
class Foo {
}
}
declare module 'moo' {
import x = require('mod1');
export var p: List<x.Foo>;
}
| {
"end_byte": 179,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declFileImportedTypeUseInTypeArgPosition.ts"
} |
TypeScript/tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts_0_47 | class C {
public f() { };
private m;
}
| {
"end_byte": 47,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts"
} |
TypeScript/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts_0_167 | // @allowJs: true
// @outFile: out.js
// @declaration: true
// @filename: b.js
function foo() {
return 10;
}
// @filename: a.ts
function foo() {
return 30;
}
| {
"end_byte": 167,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts"
} |
TypeScript/tests/cases/compiler/stringTrim.ts_0_162 | // @target: es2019
var trimmed: string;
trimmed = "abcde".trimEnd();
trimmed = "abcde".trimStart();
trimmed = "abcde".trimLeft();
trimmed = "abcde".trimRight();
| {
"end_byte": 162,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/stringTrim.ts"
} |
TypeScript/tests/cases/compiler/capturedLetConstInLoop2.ts_2_3396 | // ========let
function foo0(x) {
for (let x of []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
function foo0_1(x) {
for (let x in []) {
let a = arguments.length;
(function() { return x + a });
(() => x + a);
}
}
functio... | {
"end_byte": 3396,
"start_byte": 2,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/capturedLetConstInLoop2.ts"
} |
TypeScript/tests/cases/compiler/transitiveTypeArgumentInference1.ts_0_148 | interface I1<T, U> {
m(value: T): U;
}
var i: I1<boolean, string> = null;
class C<T> {
constructor(p: I1<boolean, T>) {
}
}
var c = new C(i);
| {
"end_byte": 148,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/transitiveTypeArgumentInference1.ts"
} |
TypeScript/tests/cases/compiler/interfaceWithImplements1.ts_0_54 | interface IFoo { }
interface IBar implements IFoo {
} | {
"end_byte": 54,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/interfaceWithImplements1.ts"
} |
TypeScript/tests/cases/compiler/importUsedAsTypeWithErrors.ts_0_127 | // @filename: test.ts
export interface T {
value: string
}
// @filename: main.ts
export const a: import("./test") = null;
| {
"end_byte": 127,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/importUsedAsTypeWithErrors.ts"
} |
TypeScript/tests/cases/compiler/sourceMap-FileWithComments.ts_0_710 | // @sourcemap: true
// @removeComments: false
// Interface
interface IPoint {
getDist(): number;
}
// Module
module Shapes {
// Class
export class Point implements IPoint {
// Constructor
constructor(public x: number, public y: number) { }
// Instance member
getDist() { r... | {
"end_byte": 710,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/sourceMap-FileWithComments.ts"
} |
TypeScript/tests/cases/compiler/unusedInterfaceinNamespace2.ts_0_135 | //@noUnusedLocals:true
//@noUnusedParameters:true
namespace Validation {
interface i1 {
}
export interface i2 {
}
} | {
"end_byte": 135,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedInterfaceinNamespace2.ts"
} |
TypeScript/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx_0_600 | // @jsx: react
/// <reference path="/.lib/react16.d.ts" />
import * as React from 'react';
declare const Radio: (props: {}) => React.ReactElement<{}>;
declare const OtherRadio: () => React.ReactElement<{}>;
declare const Checkbox: React.SFC;
declare const condition1: boolean;
declare const condition2: boolean;
decla... | {
"end_byte": 600,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx"
} |
TypeScript/tests/cases/compiler/typeParameterDiamond1.ts_0_335 | function diamondTop<Top>() {
function diamondMiddle<T extends Top, U extends Top>() {
function diamondBottom<Bottom extends T | U>() {
var top: Top;
var middle: T | U;
var bottom: Bottom;
top = middle;
middle = bottom;
top = bottom;
... | {
"end_byte": 335,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeParameterDiamond1.ts"
} |
TypeScript/tests/cases/compiler/inferConditionalConstraintMappedMember.ts_0_670 | // Return keyof type without string index signature
type KeysWithoutStringIndex<T> =
{ [K in keyof T]: string extends K ? never : K } extends { [_ in keyof T]: infer U }
? U
: never
// Only "foo" | "bar" as expected, [string] index signature removed
type test = KeysWithoutStringIndex<{ [index: string]: str... | {
"end_byte": 670,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/inferConditionalConstraintMappedMember.ts"
} |
TypeScript/tests/cases/compiler/outModuleConcatCommonjs.ts_0_246 | // @target: ES5
// @sourcemap: true
// @declaration: true
// @module: commonjs
// @outFile: all.js
// This should be an error
// @Filename: ref/a.ts
export class A { }
// @Filename: b.ts
import {A} from "./ref/a";
export class B extends A { }
| {
"end_byte": 246,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/outModuleConcatCommonjs.ts"
} |
TypeScript/tests/cases/compiler/indexIntoArraySubclass.ts_0_100 | interface Foo2<T> extends Array<T> { }
var x2: Foo2<string>;
var r = x2[0]; // string
r = 0; //error | {
"end_byte": 100,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/indexIntoArraySubclass.ts"
} |
TypeScript/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts_0_425 | // @module: nodenext
// @outDir: /pkg/dist
// @declarationDir: /pkg/types
// @declaration: true
// @rootDir: /pkg/src
// @filename: /pkg/package.json
{
"name": "@this/package",
"type": "module",
"exports": {
".": {
"default": "./dist/index.js",
"types": "./types/index.d.ts"
}
}
}
// @filenam... | {
"end_byte": 425,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts"
} |
TypeScript/tests/cases/compiler/es5-asyncFunctionReturnStatements.ts_0_529 | // @lib: es5,es2015.promise
// @noEmitHelpers: true
// @target: ES5
declare var x, y, z, a, b, c;
async function returnStatement0(): Promise<any> {
return;
}
async function returnStatement1(): Promise<any> {
return x;
}
async function returnStatement2(): Promise<any> {
return await x;
}
async function r... | {
"end_byte": 529,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es5-asyncFunctionReturnStatements.ts"
} |
TypeScript/tests/cases/compiler/augmentedTypesEnum3.ts_0_149 | module E {
var t;
}
enum E { }
enum F { }
module F { var t; }
module A {
var o;
}
enum A {
b
}
enum A {
c
}
module A {
var p;
} | {
"end_byte": 149,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/augmentedTypesEnum3.ts"
} |
TypeScript/tests/cases/compiler/emptyOptionalBindingPatternInDeclarationSignature.ts_0_829 | // @strict: true
// @noEmit: true
// #50791
declare function fn1({}?: { x: string }): void;
declare function fn2({ x }?: { x: string }): void;
declare function fn3([]?: [ x: string ]): void;
declare function fn4([ x ]?: [ x: string ]): void;
declare class C1 {
method({}?: { x: string }): void
static method2(... | {
"end_byte": 829,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/emptyOptionalBindingPatternInDeclarationSignature.ts"
} |
TypeScript/tests/cases/compiler/es6ExportDefaultClassDeclaration2.ts_0_81 | // @target: es6
// @declaration: true
export default class {
method() { }
}
| {
"end_byte": 81,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/es6ExportDefaultClassDeclaration2.ts"
} |
TypeScript/tests/cases/compiler/unusedImports5.ts_0_303 | //@noUnusedLocals:true
//@noUnusedParameters:true
// @Filename: file1.ts
export class Calculator {
handleChar() {}
}
export function test() {
}
export function test2() {
}
// @Filename: file2.ts
import {Calculator, test, test2} from "./file1"
var x = new Calculator();
x.handleChar();
test(); | {
"end_byte": 303,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/unusedImports5.ts"
} |
TypeScript/tests/cases/compiler/abstractPropertyBasics.ts_0_517 | //@target: ES5
interface A {
prop: string;
raw: string;
m(): void;
}
abstract class B implements A {
abstract prop: string;
abstract raw: string;
abstract readonly ro: string;
abstract get readonlyProp(): string;
abstract set readonlyProp(val: string);
abstract m(): void;
}
class C e... | {
"end_byte": 517,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/abstractPropertyBasics.ts"
} |
TypeScript/tests/cases/compiler/classHeritageWithTrailingSeparator.ts_0_46 | class C { foo: number }
class D extends C, {
} | {
"end_byte": 46,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/classHeritageWithTrailingSeparator.ts"
} |
TypeScript/tests/cases/compiler/literalWideningWithCompoundLikeAssignments.ts_0_684 | // @strict: true
// @noEmit: true
// repro from #13865
const empty: "" = "";
let foo = empty;
foo = foo + "bar"
foo // string
declare const numLiteral: 0;
let t1 = numLiteral;
t1 = t1 + 42
t1 // number
let t2 = numLiteral;
t2 = t2 - 42
t2 // number
let t3 = numLiteral;
t3 = t3 * 42
t3 // number
let t4 = numLiter... | {
"end_byte": 684,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/literalWideningWithCompoundLikeAssignments.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts_3_322 | @declaration: true
class C1 {
constructor(public [x, y, z]: string[]) {
}
}
type TupleType1 =[string, number, boolean];
class C2 {
constructor(public [x, y, z]: TupleType1) {
}
}
type ObjType1 = { x: number; y: string; z: boolean }
class C3 {
constructor(public { x, y, z }: ObjType1) {
}
} | {
"end_byte": 322,
"start_byte": 3,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitDestructuringParameterProperties.ts"
} |
TypeScript/tests/cases/compiler/staticModifierAlreadySeen.ts_0_73 | class C {
static static foo = 1;
public static static bar() { }
} | {
"end_byte": 73,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/staticModifierAlreadySeen.ts"
} |
TypeScript/tests/cases/compiler/duplicateTypeParameters1.ts_0_23 | function A<X, X>() { }
| {
"end_byte": 23,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateTypeParameters1.ts"
} |
TypeScript/tests/cases/compiler/destructuringAssignmentWithDefault.ts_0_838 | // @strictNullChecks: true
const a: { x?: number } = { };
let x = 0;
({x = 1} = a);
// Repro from #26235
function f1(options?: { color?: string, width?: number }) {
let { color, width } = options || {};
({ color, width } = options || {});
let x1 = (options || {}).color;
let x2 = (options || {})["color... | {
"end_byte": 838,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/destructuringAssignmentWithDefault.ts"
} |
TypeScript/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty9.ts_0_278 | // @noUnusedLocals: true
// @strict: true
// @target: esnext
class C1 {
private a = "a"; // ok
private b = "b"; // ok
private c = "c"; // error unused prop
private d = "d"; // error unused prop
getValue(key: "a" | "b") {
return this[key];
}
}
| {
"end_byte": 278,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/typeGuardNarrowsIndexedAccessOfKnownProperty9.ts"
} |
TypeScript/tests/cases/compiler/reexportedMissingAlias.ts_0_255 | // Fixes #15094
// @Filename: second.d.ts
export import Component = CompletelyMissing;
// @Filename: first.d.ts
import * as Second from './second';
export = Second;
// @Filename: crash.ts
import { Component } from './first';
class C extends Component { }
| {
"end_byte": 255,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/reexportedMissingAlias.ts"
} |
TypeScript/tests/cases/compiler/duplicateLocalVariable1.ts_0_1837 | // @allowUnreachableCode: true
// @module: commonjs
//import FileManager = require('filemanager');
//import App = require('app');
declare var FileManager: any;
declare var App: any;
var TestFileDir = ".\\TempTestFiles";
export class TestCase {
constructor (public name: string, public test: ()=>boolean, public e... | {
"end_byte": 1837,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateLocalVariable1.ts"
} |
TypeScript/tests/cases/compiler/duplicateLocalVariable1.ts_1839_9673 | export var tests: TestRunner = (function () {
var testRunner = new TestRunner();
// First 3 are for simple harness validation
testRunner.addTest(new TestCase("Basic test", function () { return true; }));
testRunner.addTest(new TestCase("Test for any error", function () { throw new Error(); return false;... | {
"end_byte": 9673,
"start_byte": 1839,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateLocalVariable1.ts"
} |
TypeScript/tests/cases/compiler/duplicateLocalVariable1.ts_9678_14467 | testRunner.addTest(new TestCase("Read non-BMP utf16 chars",
function () {
var savedFile = new FileManager.FileBuffer(TestFileDir + "\\utf16leNonBmp.txt");
if (savedFile.encoding !== 'utf16le') {
throw Error("Incorrect encoding");
}
var codePoints ... | {
"end_byte": 14467,
"start_byte": 9678,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/duplicateLocalVariable1.ts"
} |
TypeScript/tests/cases/compiler/thisInOuterClassBody.ts_0_302 | class Foo {
x = this;
static y = this;
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
var p = this.y;
return this;
}
static bar2() {
var a = this.y;
var b = this.x;
}
} | {
"end_byte": 302,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/thisInOuterClassBody.ts"
} |
TypeScript/tests/cases/compiler/declarationEmitTypeParameterNameShadowedInternally.ts_0_145 | // @declaration: true
// @skipLibCheck: false
export const foo = <T,>(x: T) => {
const inner = <T,>(y: T) => [x, y] as const;
return inner;
}
| {
"end_byte": 145,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/declarationEmitTypeParameterNameShadowedInternally.ts"
} |
TypeScript/tests/cases/compiler/evolvingArrayTypeInAssert.ts_0_190 | // @strict: true
export function unsafeCast<T>(_value: unknown): asserts _value is T { }
function yadda() {
let out = [];
out.push(100)
unsafeCast<any>(out);
return out;
}
| {
"end_byte": 190,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/evolvingArrayTypeInAssert.ts"
} |
TypeScript/tests/cases/compiler/infinitelyExpandingTypesNonGenericBase.ts_0_290 | class Functionality<V> {
property: Options<V>;
}
class Base {
}
class A<T> extends Base {
options: Options<Functionality<T>[]>;
}
interface OptionsBase<T> {
Options: Options<T>;
}
interface Options<T> extends OptionsBase<T> {
}
function o(type: new () => Base) {
}
o(A);
| {
"end_byte": 290,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/infinitelyExpandingTypesNonGenericBase.ts"
} |
TypeScript/tests/cases/compiler/reverseMappedIntersectionInference2.ts_0_686 | // @strict: true
// @noEmit: true
type Results<T> = {
[K in keyof T]: {
data: T[K];
onSuccess: (data: T[K]) => void;
};
};
type Errors<E> = {
[K in keyof E]: {
error: E[K];
onError: (data: E[K]) => void;
};
};
declare function withTupleLike<T extends { 0: unknown }, E extends { 0: unknown }>(... | {
"end_byte": 686,
"start_byte": 0,
"url": "https://github.com/microsoft/TypeScript/blob/main/tests/cases/compiler/reverseMappedIntersectionInference2.ts"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.