Neither `x[0]` nor `x[(0)]` should be dynamic names. Previously, the
latter was because `isDynamicName` didn't skip parentheses.
Since the binder treats dynamic names in property assignments as
assignment declarations, this incorrectly tried to create a binding for
expressions like `x[(0)] = 1`.
This caused an assert because `x[(0)]` would not take the dynamic name
code path during binding (`hasDynamicName` returned false), but the
normal code path for static names.
* Add declaration emit error and checking for circularly referential unions produced by recursive conditionals
* Allow indexed accesses to produce alias symbols on types
* Add test that still triggers the declaration emit error
* Fix spelling
Component commits:
97cb8188f0 No contextual types from circular mapped type properties
1dcf4ab32f Add regression test
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
Co-authored-by: Wesley Wigham <wwigham@gmail.com>
Component commits:
0a696c902d Ensure formatter can always get a newline character
ab09d67b49 Make FormatContext.host optional since it’s not necessary if format options are all applied
90923e2050 Make FormattingHost required again
Co-authored-by: Andrew Branch <andrew@wheream.io>
Component commits:
428f5a19d6 delete import comments on organize imports
8003791d9f add unit test
26eaf706ab accept new baseline
81d1732fd8 respond to review comment
Component commits:
6e3c1d1c1b Fix detecting default project when file is part for more than one project but not part of default configured project (eg because its output of that projet) Fixes#38366
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Component commits:
9795fa6631 Improve assert message in binder
Looking at the code, I don't think the assert can ever fire, but it
clearly does, or did in the past. This will make it easier for people to
create a repro.
d815effa9b fix lint
add6bbcfce Use BindableStaticNameExpression not BindableStaticAccessExpression
This type does allow identifiers, but those are ruled out earlier, so I added
an assert for that case.
Component commits:
6fe4be21e4 Exclude arrays and tuples from full intersection property check
9019e399e5 Add regression test
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
Component commits:
99c5c096c5 Properly finalize evolving array type in getTypeAtFlowCall
b355cd4da4 Add regression test
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
* Property handle private/protected properties in unions of object types
* Add regression test
Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>