* Eliminate well-known symbols in the checker: 2021 edition
* Actually update the lib text to say unique symbol, too (this is unneeded with compat code in place, but this makes goto-def make more sense)
* Add test showing mismatched symbol constructor type interop
* Add more test cases for some other related issues this fixes
* Revert computed name change
* Style comments
* When noImplicitAny is set, combine multiple contextual overloads into a single signature, rather than producing `any` and an error
* Amalgamate intersection composite signature return types as intersections, rather than the prior exclusively union behavior
* Add another example from an issue, albeit slightly modified
* Fix newlines, add test from DT
* Interior remodelling
* Improve @template lookup and resilience
1. @template parsing may produce a template tag with a type parameter
whose name is the missing identifier. These tags should be skipped
in the checker because they receive an error in the parser.
2. The fix in #37819 was incorrect; there's no such thing as a type
parameter declared on a variable declaration. Instead, there needs to be a type
parameter declared on a jsdoc comment, because that's the scope for tags
like `@return` and `@typedef`.
There are 3 tests because either fix (1) and (2) fix the first test's
failure, but both are required to fix the last two tests' failures.
* remove containsParseError call
* Specified error message for iterating known array types without --downlevelIteration
* Added extra target info to diagnostic
* NodeList too, a classic
* PR feedback: invert to allowsStrings; required param
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Change variable name AllowQualifedNameInPlaceOfIdentifier to AllowQualifiedNameInPlaceOfIdentifier
* Change deleting AllowQualifedNameInPlaceOfIdentifier to deprecating it instead.
* Fix failing tests
* Replace old value
* fix: fix RelativeTimeFormat type definition
Changes:
1. Change BCP47LanguageTag to UnicodeBCP47LocaleIdentifier: Those mean 2
different things. BCP47LangTag allows _ as separator while UTS35
doesn't. It also allows grandfathered locales and UTS35 doesn't.
2. Combine RelativeTimeFormat interface and const declaration into a
single class. The old way of declaring as `interface` & `const` permits
calling `Intl.RelativeTimeFormat` without `new` which is no longer
possible after `Intl.DateTimeFormat` & `Intl.NumberFormat`. The spec
explicitly forbids it in
http://ecma-international.org/ecma-402/7.0/index.html#relativetimeformat-objects
where:
> If NewTarget is undefined, throw a TypeError exception.
Intl.RelativeTimeFormat is also extensible per spec. This is closer to a
`class` than the current declaration.
* address feedbacks
* Add a basic dev container
Adds a basic dev container. This basic development environment has tools like gulp installed
* Update CONTRIBUTING.md
* Move development container seciton to be first tip
* Spaces to tabs and remove comments
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* No did-you-mean-to-call error on casts
I chose to do the ad-hoc check rather than yet another tree walk.
1. It's faster to run and easier to read.
2. This error came from looking at real code. It happened twice, so I
think the best estimate for other uses that happened zero times is in
fact zero.
3. I couldn't think of other places to put the cast, given the
restrictions on `testedNode` just before the new code.
* Skip parentheses
I chose to do the ad-hoc check rather than yet another tree walk.
1. It's faster to run and easier to read.
2. This error came from looking at real code. It happened twice, so I
think the best estimate for other uses that happened zero times is in
fact zero.
3. I couldn't think of other places to put the cast, given the
restrictions on `testedNode` just before the new code.
e350c357 (#40228) introduced a subtle bug: it switched the flags to an
alias, dropping `SymbolFlags.Property` --- and that makes
`symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to
`getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures`
being `undefined`. So initialize them in `setStructuredTypeMembers`
before calling `getNamedMembers()`.
Fixes#42350
The original error message on the last line I have added to in
functionParameterArityMismatch.ts was
No overload expects 5 arguments, but overloads do exist that expect
either 4 or Infinity arguments.
even if we do not define a function that takes Infinity arguments.
This PR changes it to this:
Expected 0-6 arguments, but got 5 or more.
I feel it is still a bit strange but much more understandable.
Fixes#42418