@@ -272,14 +272,14 @@ function foo(x: [first: string, second: number]) {
272
272
273
273
๋ ์๊ณ ์ถ์ผ์๋ฉด, ๋ผ๋ฒจ๋ง๋ ํํ ์์์ ๋ํ [ ํ ๋ฆฌํ์คํธ] ( https://github.com/microsoft/TypeScript/pull/38234 ) ๋ฅผ ํ์ธํด๋ณด์ธ์
274
274
275
- ## Class Property Inference from Constructors
275
+ ## ์์ฑ์๋ก๋ถํฐ ํด๋์ค ํ๋กํผํฐ ํ์
์ถ๋ก ํ๊ธฐ ( Class Property Inference from Constructors)
276
276
277
- TypeScript 4.0 can now use control flow analysis to determine the types of properties in classes when ` noImplicitAny ` is enabled.
277
+ TypeScript 4.0์์๋ ` noImplicitAny ` ๊ฐ ํ์ฑํ๋์์ ๋ ํด๋์ค ๋ด์ ํ๋กํผํฐ ํ์
์ ๊ฒฐ์ ํ๊ธฐ ์ํด ์ ์ด ํ๋ฆ ๋ถ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
278
278
279
279
<!-- prettier-ignore -->
280
280
``` ts
281
281
class Square {
282
- // Previously both of these were any
282
+ // ์ด์ ์ any๋ก ์ถ๋ก ํ์ต๋๋ค.
283
283
area;
284
284
// ^?
285
285
sideLength;
@@ -291,7 +291,7 @@ class Square {
291
291
}
292
292
```
293
293
294
- In cases where not all paths of a constructor assign to an instance member, the property is considered to potentially be ` undefined ` .
294
+ ์์ฑ์์ ๋ชจ๋ ๊ฒฝ๋ก๊ฐ ์ธ์คํด์ค ๋ฉค๋ฒ์ ํ ๋นํ ๊ฒ์ด ์๋ ๊ฒฝ์ฐ, ํ๋กํผํฐ๋ ์ ์ฌ์ ์ผ๋ก ` undefined ` ๊ฐ ๋ฉ๋๋ค .
295
295
296
296
<!-- prettier-ignore -->
297
297
``` ts
@@ -312,15 +312,15 @@ class Square {
312
312
}
313
313
```
314
314
315
- In cases where you know better (e.g. you have an ` initialize ` method of some sort ), you'll still need an explicit type annotation along with a definite assignment assertion (` ! ` ) if you're in ` strictPropertyInitialization ` .
315
+ ๋ ๋ง์ ๋ด์ฉ์ด ์๋ ๊ฒฝ์ฐ (e.g. ` initialize ` ๋ฉ์๋ ๋ฑ์ด ์๋ ๊ฒฝ์ฐ ), ` strictPropertyInitialization ` ๋ชจ๋์์๋ ํ์ ์ ํ ๋น ๋จ์ธ (` ! ` )์ ๋ฐ๋ผ ๋ช
์์ ์ผ๋ก ํ์
์ ์ ์ธํด์ผ ํฉ๋๋ค .
316
316
317
317
``` ts
318
318
class Square {
319
- // definite assignment assertion
319
+ // ํ์ ์ ํ ๋น ๋จ์ธ
320
320
// v
321
321
sideLength! : number ;
322
322
// ^^^^^^^^
323
- // type annotation
323
+ // ํ์
ํ๊ธฐ
324
324
325
325
constructor (sideLength : number ) {
326
326
this .initialize (sideLength );
@@ -336,7 +336,7 @@ class Square {
336
336
}
337
337
```
338
338
339
- For more details , [ see the implementing pull request ] ( https://github.com/microsoft/TypeScript/pull/379200 ) .
339
+ ๋ ์์ธํ ์๊ณ ์ถ๋ค๋ฉด , [ ์ฝ๋๋ฅผ ์คํํ๋ Pull Request๋ฅผ ๋ณด์ธ์ ] ( https://github.com/microsoft/TypeScript/pull/379200 ) .
340
340
341
341
## Short-Circuiting Assignment Operators
342
342
0 commit comments