We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 2.4.1
Code
class MyClass { private _myVar: string; public constructor() { this._myVar = 'Hello world!'; } public set myVar(value: string) { this._myVar = value; } } const myObj = new MyClass(); const otherVar: string = myObj.myVar;
Expected behavior:
example.ts(17,7): error TS2322: Type 'undefined' is not assignable to type 'string'.
Actual behavior:
No error.
The text was updated successfully, but these errors were encountered:
Duplicate of #11596
Search is your friend.
Sorry, something went wrong.
Thanks. I had actually tried to find an existing issue, but evidently not hard enough.
No branches or pull requests
TypeScript Version: 2.4.1
Code
Expected behavior:
example.ts(17,7): error TS2322: Type 'undefined' is not assignable to type 'string'.
Actual behavior:
No error.
The text was updated successfully, but these errors were encountered: