mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
828 B
TypeScript
43 lines
828 B
TypeScript
//// [tests/cases/compiler/elaboratedErrors.ts] ////
|
|
|
|
//// [elaboratedErrors.ts]
|
|
interface FileSystem {
|
|
read: number;
|
|
}
|
|
|
|
function fn(s: WorkerFS): void;
|
|
function fn(s: FileSystem): void;
|
|
function fn(s: FileSystem|WorkerFS) { }
|
|
|
|
// This should issue a large error, not a small one
|
|
class WorkerFS implements FileSystem {
|
|
read: string;
|
|
}
|
|
|
|
interface Alpha { x: string; }
|
|
interface Beta { y: number; }
|
|
declare var x: Alpha;
|
|
declare var y: Beta;
|
|
|
|
// Only one of these errors should be large
|
|
x = y;
|
|
x = y;
|
|
|
|
// Only one of these errors should be large
|
|
y = x;
|
|
y = x;
|
|
|
|
|
|
//// [elaboratedErrors.js]
|
|
"use strict";
|
|
function fn(s) { }
|
|
// This should issue a large error, not a small one
|
|
class WorkerFS {
|
|
}
|
|
// Only one of these errors should be large
|
|
x = y;
|
|
x = y;
|
|
// Only one of these errors should be large
|
|
y = x;
|
|
y = x;
|