-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Code used to work but doesn't in nightly #12584
New issue
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
Comments
@vladima can you take a look. |
Quick question: what is the version in the playground 🌹 |
it seems that it was broken a while back. Error is reproduced when strict null checks are enabled |
simplified repro interface CSSProps {
color?: string
}
interface NestedCSSProps {
nested?: NestedSelector
}
interface NestedSelector {
prop: CSSProps;
}
let stylen: NestedCSSProps = {
nested: { prop: { colour: 'red' } }
} |
Nice. That sort of explains why it works with interface CSSProps {
color?: string
}
interface NestedCSSProps {
nested: NestedSelector
}
interface NestedSelector {
prop: CSSProps;
}
// Errors now even with strictNullChecks
let stylen: NestedCSSProps = {
nested: { prop: { colour: 'red' } }
} Something about nullability analysis is throw it off 🌹 Hope its fixed soon ❤️ |
TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
Code
Works in playground http://www.typescriptlang.org/play/#src=interface%20CSSProps%20%20%7B%0A%20%20color%3F%3A%20string%0A%7D%0Ainterface%20NestedCSSProps%20extends%20CSSProps%20%7B%0A%20%20nested%3F%3A%20NestedSelector%0A%7D%0Ainterface%20NestedSelector%20%20%7B%0A%20%20%5Bselector%3A%20string%5D%3A%20CSSProps%20%7C%20undefined%3B%0A%7D%0A%0Alet%20stylen%3A%20NestedCSSProps%3B%0A%0A%0A%2F%2F%20ok%0Astylen%20%3D%20%7B%0A%20%20nested%3A%20%7B%0A%20%20%20%20'%26%3Ahover'%3A%20%7B%0A%20%20%20%20%20%20color%3A%20'red'%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A%0A%0A%2F%2F%20does%20error%0Astylen%20%3D%20%7B%0A%20%20nested%3A%20%7B%0A%20%20%20%20'%26%3Ahover'%3A%20%7B%0A%20%20%20%20%20%20colour%3A%20'red'%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D
Expected behavior:
Works in nightly
Actual behavior:
Doesn't work in nightly. You don't get an error for the
colour
typoThe text was updated successfully, but these errors were encountered: