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.0.0-beta)
"strictNullChecks": true
Code
class Person { name: string; constructor() { // why no error? } } const olli: Person = new Person();
Expected behavior:
Should issue error like in this example:
const daniel: Person = { };
error:
error TS2322: Type '{}' is not assignable to type 'Person'. Property 'name' is missing in type '{}'.
Actual behavior:
shows no error
The text was updated successfully, but these errors were encountered:
+1 this seems wrong and leads to inconsistencies. It should require me to set the property in the constructor if undefined is not allowed.
Sorry, something went wrong.
@mvestergaard it seems this is a wontfix, see #8476
wontfix
No branches or pull requests
TypeScript Version: (2.0.0-beta)
"strictNullChecks": true
Code
Expected behavior:
Should issue error like in this example:
error:
Actual behavior:
shows no error
The text was updated successfully, but these errors were encountered: