Fix a mistake in "Type Checking JavaScript Files". PR836

This commit is contained in:
zhongsp 2019-03-24 09:42:13 +08:00
parent 7eb096143c
commit e375a563c5

View File

@ -44,10 +44,10 @@ class C {
method() {
this.constructorOnly = false // error, constructorOnly is a number
this.constructorUnknown = "plunkbat" // ok, constructorUnknown is string | undefined
this.methodOnly = 'ok' // ok, but y could also be undefined
this.methodOnly = 'ok' // ok, but methodOnly could also be undefined
}
method2() {
this.methodOnly = true // also, ok, y's type is string | boolean | undefined
this.methodOnly = true // also, ok, methodOnly's type is string | boolean | undefined
}
}
```