mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
53 lines
2.3 KiB
Plaintext
53 lines
2.3 KiB
Plaintext
elaboratedErrors.ts(11,3): error TS2416: Property 'read' in type 'WorkerFS' is not assignable to the same property in base type 'FileSystem'.
|
|
Type 'string' is not assignable to type 'number'.
|
|
elaboratedErrors.ts(11,3): error TS2564: Property 'read' has no initializer and is not definitely assigned in the constructor.
|
|
elaboratedErrors.ts(20,1): error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
|
|
elaboratedErrors.ts(21,1): error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
|
|
elaboratedErrors.ts(24,1): error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
|
|
elaboratedErrors.ts(25,1): error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
|
|
|
|
|
|
==== elaboratedErrors.ts (6 errors) ====
|
|
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;
|
|
~~~~
|
|
!!! error TS2416: Property 'read' in type 'WorkerFS' is not assignable to the same property in base type 'FileSystem'.
|
|
!!! error TS2416: Type 'string' is not assignable to type 'number'.
|
|
~~~~
|
|
!!! error TS2564: Property 'read' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
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;
|
|
~
|
|
!!! error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
|
|
!!! related TS2728 elaboratedErrors.ts:14:19: 'x' is declared here.
|
|
x = y;
|
|
~
|
|
!!! error TS2741: Property 'x' is missing in type 'Beta' but required in type 'Alpha'.
|
|
!!! related TS2728 elaboratedErrors.ts:14:19: 'x' is declared here.
|
|
|
|
// Only one of these errors should be large
|
|
y = x;
|
|
~
|
|
!!! error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
|
|
!!! related TS2728 elaboratedErrors.ts:15:18: 'y' is declared here.
|
|
y = x;
|
|
~
|
|
!!! error TS2741: Property 'y' is missing in type 'Alpha' but required in type 'Beta'.
|
|
!!! related TS2728 elaboratedErrors.ts:15:18: 'y' is declared here.
|
|
|