@@ -102,7 +102,7 @@ let x = () => ({name: "Alice"});
102102let y = () => ({name: " Alice" , location: " Seattle" });
103103
104104x = y ; // OK
105- y = x ; // Error because x() lacks a location property
105+ y = x ; // Error, because x() lacks a location property
106106```
107107
108108The type system enforces that the source function's return type be a subtype of the target type's return type.
@@ -172,7 +172,7 @@ enum Status { Ready, Waiting };
172172enum Color { Red , Blue , Green };
173173
174174let status = Status .Ready ;
175- status = Color .Green ; // error
175+ status = Color .Green ; // Error
176176```
177177
178178# Classes
@@ -195,8 +195,8 @@ class Size {
195195let a: Animal ;
196196let s: Size ;
197197
198- a = s ; // OK
199- s = a ; // OK
198+ a = s ; // OK
199+ s = a ; // OK
200200```
201201
202202## Private and protected members in classes
@@ -216,7 +216,7 @@ interface Empty<T> {
216216let x: Empty <number >;
217217let y: Empty <string >;
218218
219- x = y ; // okay, y matches structure of x
219+ x = y ; // OK, because y matches structure of x
220220```
221221
222222In the above, ` x ` and ` y ` are compatible because their structures do not use the type argument in a differentiating way.
@@ -229,7 +229,7 @@ interface NotEmpty<T> {
229229let x: NotEmpty <number >;
230230let y: NotEmpty <string >;
231231
232- x = y ; // error, x and y are not compatible
232+ x = y ; // Error, because x and y are not compatible
233233```
234234
235235In this way, a generic type that has its type arguments specified acts just like a non-generic type.
@@ -248,7 +248,7 @@ let reverse = function<U>(y: U): U {
248248 // ...
249249}
250250
251- identity = reverse ; // Okay because (x: any)=> any matches (y: any)=> any
251+ identity = reverse ; // OK, because (x: any) => any matches (y: any) => any
252252```
253253
254254# Advanced Topics
0 commit comments