mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
32 lines
939 B
Plaintext
32 lines
939 B
Plaintext
index.ts(10,6): error TS2741: Property 'foo' is missing in type '{ foob: string; }' but required in type 'IFoo'.
|
|
index.ts(12,6): error TS2741: Property 'foo' is missing in type '{ foob: string; }' but required in type 'IFoo'.
|
|
|
|
|
|
==== items.ts (0 errors) ====
|
|
export default {
|
|
foob: "a"
|
|
}
|
|
|
|
export const q = {
|
|
foob: "b"
|
|
}
|
|
==== index.ts (2 errors) ====
|
|
import B, {q} from "./items";
|
|
|
|
interface IFoo {
|
|
foo: string;
|
|
}
|
|
|
|
function nFoo(x: IFoo) {}
|
|
|
|
|
|
nFoo(q); // for comparison
|
|
~
|
|
!!! error TS2741: Property 'foo' is missing in type '{ foob: string; }' but required in type 'IFoo'.
|
|
!!! related TS2728 index.ts:4:5: 'foo' is declared here.
|
|
|
|
nFoo(B);
|
|
~
|
|
!!! error TS2741: Property 'foo' is missing in type '{ foob: string; }' but required in type 'IFoo'.
|
|
!!! related TS2728 index.ts:4:5: 'foo' is declared here.
|
|
|