* Remove check narrowing only certain types, add test showing issues with this * string literal case test * Reconcile fix with CFA work * Defaultable -> NotNarrowable to align with use * Missed a defaultable in comments * Add test for narrowing to unions of string literals * Actually merge from master * Run fixupParentReferences when parsing isolated jsDocComment * initial revision of unit test support for project system in tsserver * Add non-widening forms of null and undefined * Create separate control flows for property declarations with initializers * Add regression test * Add tests * Remove unused variable * Add null check and CR feedback * Revert "Merge pull request #7235 from weswigham/narrow-all-types" This reverts commitef0f6c8fe4
, reversing changes made to9f087cb62a
. * reuse the fixupParentReferences function * Fix up error from merging with master
73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
=== tests/cases/conformance/types/typeRelationships/widenedTypes/objectLiteralWidened.ts ===
|
|
// object literal properties are widened to any
|
|
|
|
var x1 = {
|
|
>x1 : Symbol(x1, Decl(objectLiteralWidened.ts, 2, 3))
|
|
|
|
foo: null,
|
|
>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 2, 10))
|
|
|
|
bar: undefined
|
|
>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 3, 14))
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
|
|
var y1 = {
|
|
>y1 : Symbol(y1, Decl(objectLiteralWidened.ts, 7, 3))
|
|
|
|
foo: null,
|
|
>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 7, 10))
|
|
|
|
bar: {
|
|
>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 8, 14))
|
|
|
|
baz: null,
|
|
>baz : Symbol(baz, Decl(objectLiteralWidened.ts, 9, 10))
|
|
|
|
boo: undefined
|
|
>boo : Symbol(boo, Decl(objectLiteralWidened.ts, 10, 18))
|
|
>undefined : Symbol(undefined)
|
|
}
|
|
}
|
|
|
|
// these are not widened
|
|
|
|
var u: undefined = undefined;
|
|
>u : Symbol(u, Decl(objectLiteralWidened.ts, 17, 3))
|
|
>undefined : Symbol(undefined)
|
|
|
|
var n: null = null;
|
|
>n : Symbol(n, Decl(objectLiteralWidened.ts, 18, 3))
|
|
|
|
var x2 = {
|
|
>x2 : Symbol(x2, Decl(objectLiteralWidened.ts, 20, 3))
|
|
|
|
foo: n,
|
|
>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 20, 10))
|
|
>n : Symbol(n, Decl(objectLiteralWidened.ts, 18, 3))
|
|
|
|
bar: u
|
|
>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 21, 11))
|
|
>u : Symbol(u, Decl(objectLiteralWidened.ts, 17, 3))
|
|
}
|
|
|
|
var y2 = {
|
|
>y2 : Symbol(y2, Decl(objectLiteralWidened.ts, 25, 3))
|
|
|
|
foo: n,
|
|
>foo : Symbol(foo, Decl(objectLiteralWidened.ts, 25, 10))
|
|
>n : Symbol(n, Decl(objectLiteralWidened.ts, 18, 3))
|
|
|
|
bar: {
|
|
>bar : Symbol(bar, Decl(objectLiteralWidened.ts, 26, 11))
|
|
|
|
baz: n,
|
|
>baz : Symbol(baz, Decl(objectLiteralWidened.ts, 27, 10))
|
|
>n : Symbol(n, Decl(objectLiteralWidened.ts, 18, 3))
|
|
|
|
boo: u
|
|
>boo : Symbol(boo, Decl(objectLiteralWidened.ts, 28, 15))
|
|
>u : Symbol(u, Decl(objectLiteralWidened.ts, 17, 3))
|
|
}
|
|
}
|