mirror of
https://github.com/gnu4cn/ts-learnings.git
synced 2024-12-26 12:50:31 +08:00
Test.
This commit is contained in:
parent
55c1b7836d
commit
640011cbb8
@ -120,8 +120,8 @@ x = y; // 没有问题
|
||||
|
||||
// TSError: ⨯ Unable to compile TypeScript
|
||||
// src/main.ts (6,1): Type '() => { name: string; }' is not assignable to type '() => { name: string; location: string; }'.
|
||||
// Type '{ name: string; }' is not assignable to type '{ name: string; location: string; }'.
|
||||
// Property 'location' is missing in type '{ name: string; }'. (2322)
|
||||
// Type '{ name: string; }' is not assignable to type '{ name: string; location: string; }'.
|
||||
// Property 'location' is missing in type '{ name: string; }'. (2322)
|
||||
y = x; // 错误,因为`x`缺少一个location属性
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user