diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 9b02f1e0be..410ed8b04e 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -8980,6 +8980,7 @@ func (c *Checker) isSignatureApplicable(node *ast.Node, args []*ast.Node, signat } } } + if restType != nil { spreadType := c.getSpreadArgumentType(args, argCount, len(args), restType, nil /*context*/, checkMode) restArgCount := len(args) - argCount @@ -9319,22 +9320,94 @@ func (c *Checker) tryGetRestTypeOfSignature(signature *Signature) *Type { func (c *Checker) reportCallResolutionErrors(node *ast.Node, s *CallState, signatures []*Signature, headMessage *diagnostics.Message) { switch { case len(s.candidatesForArgumentError) != 0: - last := s.candidatesForArgumentError[len(s.candidatesForArgumentError)-1] - var diags []*ast.Diagnostic - c.isSignatureApplicable(s.node, s.args, last, c.assignableRelation, CheckModeNormal, true /*reportErrors*/, nil /*inferenceContext*/, &diags) - for _, diagnostic := range diags { - if len(s.candidatesForArgumentError) > 1 { - diagnostic = ast.NewDiagnosticChain(diagnostic, diagnostics.The_last_overload_gave_the_following_error) - diagnostic = ast.NewDiagnosticChain(diagnostic, diagnostics.No_overload_matches_this_call) + if len(s.candidatesForArgumentError) == 1 || len(s.candidatesForArgumentError) > 3 { + last := s.candidatesForArgumentError[len(s.candidatesForArgumentError)-1] + var diags []*ast.Diagnostic + c.isSignatureApplicable(s.node, s.args, last, c.assignableRelation, CheckModeNormal, true /*reportErrors*/, nil /*inferenceContext*/, &diags) + for _, diagnostic := range diags { + if len(s.candidatesForArgumentError) > 3 { + diagnostic = ast.NewDiagnosticChain(diagnostic, diagnostics.The_last_overload_gave_the_following_error) + diagnostic = ast.NewDiagnosticChain(diagnostic, diagnostics.No_overload_matches_this_call) + } + if headMessage != nil { + diagnostic = ast.NewDiagnosticChain(diagnostic, headMessage) + } + if last.declaration != nil && len(s.candidatesForArgumentError) > 3 { + diagnostic.AddRelatedInfo(NewDiagnosticForNode(last.declaration, diagnostics.The_last_overload_is_declared_here)) + } + c.addImplementationSuccessElaboration(s, last, diagnostic) + c.diagnostics.Add(diagnostic) } - if headMessage != nil { - diagnostic = ast.NewDiagnosticChain(diagnostic, headMessage) + } else { + // 2-3 candidates: show detailed errors for each individual overload + var allDiagnostics [][]*ast.Diagnostic + maxDiagCount := 0 + minDiagCount := int(^uint(0) >> 1) // Max int value + minIndex := 0 + + for i, candidate := range s.candidatesForArgumentError { + var originalDiags []*ast.Diagnostic + c.isSignatureApplicable(s.node, s.args, candidate, c.assignableRelation, CheckModeNormal, true, nil, &originalDiags) + + if len(originalDiags) > 0 { + chainedDiag := ast.NewDiagnosticChain(originalDiags[0], diagnostics.Overload_0_of_1_2_gave_the_following_error, i+1, len(s.candidates), c.signatureToString(candidate)) + for j := 1; j < len(originalDiags); j++ { + chainedDiag.AddMessageChain(originalDiags[j]) + } + diags := []*ast.Diagnostic{chainedDiag} + + if len(originalDiags) <= minDiagCount { + minDiagCount = len(originalDiags) + minIndex = len(allDiagnostics) + } + maxDiagCount = max(maxDiagCount, len(originalDiags)) + allDiagnostics = append(allDiagnostics, diags) + } } - if last.declaration != nil && len(s.candidatesForArgumentError) > 1 { - diagnostic.AddRelatedInfo(NewDiagnosticForNode(last.declaration, diagnostics.The_last_overload_is_declared_here)) + + var diagsToShow []*ast.Diagnostic + if maxDiagCount > 1 { + diagsToShow = allDiagnostics[minIndex] + } else { + diagsToShow = core.Flatten(allDiagnostics) + } + + if len(diagsToShow) > 0 { + var allRelatedInfo []*ast.Diagnostic + for _, diag := range diagsToShow { + allRelatedInfo = append(allRelatedInfo, diag.RelatedInformation()...) + } + + mainDiag := ast.NewDiagnosticChain(diagsToShow[0], diagnostics.No_overload_matches_this_call) + for i := 1; i < len(diagsToShow); i++ { + mainDiag.AddMessageChain(diagsToShow[i]) + } + + if headMessage != nil { + mainDiag = ast.NewDiagnosticChain(mainDiag, headMessage) + } + + allSameSpan := len(diagsToShow) > 0 + if allSameSpan { + first := diagsToShow[0] + for i := 1; i < len(diagsToShow); i++ { + d := diagsToShow[i] + if d.File() != first.File() || d.Loc().Pos() != first.Loc().Pos() || d.Loc().Len() != first.Loc().Len() { + allSameSpan = false + break + } + } + } + + if allSameSpan { + mainDiag.SetRelatedInfo(allRelatedInfo) + } else { + mainDiag = createDiagnosticForNodeFromMessageChain(ast.GetSourceFileOfNode(s.node), getErrorNodeForCallNode(s.node), mainDiag, allRelatedInfo) + } + + c.addImplementationSuccessElaboration(s, s.candidatesForArgumentError[0], mainDiag) + c.diagnostics.Add(mainDiag) } - c.addImplementationSuccessElaboration(s, last, diagnostic) - c.diagnostics.Add(diagnostic) } case s.candidateForArgumentArityError != nil: c.diagnostics.Add(c.getArgumentArityError(s.node, []*Signature{s.candidateForArgumentArityError}, s.args, headMessage)) diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index fa959157e7..18f3b184e8 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -35,6 +35,25 @@ func NewDiagnosticChainForNode(chain *ast.Diagnostic, node *ast.Node, message *d return NewDiagnosticForNode(node, message, args...) } +func createDiagnosticForNodeFromMessageChain(sourceFile *ast.SourceFile, node *ast.Node, messageChain *ast.Diagnostic, relatedInformation []*ast.Diagnostic) *ast.Diagnostic { + if node == nil || messageChain == nil { + return messageChain + } + + loc := binder.GetErrorRangeForNode(sourceFile, node) + + diagnostic := &ast.Diagnostic{} + *diagnostic = *messageChain + diagnostic.SetFile(sourceFile) + diagnostic.SetLocation(loc) + + if relatedInformation != nil { + diagnostic.SetRelatedInfo(relatedInformation) + } + + return diagnostic +} + func IsIntrinsicJsxName(name string) bool { return len(name) != 0 && (name[0] >= 'a' && name[0] <= 'z' || strings.ContainsRune(name, '-')) } diff --git a/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt b/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt index 354ac5e11d..5ae0de0c89 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt @@ -3,10 +3,14 @@ constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementation constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed. constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. constructorOverloads1.ts(16,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (s: string): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'string'. + Overload 2 of 2, 'new (n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. constructorOverloads1.ts(17,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (s: string): Foo', gave the following error. + Argument of type 'Foo[]' is not assignable to parameter of type 'string'. + Overload 2 of 2, 'new (n: number): Foo', gave the following error. Argument of type 'Foo[]' is not assignable to parameter of type 'number'. @@ -37,16 +41,18 @@ constructorOverloads1.ts(17,18): error TS2769: No overload matches this call. var f3 = new Foo(f1); ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (s: string): Foo', gave the following error. +!!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (n: number): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'number'. -!!! related TS2771 constructorOverloads1.ts:3:5: The last overload is declared here. !!! related TS2793 constructorOverloads1.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (s: string): Foo', gave the following error. +!!! error TS2769: Argument of type 'Foo[]' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (n: number): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo[]' is not assignable to parameter of type 'number'. -!!! related TS2771 constructorOverloads1.ts:3:5: The last overload is declared here. !!! related TS2793 constructorOverloads1.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. f1.bar1(); diff --git a/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt.diff index 4650600424..8e5c28e805 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/constructorOverloads1.errors.txt.diff @@ -5,38 +5,39 @@ constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed. constructorOverloads1.ts(16,18): error TS2769: No overload matches this call. - Overload 1 of 2, '(s: string): Foo', gave the following error. -- Argument of type 'Foo' is not assignable to parameter of type 'string'. ++ Overload 1 of 2, 'new (s: string): Foo', gave the following error. + Argument of type 'Foo' is not assignable to parameter of type 'string'. - Overload 2 of 2, '(n: number): Foo', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (n: number): Foo', gave the following error. Argument of type 'Foo' is not assignable to parameter of type 'number'. constructorOverloads1.ts(17,18): error TS2769: No overload matches this call. - Overload 1 of 2, '(s: string): Foo', gave the following error. -- Argument of type 'Foo[]' is not assignable to parameter of type 'string'. ++ Overload 1 of 2, 'new (s: string): Foo', gave the following error. + Argument of type 'Foo[]' is not assignable to parameter of type 'string'. - Overload 2 of 2, '(n: number): Foo', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (n: number): Foo', gave the following error. Argument of type 'Foo[]' is not assignable to parameter of type 'number'. -@@= skipped -38, +34 lines =@@ +@@= skipped -38, +38 lines =@@ var f3 = new Foo(f1); ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error. --!!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (s: string): Foo', gave the following error. + !!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 2, '(n: number): Foo', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (n: number): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'number'. -+!!! related TS2771 constructorOverloads1.ts:3:5: The last overload is declared here. !!! related TS2793 constructorOverloads1.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var f4 = new Foo([f1,f2,f3]); ~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error. --!!! error TS2769: Argument of type 'Foo[]' is not assignable to parameter of type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (s: string): Foo', gave the following error. + !!! error TS2769: Argument of type 'Foo[]' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 2, '(n: number): Foo', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (n: number): Foo', gave the following error. !!! error TS2769: Argument of type 'Foo[]' is not assignable to parameter of type 'number'. -+!!! related TS2771 constructorOverloads1.ts:3:5: The last overload is declared here. !!! related TS2793 constructorOverloads1.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - - f1.bar1(); \ No newline at end of file + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt b/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt index feadfa6b37..53bc232e33 100644 --- a/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt @@ -1,10 +1,14 @@ destructuringTuple.ts(11,7): error TS2461: Type 'number' is not an array type. destructuringTuple.ts(11,48): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. + Type 'never[]' is not assignable to type 'number'. + Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. Type 'never[]' is not assignable to type '[]'. Target allows only 0 element(s) but source may have more. destructuringTuple.ts(11,60): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. + Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. @@ -24,16 +28,19 @@ destructuringTuple.ts(11,60): error TS2769: No overload matches this call. !!! error TS2461: Type 'number' is not an array type. ~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. +!!! error TS2769: Type 'never[]' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. !!! error TS2769: Type 'never[]' is not assignable to type '[]'. !!! error TS2769: Target allows only 0 element(s) but source may have more. !!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. +!!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature. ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. +!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2769: Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt.diff deleted file mode 100644 index 410e7d5975..0000000000 --- a/testdata/baselines/reference/submodule/compiler/destructuringTuple.errors.txt.diff +++ /dev/null @@ -1,44 +0,0 @@ ---- old.destructuringTuple.errors.txt -+++ new.destructuringTuple.errors.txt -@@= skipped -0, +0 lines =@@ - destructuringTuple.ts(11,7): error TS2461: Type 'number' is not an array type. - destructuringTuple.ts(11,48): error TS2769: No overload matches this call. -- Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. -- Type 'never[]' is not assignable to type 'number'. -- Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. -+ The last overload gave the following error. - Type 'never[]' is not assignable to type '[]'. - Target allows only 0 element(s) but source may have more. - destructuringTuple.ts(11,60): error TS2769: No overload matches this call. -- Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. -- Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. -- Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. -+ The last overload gave the following error. - Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. - - -@@= skipped -27, +23 lines =@@ - !!! error TS2461: Type 'number' is not an array type. - ~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. --!!! error TS2769: Type 'never[]' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'never[]' is not assignable to type '[]'. - !!! error TS2769: Target allows only 0 element(s) but source may have more. - !!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature. --!!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. --!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. --!!! error TS2769: Overload 2 of 2, '(...items: ConcatArray[]): never[]', gave the following error. --!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray'. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. - - const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt b/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt index 2e89125a9b..751d246f1e 100644 --- a/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt @@ -1,11 +1,27 @@ -dissallowSymbolAsWeakType.ts(3,25): error TS2769: No overload matches this call. - The last overload gave the following error. +dissallowSymbolAsWeakType.ts(3,12): error TS2769: No overload matches this call. + Overload 1 of 2, 'new (iterable: Iterable): WeakSet', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'symbol' is not assignable to type 'object'. + Overload 2 of 2, 'new (values?: readonly object[]): WeakSet', gave the following error. Type 'symbol' is not assignable to type 'object'. dissallowSymbolAsWeakType.ts(4,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(5,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(6,11): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. -dissallowSymbolAsWeakType.ts(8,26): error TS2769: No overload matches this call. - The last overload gave the following error. +dissallowSymbolAsWeakType.ts(8,12): error TS2769: No overload matches this call. + Overload 1 of 2, 'new (iterable: Iterable): WeakMap', gave the following error. + Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. + Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. + Type at position 0 in source is not compatible with type at position 0 in target. + Type 'symbol' is not assignable to type 'object'. + Overload 2 of 2, 'new (entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. Type 'symbol' is not assignable to type 'object'. dissallowSymbolAsWeakType.ts(9,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(10,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. @@ -20,11 +36,17 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is const s: symbol = Symbol('s'); const ws = new WeakSet([s]); - ~ + ~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (iterable: Iterable): WeakSet', gave the following error. +!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. +!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. +!!! error TS2769: Type 'symbol' is not assignable to type 'object'. +!!! error TS2769: Overload 2 of 2, 'new (values?: readonly object[]): WeakSet', gave the following error. !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. ws.add(s); ~ !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. @@ -36,11 +58,19 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. const wm = new WeakMap([[s, false]]); - ~ + ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (iterable: Iterable): WeakMap', gave the following error. +!!! error TS2769: Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. +!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. +!!! error TS2769: Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. +!!! error TS2769: Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. +!!! error TS2769: Type at position 0 in source is not compatible with type at position 0 in target. +!!! error TS2769: Type 'symbol' is not assignable to type 'object'. +!!! error TS2769: Overload 2 of 2, 'new (entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. wm.set(s, true); ~ !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. diff --git a/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt.diff index 0c97f04dd1..3f46043ae8 100644 --- a/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/dissallowSymbolAsWeakType.errors.txt.diff @@ -3,76 +3,74 @@ @@= skipped -0, +0 lines =@@ -dissallowSymbolAsWeakType.ts(3,16): error TS2769: No overload matches this call. - Overload 1 of 2, '(iterable: Iterable): WeakSet', gave the following error. -- Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. -- The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -- Type 'IteratorResult' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. -- Type 'symbol' is not assignable to type 'object'. ++dissallowSymbolAsWeakType.ts(3,12): error TS2769: No overload matches this call. ++ Overload 1 of 2, 'new (iterable: Iterable): WeakSet', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + Type 'symbol' is not assignable to type 'object'. - Overload 2 of 2, '(values?: readonly object[]): WeakSet', gave the following error. -+dissallowSymbolAsWeakType.ts(3,25): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (values?: readonly object[]): WeakSet', gave the following error. Type 'symbol' is not assignable to type 'object'. dissallowSymbolAsWeakType.ts(4,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(5,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(6,11): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. -dissallowSymbolAsWeakType.ts(8,16): error TS2769: No overload matches this call. - Overload 1 of 2, '(iterable: Iterable): WeakMap', gave the following error. -- Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. -- The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -- Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. -- Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. -- Type at position 0 in source is not compatible with type at position 0 in target. -- Type 'symbol' is not assignable to type 'object'. ++dissallowSymbolAsWeakType.ts(8,12): error TS2769: No overload matches this call. ++ Overload 1 of 2, 'new (iterable: Iterable): WeakMap', gave the following error. + Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. +@@= skipped -20, +20 lines =@@ + Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. + Type at position 0 in source is not compatible with type at position 0 in target. + Type 'symbol' is not assignable to type 'object'. - Overload 2 of 2, '(entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. -+dissallowSymbolAsWeakType.ts(8,26): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. Type 'symbol' is not assignable to type 'object'. dissallowSymbolAsWeakType.ts(9,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. dissallowSymbolAsWeakType.ts(10,8): error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. -@@= skipped -35, +19 lines =@@ +@@= skipped -15, +15 lines =@@ const s: symbol = Symbol('s'); const ws = new WeakSet([s]); - ~~~~~~~ -+ ~ ++ ~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(iterable: Iterable): WeakSet', gave the following error. --!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. --!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. --!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. --!!! error TS2769: Type 'symbol' is not assignable to type 'object'. ++!!! error TS2769: Overload 1 of 2, 'new (iterable: Iterable): WeakSet', gave the following error. + !!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'Iterable'. + !!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + !!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. + !!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. + !!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. + !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -!!! error TS2769: Overload 2 of 2, '(values?: readonly object[]): WeakSet', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (values?: readonly object[]): WeakSet', gave the following error. !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -+!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. ws.add(s); ~ - !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. -@@= skipped -22, +16 lines =@@ +@@= skipped -22, +22 lines =@@ !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. const wm = new WeakMap([[s, false]]); - ~~~~~~~ -+ ~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(iterable: Iterable): WeakMap', gave the following error. --!!! error TS2769: Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. --!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. --!!! error TS2769: Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. --!!! error TS2769: Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. --!!! error TS2769: Type at position 0 in source is not compatible with type at position 0 in target. --!!! error TS2769: Type 'symbol' is not assignable to type 'object'. ++!!! error TS2769: Overload 1 of 2, 'new (iterable: Iterable): WeakMap', gave the following error. + !!! error TS2769: Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. + !!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + !!! error TS2769: Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. +@@= skipped -11, +11 lines =@@ + !!! error TS2769: Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. + !!! error TS2769: Type at position 0 in source is not compatible with type at position 0 in target. + !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -!!! error TS2769: Overload 2 of 2, '(entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (entries?: readonly (readonly [object, boolean])[]): WeakMap', gave the following error. !!! error TS2769: Type 'symbol' is not assignable to type 'object'. -+!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. wm.set(s, true); - ~ - !!! error TS2345: Argument of type 'symbol' is not assignable to parameter of type 'object'. \ No newline at end of file + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt b/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt index 6f56f0245e..c82442e350 100644 --- a/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt @@ -1,5 +1,7 @@ excessPropertiesInOverloads.ts(3,6): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(a: { x: string; }): void', gave the following error. + Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. + Overload 2 of 2, '(a: { y: string; }): void', gave the following error. Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. @@ -9,7 +11,8 @@ excessPropertiesInOverloads.ts(3,6): error TS2769: No overload matches this call fn({ z: 3, a: 3 }); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(a: { x: string; }): void', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. +!!! error TS2769: Overload 2 of 2, '(a: { y: string; }): void', gave the following error. !!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. -!!! related TS2771 excessPropertiesInOverloads.ts:2:18: The last overload is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt.diff deleted file mode 100644 index 3605025c39..0000000000 --- a/testdata/baselines/reference/submodule/compiler/excessPropertiesInOverloads.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.excessPropertiesInOverloads.errors.txt -+++ new.excessPropertiesInOverloads.errors.txt -@@= skipped -0, +0 lines =@@ - excessPropertiesInOverloads.ts(3,6): error TS2769: No overload matches this call. -- Overload 1 of 2, '(a: { x: string; }): void', gave the following error. -- Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. -- Overload 2 of 2, '(a: { y: string; }): void', gave the following error. -+ The last overload gave the following error. - Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. - - -@@= skipped -10, +8 lines =@@ - fn({ z: 3, a: 3 }); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(a: { x: string; }): void', gave the following error. --!!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ x: string; }'. --!!! error TS2769: Overload 2 of 2, '(a: { y: string; }): void', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Object literal may only specify known properties, and 'z' does not exist in type '{ y: string; }'. -+!!! related TS2771 excessPropertiesInOverloads.ts:2:18: The last overload is declared here. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt b/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt index 1d83272537..b192a7c279 100644 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt @@ -1,5 +1,7 @@ functionOverloads2.ts(4,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: string): string', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(bar: number): number', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. @@ -10,7 +12,8 @@ functionOverloads2.ts(4,13): error TS2769: No overload matches this call. var x = foo(true); ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: string): string', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(bar: number): number', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! related TS2771 functionOverloads2.ts:2:10: The last overload is declared here. !!! related TS2793 functionOverloads2.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt.diff deleted file mode 100644 index 634013d92e..0000000000 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads2.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.functionOverloads2.errors.txt -+++ new.functionOverloads2.errors.txt -@@= skipped -0, +0 lines =@@ - functionOverloads2.ts(4,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: string): string', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(bar: number): number', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'number'. - - -@@= skipped -11, +9 lines =@@ - var x = foo(true); - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: string): string', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(bar: number): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -+!!! related TS2771 functionOverloads2.ts:2:10: The last overload is declared here. - !!! related TS2793 functionOverloads2.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt b/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt index 4b9d3bd267..cb95776c03 100644 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt @@ -1,5 +1,7 @@ functionOverloads40.ts(4,15): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. @@ -10,9 +12,11 @@ functionOverloads40.ts(4,15): error TS2769: No overload matches this call. var x = foo([{a:'bar'}]); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 functionOverloads40.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' !!! related TS6500 functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -!!! related TS2771 functionOverloads40.ts:2:10: The last overload is declared here. !!! related TS2793 functionOverloads40.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt.diff deleted file mode 100644 index 4b5209f901..0000000000 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.functionOverloads40.errors.txt -+++ new.functionOverloads40.errors.txt -@@= skipped -0, +0 lines =@@ - functionOverloads40.ts(4,15): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -- Type 'string' is not assignable to type 'number'. -- Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+ The last overload gave the following error. - Type 'string' is not assignable to type 'boolean'. - - -@@= skipped -11, +9 lines =@@ - var x = foo([{a:'bar'}]); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 functionOverloads40.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' - !!! related TS6500 functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -+!!! related TS2771 functionOverloads40.ts:2:10: The last overload is declared here. - !!! related TS2793 functionOverloads40.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt b/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt index 0378a5fd97..2b5540a1a9 100644 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt @@ -1,5 +1,7 @@ functionOverloads41.ts(4,14): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Property 'a' is missing in type '{}' but required in type '{ a: number; }'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. @@ -10,8 +12,10 @@ functionOverloads41.ts(4,14): error TS2769: No overload matches this call. var x = foo([{}]); ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2769: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. +!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2769: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. +!!! related TS2728 functionOverloads41.ts:1:19: 'a' is declared here. !!! related TS2728 functionOverloads41.ts:2:19: 'a' is declared here. -!!! related TS2771 functionOverloads41.ts:2:10: The last overload is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt.diff deleted file mode 100644 index 675a90c59c..0000000000 --- a/testdata/baselines/reference/submodule/compiler/functionOverloads41.errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.functionOverloads41.errors.txt -+++ new.functionOverloads41.errors.txt -@@= skipped -0, +0 lines =@@ - functionOverloads41.ts(4,14): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -- Property 'a' is missing in type '{}' but required in type '{ a: number; }'. -- Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+ The last overload gave the following error. - Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. - - -@@= skipped -11, +9 lines =@@ - var x = foo([{}]); - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. --!!! error TS2769: Property 'a' is missing in type '{}' but required in type '{ a: number; }'. --!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Property 'a' is missing in type '{}' but required in type '{ a: boolean; }'. --!!! related TS2728 functionOverloads41.ts:1:19: 'a' is declared here. - !!! related TS2728 functionOverloads41.ts:2:19: 'a' is declared here. -+!!! related TS2771 functionOverloads41.ts:2:10: The last overload is declared here. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt b/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt index f6352d312d..875136c876 100644 --- a/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt @@ -1,15 +1,9 @@ -heterogeneousArrayAndOverloads.ts(9,20): error TS2769: No overload matches this call. - The last overload gave the following error. - Type 'number' is not assignable to type 'string'. -heterogeneousArrayAndOverloads.ts(9,23): error TS2769: No overload matches this call. - The last overload gave the following error. - Type 'number' is not assignable to type 'string'. -heterogeneousArrayAndOverloads.ts(9,32): error TS2769: No overload matches this call. - The last overload gave the following error. - Type 'number' is not assignable to type 'string'. +heterogeneousArrayAndOverloads.ts(9,26): error TS2769: No overload matches this call. + Overload 1 of 2, '(arg1: number[]): any', gave the following error. + Type 'string' is not assignable to type 'number'. -==== heterogeneousArrayAndOverloads.ts (3 errors) ==== +==== heterogeneousArrayAndOverloads.ts (1 errors) ==== class arrTest { test(arg1: number[]); test(arg1: string[]); @@ -19,23 +13,10 @@ heterogeneousArrayAndOverloads.ts(9,32): error TS2769: No overload matches this this.test(["hi"]); this.test([]); this.test([1, 2, "hi", 5]); // Error - ~ + ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. -!!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - ~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. -!!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - ~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. +!!! error TS2769: Overload 1 of 2, '(arg1: number[]): any', gave the following error. +!!! error TS2769: Type 'string' is not assignable to type 'number'. !!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt.diff deleted file mode 100644 index 9e357336a3..0000000000 --- a/testdata/baselines/reference/submodule/compiler/heterogeneousArrayAndOverloads.errors.txt.diff +++ /dev/null @@ -1,52 +0,0 @@ ---- old.heterogeneousArrayAndOverloads.errors.txt -+++ new.heterogeneousArrayAndOverloads.errors.txt -@@= skipped -0, +0 lines =@@ --heterogeneousArrayAndOverloads.ts(9,26): error TS2769: No overload matches this call. -- Overload 1 of 2, '(arg1: number[]): any', gave the following error. -- Type 'string' is not assignable to type 'number'. -- -- --==== heterogeneousArrayAndOverloads.ts (1 errors) ==== -+heterogeneousArrayAndOverloads.ts(9,20): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'number' is not assignable to type 'string'. -+heterogeneousArrayAndOverloads.ts(9,23): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'number' is not assignable to type 'string'. -+heterogeneousArrayAndOverloads.ts(9,32): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'number' is not assignable to type 'string'. -+ -+ -+==== heterogeneousArrayAndOverloads.ts (3 errors) ==== - class arrTest { - test(arg1: number[]); - test(arg1: string[]); -@@= skipped -12, +18 lines =@@ - this.test(["hi"]); - this.test([]); - this.test([1, 2, "hi", 5]); // Error -- ~~~~ --!!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(arg1: number[]): any', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number'. -+ ~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. -+!!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. -+ ~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. -+!!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. -+ ~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! related TS2771 heterogeneousArrayAndOverloads.ts:3:5: The last overload is declared here. - !!! related TS2793 heterogeneousArrayAndOverloads.ts:4:5: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt b/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt index 7fffa251c3..8d48f0173e 100644 --- a/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt @@ -10,12 +10,18 @@ incompatibleTypes.ts(26,12): error TS2416: Property 'p1' in type 'C3' is not ass incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b incompatibleTypes.ts(42,5): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(i: IFoo1): void', gave the following error. + Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. + The types returned by 'p1()' are incompatible between these types. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(i: IFoo2): void', gave the following error. Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. The types returned by 'p1(...)' are incompatible between these types. Type 'string' is not assignable to type 'number'. incompatibleTypes.ts(49,7): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. + Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. + Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. incompatibleTypes.ts(66,47): error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. @@ -83,11 +89,14 @@ incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assig if1(c1); ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(i: IFoo1): void', gave the following error. +!!! error TS2769: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. +!!! error TS2769: The types returned by 'p1()' are incompatible between these types. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(i: IFoo2): void', gave the following error. !!! error TS2769: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. !!! error TS2769: The types returned by 'p1(...)' are incompatible between these types. !!! error TS2769: Type 'string' is not assignable to type 'number'. -!!! related TS2771 incompatibleTypes.ts:38:10: The last overload is declared here. !!! related TS2793 incompatibleTypes.ts:39:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. @@ -98,9 +107,10 @@ incompatibleTypes.ts(74,5): error TS2322: Type '(a: any) => number' is not assig of1({ e: 0, f: 0 }); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. +!!! error TS2769: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. !!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. -!!! related TS2771 incompatibleTypes.ts:46:10: The last overload is declared here. !!! related TS2793 incompatibleTypes.ts:47:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. interface IMap { diff --git a/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt.diff deleted file mode 100644 index d7054d1827..0000000000 --- a/testdata/baselines/reference/submodule/compiler/incompatibleTypes.errors.txt.diff +++ /dev/null @@ -1,53 +0,0 @@ ---- old.incompatibleTypes.errors.txt -+++ new.incompatibleTypes.errors.txt -@@= skipped -9, +9 lines =@@ - incompatibleTypes.ts(34,12): error TS2416: Property 'p1' in type 'C4' is not assignable to the same property in base type 'IFoo4'. - Type '{ c: { b: string; }; d: string; }' is missing the following properties from type '{ a: { a: string; }; b: string; }': a, b - incompatibleTypes.ts(42,5): error TS2769: No overload matches this call. -- Overload 1 of 2, '(i: IFoo1): void', gave the following error. -- Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. -- The types returned by 'p1()' are incompatible between these types. -- Type 'string' is not assignable to type 'number'. -- Overload 2 of 2, '(i: IFoo2): void', gave the following error. -+ The last overload gave the following error. - Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. - The types returned by 'p1(...)' are incompatible between these types. - Type 'string' is not assignable to type 'number'. - incompatibleTypes.ts(49,7): error TS2769: No overload matches this call. -- Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. -- Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. -- Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. -+ The last overload gave the following error. - Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. - incompatibleTypes.ts(66,47): error TS2353: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. - incompatibleTypes.ts(72,5): error TS2322: Type 'number' is not assignable to type '() => string'. -@@= skipped -79, +73 lines =@@ - if1(c1); - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(i: IFoo1): void', gave the following error. --!!! error TS2769: Argument of type 'C1' is not assignable to parameter of type 'IFoo1'. --!!! error TS2769: The types returned by 'p1()' are incompatible between these types. --!!! error TS2769: Type 'string' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(i: IFoo2): void', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'C1' is not assignable to parameter of type 'IFoo2'. - !!! error TS2769: The types returned by 'p1(...)' are incompatible between these types. - !!! error TS2769: Type 'string' is not assignable to type 'number'. -+!!! related TS2771 incompatibleTypes.ts:38:10: The last overload is declared here. - !!! related TS2793 incompatibleTypes.ts:39:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - - -@@= skipped -18, +15 lines =@@ - of1({ e: 0, f: 0 }); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(n: { a: { a: string; }; b: string; }): number', gave the following error. --!!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ a: { a: string; }; b: string; }'. --!!! error TS2769: Overload 2 of 2, '(s: { c: { b: string; }; d: string; }): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Object literal may only specify known properties, and 'e' does not exist in type '{ c: { b: string; }; d: string; }'. -+!!! related TS2771 incompatibleTypes.ts:46:10: The last overload is declared here. - !!! related TS2793 incompatibleTypes.ts:47:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - - interface IMap { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt b/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt index 247b11c3f0..fc376dcacd 100644 --- a/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt @@ -1,9 +1,13 @@ inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -inheritedConstructorWithRestParams2.ts(33,17): error TS2769: No overload matches this call. - The last overload gave the following error. +inheritedConstructorWithRestParams2.ts(33,1): error TS2769: No overload matches this call. + Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'number'. + Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. -inheritedConstructorWithRestParams2.ts(34,17): error TS2769: No overload matches this call. - The last overload gave the following error. +inheritedConstructorWithRestParams2.ts(34,1): error TS2769: No overload matches this call. + Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'number'. + Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. @@ -43,14 +47,16 @@ inheritedConstructorWithRestParams2.ts(34,17): error TS2769: No overload matches ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); - ~ + ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! related TS2771 inheritedConstructorWithRestParams2.ts:13:5: The last overload is declared here. new Derived("", 3, "", ""); - ~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! related TS2771 inheritedConstructorWithRestParams2.ts:13:5: The last overload is declared here. \ No newline at end of file +!!! error TS2769: Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. +!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. +!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt.diff index cc05bf02a9..7396884e0c 100644 --- a/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/inheritedConstructorWithRestParams2.errors.txt.diff @@ -4,40 +4,42 @@ inheritedConstructorWithRestParams2.ts(32,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -inheritedConstructorWithRestParams2.ts(33,5): error TS2769: No overload matches this call. - Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -- Argument of type 'string' is not assignable to parameter of type 'number'. ++inheritedConstructorWithRestParams2.ts(33,1): error TS2769: No overload matches this call. ++ Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -+inheritedConstructorWithRestParams2.ts(33,17): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. -inheritedConstructorWithRestParams2.ts(34,5): error TS2769: No overload matches this call. - Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. -- Argument of type 'string' is not assignable to parameter of type 'number'. ++inheritedConstructorWithRestParams2.ts(34,1): error TS2769: No overload matches this call. ++ Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -+inheritedConstructorWithRestParams2.ts(34,17): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. -@@= skipped -46, +42 lines =@@ +@@= skipped -46, +46 lines =@@ ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. new Derived("", 3, "", 3); - ~~~~~~~ -+ ~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. --!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. ++!!! error TS2769: Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + !!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! related TS2771 inheritedConstructorWithRestParams2.ts:13:5: The last overload is declared here. new Derived("", 3, "", ""); - ~~~~~~~ -+ ~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 3, '(x: string, ...y: number[]): Derived', gave the following error. --!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. ++!!! error TS2769: Overload 1 of 3, 'new (x: string, ...y: number[]): Derived', gave the following error. + !!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(x1: string, x2: string, ...y: number[]): Derived', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! related TS2771 inheritedConstructorWithRestParams2.ts:13:5: The last overload is declared here. \ No newline at end of file ++!!! error TS2769: Overload 2 of 3, 'new (x1: string, x2: string, ...y: number[]): Derived', gave the following error. + !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt index adfee59b3c..78b061db66 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt @@ -1,12 +1,10 @@ index.tsx(12,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. Type 'unknown' is not assignable to type 'string | boolean'. -index.tsx(13,9): error TS2769: No overload matches this call. - The last overload gave the following error. Type 'string' is not assignable to type 'number | boolean'. -==== index.tsx (2 errors) ==== +==== index.tsx (1 errors) ==== /// /// @@ -21,14 +19,9 @@ index.tsx(13,9): error TS2769: No overload matches this call. {
as unknown} ~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. !!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. - {"aa"} - ~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. -!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. + {"aa"} ); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt.diff index 63695fe65d..d543e50019 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenArrayWrongType.errors.txt.diff @@ -4,40 +4,26 @@ -index.tsx(11,6): error TS2769: No overload matches this call. - Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. +index.tsx(12,9): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. Type 'unknown' is not assignable to type 'string | boolean'. - Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. -+index.tsx(13,9): error TS2769: No overload matches this call. -+ The last overload gave the following error. Type 'string' is not assignable to type 'number | boolean'. --==== index.tsx (1 errors) ==== -+==== index.tsx (2 errors) ==== - /// - /// - -@@= skipped -16, +17 lines =@@ +@@= skipped -16, +15 lines =@@ declare class Foo extends React.Component {} const b = ( - ~~~ --!!! error TS2769: No overload matches this call. ++ {
as unknown} ++ ~~~~~~~~~~~~~~~~~~~ + !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. --!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. ++!!! error TS2769: Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. + !!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. - {
as unknown} -+ ~~~~~~~~~~~~~~~~~~~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -+!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. + !!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. +- {
as unknown} {"aa"} -+ ~~~~~~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. -+!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. ); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt index 00f0b83924..4678e82dbf 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt @@ -1,12 +1,10 @@ other.tsx(11,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. Type 'unknown' is not assignable to type 'string | boolean'. -other.tsx(12,9): error TS2769: No overload matches this call. - The last overload gave the following error. Type 'string' is not assignable to type 'number | boolean'. -==== other.tsx (2 errors) ==== +==== other.tsx (1 errors) ==== /// /// @@ -20,14 +18,9 @@ other.tsx(12,9): error TS2769: No overload matches this call. {
as unknown} ~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. !!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. - {"aa"} - ~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. -!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. + {"aa"} ); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt.diff index d42727e775..6bdad9c824 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxChildrenWrongType.errors.txt.diff @@ -4,40 +4,26 @@ -other.tsx(10,6): error TS2769: No overload matches this call. - Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. +other.tsx(11,9): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. Type 'unknown' is not assignable to type 'string | boolean'. - Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. -+other.tsx(12,9): error TS2769: No overload matches this call. -+ The last overload gave the following error. Type 'string' is not assignable to type 'number | boolean'. --==== other.tsx (1 errors) ==== -+==== other.tsx (2 errors) ==== - /// - /// - -@@= skipped -15, +16 lines =@@ +@@= skipped -15, +14 lines =@@ declare class Foo extends React.Component {} const b = ( - ~~~ --!!! error TS2769: No overload matches this call. ++ {
as unknown} ++ ~~~~~~~~~~~~~~~~~~~ + !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. --!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. ++!!! error TS2769: Overload 2 of 2, 'new (props: PropsType, context: any): Foo', gave the following error. + !!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -!!! error TS2769: Overload 2 of 2, '(props: PropsType, context: any): Foo', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. - {
as unknown} -+ ~~~~~~~~~~~~~~~~~~~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'unknown' is not assignable to type 'string | boolean'. -+!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. + !!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. +- {
as unknown} {"aa"} -+ ~~~~~~ -+!!! error TS2769: No overload matches this call. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'string' is not assignable to type 'number | boolean'. -+!!! related TS2771 react18/react18.d.ts:478:9: The last overload is declared here. ); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt index f67b3002a1..efaa363077 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt @@ -14,10 +14,15 @@ jsxElementType.tsx(59,2): error TS2741: Property 'title' is missing in type '{}' jsxElementType.tsx(61,16): error TS2322: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & { title: string; }'. Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(70,2): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. + Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. jsxElementType.tsx(72,20): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. jsxElementType.tsx(78,1): error TS2339: Property 'boop' does not exist on type 'JSX.IntrinsicElements'. @@ -139,18 +144,22 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ; ~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. +!!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. +!!! error TS2769: Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. !!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. !!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. +!!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. ; ; ~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. +!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. +!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. +!!! error TS2769: Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. !!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. !!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. // Host element types still work
; diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff index bb10603ff6..07fb85460f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff @@ -5,16 +5,18 @@ Property 'excessProp' does not exist on type 'IntrinsicAttributes & { title: string; }'. jsxElementType.tsx(70,2): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. -- Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. ++ Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. - Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. jsxElementType.tsx(72,20): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. -- Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -- Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. ++ Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. - Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. jsxElementType.tsx(78,1): error TS2339: Property 'boop' does not exist on type 'JSX.IntrinsicElements'. @@ -29,38 +31,32 @@ jsxElementType.tsx(95,11): error TS2322: Type '{}' is not assignable to type 'LibraryManagedAttributes'. jsxElementType.tsx(98,2): error TS2304: Cannot find name 'Unresolved'. jsxElementType.tsx(99,2): error TS2304: Cannot find name 'Unresolved'. -@@= skipped -129, +125 lines =@@ +@@= skipped -129, +130 lines =@@ ; ~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. --!!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + !!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. -!!! error TS2769: Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. --!!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. --!!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. --!!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. -+!!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. - ; ++!!! error TS2769: Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. + !!! error TS2769: Property 'title' is missing in type '{}' but required in type 'Readonly<{ title: string; }>'. + !!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. + !!! related TS2728 jsxElementType.tsx:64:51: 'title' is declared here. +@@= skipped -10, +10 lines =@@ ; ~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. --!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. --!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ title: string; }>): RenderStringClass', gave the following error. + !!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + !!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -!!! error TS2769: Overload 2 of 2, '(props: { title: string; }, context?: any): RenderStringClass', gave the following error. --!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. --!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -+!!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. ++!!! error TS2769: Overload 2 of 2, 'new (props: { title: string; }, context?: any): RenderStringClass', gave the following error. + !!! error TS2769: Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. + !!! error TS2769: Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. - // Host element types still work -
; -@@= skipped -42, +38 lines =@@ +@@= skipped -32, +32 lines =@@ ~~~~~~~~~~~~~~~~~~~ !!! error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. !!! error TS2786: Its type '(props: {}, ref: ForwardedRef) => null' is not a valid JSX element type. diff --git a/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt b/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt index d5501dc988..acd47d5eae 100644 --- a/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt @@ -1,5 +1,7 @@ index.ts(3,3): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(opts?: Whatever): void', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'Whatever'. + Overload 2 of 2, '(cb: Function, opts?: Whatever): void', gave the following error. Argument of type 'number' is not assignable to parameter of type 'Function'. @@ -9,9 +11,10 @@ index.ts(3,3): error TS2769: No overload matches this call. X(0); // shouldn't cause a crash ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(opts?: Whatever): void', gave the following error. +!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'Whatever'. +!!! error TS2769: Overload 2 of 2, '(cb: Function, opts?: Whatever): void', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'Function'. -!!! related TS2771 file.d.ts:8:18: The last overload is declared here. ==== file.d.ts (0 errors) ==== declare namespace Foo { interface Whatever { diff --git a/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt.diff deleted file mode 100644 index 2fc0387919..0000000000 --- a/testdata/baselines/reference/submodule/compiler/namespaceMergedWithFunctionWithOverloadsUsage.errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.namespaceMergedWithFunctionWithOverloadsUsage.errors.txt -+++ new.namespaceMergedWithFunctionWithOverloadsUsage.errors.txt -@@= skipped -0, +0 lines =@@ - index.ts(3,3): error TS2769: No overload matches this call. -- Overload 1 of 2, '(opts?: Whatever): void', gave the following error. -- Argument of type 'number' is not assignable to parameter of type 'Whatever'. -- Overload 2 of 2, '(cb: Function, opts?: Whatever): void', gave the following error. -+ The last overload gave the following error. - Argument of type 'number' is not assignable to parameter of type 'Function'. - - -@@= skipped -10, +8 lines =@@ - X(0); // shouldn't cause a crash - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(opts?: Whatever): void', gave the following error. --!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'Whatever'. --!!! error TS2769: Overload 2 of 2, '(cb: Function, opts?: Whatever): void', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'Function'. -+!!! related TS2771 file.d.ts:8:18: The last overload is declared here. - ==== file.d.ts (0 errors) ==== - declare namespace Foo { - interface Whatever { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt b/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt index b0208b37e7..cf8453f2e8 100644 --- a/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,10 +1,14 @@ -orderMattersForSignatureGroupIdentity.ts(19,5): error TS2769: No overload matches this call. - The last overload gave the following error. +orderMattersForSignatureGroupIdentity.ts(19,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Overload 2 of 2, '(x: { n: number; }): number', gave the following error. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. orderMattersForSignatureGroupIdentity.ts(19,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. -orderMattersForSignatureGroupIdentity.ts(24,5): error TS2769: No overload matches this call. - The last overload gave the following error. +orderMattersForSignatureGroupIdentity.ts(24,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(x: { s: string; }): string', gave the following error. + Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. + Overload 2 of 2, '(x: { n: number; }): number', gave the following error. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. @@ -29,11 +33,12 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower var v: B; v({ s: "", n: 0 }).toLowerCase(); - ~ + ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. !!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. -!!! related TS2771 orderMattersForSignatureGroupIdentity.ts:3:5: The last overload is declared here. ~~~~~~~~~~~ !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. @@ -44,10 +49,11 @@ orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLower !!! related TS6203 orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here. w({ s: "", n: 0 }).toLowerCase(); - ~ + ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. +!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. +!!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. !!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. -!!! related TS2771 orderMattersForSignatureGroupIdentity.ts:3:5: The last overload is declared here. ~~~~~~~~~~~ !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt.diff deleted file mode 100644 index f52b0f4175..0000000000 --- a/testdata/baselines/reference/submodule/compiler/orderMattersForSignatureGroupIdentity.errors.txt.diff +++ /dev/null @@ -1,52 +0,0 @@ ---- old.orderMattersForSignatureGroupIdentity.errors.txt -+++ new.orderMattersForSignatureGroupIdentity.errors.txt -@@= skipped -0, +0 lines =@@ --orderMattersForSignatureGroupIdentity.ts(19,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -- Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -- Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -+orderMattersForSignatureGroupIdentity.ts(19,5): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. - orderMattersForSignatureGroupIdentity.ts(19,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. - orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'. --orderMattersForSignatureGroupIdentity.ts(24,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: { s: string; }): string', gave the following error. -- Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. -- Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -+orderMattersForSignatureGroupIdentity.ts(24,5): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. - orderMattersForSignatureGroupIdentity.ts(24,20): error TS2339: Property 'toLowerCase' does not exist on type 'never'. - -@@= skipped -32, +28 lines =@@ - var v: B; - - v({ s: "", n: 0 }).toLowerCase(); -- ~ -+ ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. --!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. --!!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. -+!!! related TS2771 orderMattersForSignatureGroupIdentity.ts:3:5: The last overload is declared here. - ~~~~~~~~~~~ - !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. - -@@= skipped -16, +15 lines =@@ - !!! related TS6203 orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here. - - w({ s: "", n: 0 }).toLowerCase(); -- ~ -+ ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: { s: string; }): string', gave the following error. --!!! error TS2769: Object literal may only specify known properties, and 'n' does not exist in type '{ s: string; }'. --!!! error TS2769: Overload 2 of 2, '(x: { n: number; }): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. -+!!! related TS2771 orderMattersForSignatureGroupIdentity.ts:3:5: The last overload is declared here. - ~~~~~~~~~~~ - !!! error TS2339: Property 'toLowerCase' does not exist on type 'never'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overload1.errors.txt b/testdata/baselines/reference/submodule/compiler/overload1.errors.txt index b8f28f1f0b..5a000bae8b 100644 --- a/testdata/baselines/reference/submodule/compiler/overload1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overload1.errors.txt @@ -3,8 +3,10 @@ overload1.ts(29,1): error TS2322: Type 'number' is not assignable to type 'strin overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. -overload1.ts(34,9): error TS2769: No overload matches this call. - The last overload gave the following error. +overload1.ts(34,5): error TS2769: No overload matches this call. + Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. + Argument of type 'number' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. @@ -54,11 +56,12 @@ overload1.ts(34,9): error TS2769: No overload matches this call. ~ !!! error TS2322: Type 'C' is not assignable to type 'string'. z=x.h(2,2); // no match - ~ + ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. +!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! related TS2771 overload1.ts:21:9: The last overload is declared here. z=x.h("hello",0); // good var v=x.g; diff --git a/testdata/baselines/reference/submodule/compiler/overload1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overload1.errors.txt.diff deleted file mode 100644 index 673d0192e3..0000000000 --- a/testdata/baselines/reference/submodule/compiler/overload1.errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.overload1.errors.txt -+++ new.overload1.errors.txt -@@= skipped -2, +2 lines =@@ - overload1.ts(31,11): error TS2554: Expected 1-2 arguments, but got 3. - overload1.ts(32,5): error TS2554: Expected 1-2 arguments, but got 0. - overload1.ts(33,1): error TS2322: Type 'C' is not assignable to type 'string'. --overload1.ts(34,5): error TS2769: No overload matches this call. -- Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. -- Argument of type 'number' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. -+overload1.ts(34,9): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. - - -@@= skipped -53, +51 lines =@@ - ~ - !!! error TS2322: Type 'C' is not assignable to type 'string'. - z=x.h(2,2); // no match -- ~ -+ ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(s1: string, s2: number): string', gave the following error. --!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(s1: number, s2: string): number', gave the following error. --!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! related TS2771 overload1.ts:21:9: The last overload is declared here. - z=x.h("hello",0); // good - - var v=x.g; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt b/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt index ab2f3f7cc1..bdaebab061 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt @@ -1,11 +1,17 @@ overloadResolutionTest1.ts(7,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. Type 'string' is not assignable to type 'boolean'. overloadResolutionTest1.ts(18,16): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. Type 'string' is not assignable to type 'boolean'. overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. + Type 'boolean' is not assignable to type 'number'. + Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. Type 'boolean' is not assignable to type 'string'. @@ -19,10 +25,12 @@ overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. var x111 = foo([{a:"s"}]); // error - does not match any signature ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 overloadResolutionTest1.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' !!! related TS6500 overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -!!! related TS2771 overloadResolutionTest1.ts:2:10: The last overload is declared here. !!! related TS2793 overloadResolutionTest1.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -37,10 +45,12 @@ overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. var x4 = foo2({a:"s"}); // error ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 overloadResolutionTest1.ts:12:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' !!! related TS6500 overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -!!! related TS2771 overloadResolutionTest1.ts:13:10: The last overload is declared here. !!! related TS2793 overloadResolutionTest1.ts:14:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. @@ -50,8 +60,10 @@ overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. var x = foo4({a:true}); // error ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. !!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! related TS6500 overloadResolutionTest1.ts:21:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' !!! related TS6500 overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' -!!! related TS2771 overloadResolutionTest1.ts:22:10: The last overload is declared here. !!! related TS2793 overloadResolutionTest1.ts:23:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt.diff deleted file mode 100644 index 82e564cced..0000000000 --- a/testdata/baselines/reference/submodule/compiler/overloadResolutionTest1.errors.txt.diff +++ /dev/null @@ -1,66 +0,0 @@ ---- old.overloadResolutionTest1.errors.txt -+++ new.overloadResolutionTest1.errors.txt -@@= skipped -0, +0 lines =@@ - overloadResolutionTest1.ts(7,18): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. -- Type 'string' is not assignable to type 'number'. -- Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+ The last overload gave the following error. - Type 'string' is not assignable to type 'boolean'. - overloadResolutionTest1.ts(18,16): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. -- Type 'string' is not assignable to type 'number'. -- Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. -+ The last overload gave the following error. - Type 'string' is not assignable to type 'boolean'. - overloadResolutionTest1.ts(24,15): error TS2769: No overload matches this call. -- Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. -- Type 'boolean' is not assignable to type 'number'. -- Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -+ The last overload gave the following error. - Type 'boolean' is not assignable to type 'string'. - - -@@= skipped -24, +18 lines =@@ - var x111 = foo([{a:"s"}]); // error - does not match any signature - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }[]): string', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }[]): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 overloadResolutionTest1.ts:1:19: The expected type comes from property 'a' which is declared here on type '{ a: number; }' - !!! related TS6500 overloadResolutionTest1.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -+!!! related TS2771 overloadResolutionTest1.ts:2:10: The last overload is declared here. - !!! related TS2793 overloadResolutionTest1.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string - -@@= skipped -20, +18 lines =@@ - var x4 = foo2({a:"s"}); // error - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): string', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(bar: { a: boolean; }): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 overloadResolutionTest1.ts:12:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' - !!! related TS6500 overloadResolutionTest1.ts:13:20: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }' -+!!! related TS2771 overloadResolutionTest1.ts:13:10: The last overload is declared here. - !!! related TS2793 overloadResolutionTest1.ts:14:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - - -@@= skipped -15, +13 lines =@@ - var x = foo4({a:true}); // error - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(bar: { a: number; }): number', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(bar: { a: string; }): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! related TS6500 overloadResolutionTest1.ts:21:20: The expected type comes from property 'a' which is declared here on type '{ a: number; }' - !!! related TS6500 overloadResolutionTest1.ts:22:20: The expected type comes from property 'a' which is declared here on type '{ a: string; }' -+!!! related TS2771 overloadResolutionTest1.ts:22:10: The last overload is declared here. - !!! related TS2793 overloadResolutionTest1.ts:23:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt b/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt index e08ed62709..9d95200f9d 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt @@ -1,6 +1,8 @@ overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. overloadingOnConstants2.ts(15,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. + Argument of type '"um"' is not assignable to parameter of type '"hi"'. + Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. Argument of type '"um"' is not assignable to parameter of type '"bye"'. overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. @@ -26,9 +28,10 @@ overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not var c = foo("um", []); // error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. +!!! error TS2769: Argument of type '"um"' is not assignable to parameter of type '"hi"'. +!!! error TS2769: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. !!! error TS2769: Argument of type '"um"' is not assignable to parameter of type '"bye"'. -!!! related TS2771 overloadingOnConstants2.ts:9:10: The last overload is declared here. !!! related TS2793 overloadingOnConstants2.ts:10:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. diff --git a/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt.diff deleted file mode 100644 index 4a27ee515a..0000000000 --- a/testdata/baselines/reference/submodule/compiler/overloadingOnConstants2.errors.txt.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.overloadingOnConstants2.errors.txt -+++ new.overloadingOnConstants2.errors.txt -@@= skipped -0, +0 lines =@@ - overloadingOnConstants2.ts(9,10): error TS2394: This overload signature is not compatible with its implementation signature. - overloadingOnConstants2.ts(15,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. -- Argument of type '"um"' is not assignable to parameter of type '"hi"'. -- Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. -+ The last overload gave the following error. - Argument of type '"um"' is not assignable to parameter of type '"bye"'. - overloadingOnConstants2.ts(19,10): error TS2394: This overload signature is not compatible with its implementation signature. - -@@= skipped -27, +25 lines =@@ - var c = foo("um", []); // error - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: "hi", items: string[]): D', gave the following error. --!!! error TS2769: Argument of type '"um"' is not assignable to parameter of type '"hi"'. --!!! error TS2769: Overload 2 of 2, '(x: "bye", items: string[]): E', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '"um"' is not assignable to parameter of type '"bye"'. -+!!! related TS2771 overloadingOnConstants2.ts:9:10: The last overload is declared here. - !!! related TS2793 overloadingOnConstants2.ts:10:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt b/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt index bc0e42a66f..0332481d73 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt @@ -1,17 +1,36 @@ -overloadresolutionWithConstraintCheckingDeferred.ts(14,26): error TS2769: No overload matches this call. - The last overload gave the following error. +overloadresolutionWithConstraintCheckingDeferred.ts(14,22): error TS2769: No overload matches this call. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Type 'G' is not assignable to type 'number'. + Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'C' but required in type 'D'. + Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. -overloadresolutionWithConstraintCheckingDeferred.ts(16,27): error TS2769: No overload matches this call. - The last overload gave the following error. +overloadresolutionWithConstraintCheckingDeferred.ts(16,23): error TS2769: No overload matches this call. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Type 'G' is not assignable to type 'number'. + Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'C' but required in type 'D'. + Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. + Type 'G' is not assignable to type 'number'. + Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. + Types of parameters 'x' and 'x' are incompatible. + Property 'q' is missing in type 'C' but required in type 'D'. + Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. @@ -33,27 +52,41 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2741: Proper declare function foo(arg: (x: B) => any): number; var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. - ~~~~~~~~~~~~~ + ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2769: Type 'G' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. +!!! related TS6502 overloadresolutionWithConstraintCheckingDeferred.ts:10:27: The expected type comes from the return type of this signature. +!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. ~ !!! error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here. var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. - ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2769: Type 'G' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. +!!! related TS6502 overloadresolutionWithConstraintCheckingDeferred.ts:10:27: The expected type comes from the return type of this signature. +!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. ~~~~~~~~ !!! error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here. @@ -61,12 +94,19 @@ overloadresolutionWithConstraintCheckingDeferred.ts(19,14): error TS2741: Proper var result3: string = foo(x => { // x has type D ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. +!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +!!! error TS2769: Type 'G' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. +!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. +!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. +!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. +!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error ~~~~~~~~ !!! error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. diff --git a/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt.diff index d51c735306..38317c838c 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/overloadresolutionWithConstraintCheckingDeferred.errors.txt.diff @@ -1,32 +1,16 @@ --- old.overloadresolutionWithConstraintCheckingDeferred.errors.txt +++ new.overloadresolutionWithConstraintCheckingDeferred.errors.txt -@@= skipped -0, +0 lines =@@ --overloadresolutionWithConstraintCheckingDeferred.ts(14,22): error TS2769: No overload matches this call. -- Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. -- Type 'G' is not assignable to type 'number'. -- Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. -- Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. -- Types of parameters 'x' and 'x' are incompatible. -- Property 'q' is missing in type 'C' but required in type 'D'. -- Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -+overloadresolutionWithConstraintCheckingDeferred.ts(14,26): error TS2769: No overload matches this call. -+ The last overload gave the following error. +@@= skipped -8, +8 lines =@@ Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. -overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. - Property 'x' is missing in type 'D' but required in type 'A'. --overloadresolutionWithConstraintCheckingDeferred.ts(16,23): error TS2769: No overload matches this call. -- Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. -- Type 'G' is not assignable to type 'number'. -- Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. -- Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. -- Types of parameters 'x' and 'x' are incompatible. -- Property 'q' is missing in type 'C' but required in type 'D'. -- Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. +overloadresolutionWithConstraintCheckingDeferred.ts(14,37): error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. -+overloadresolutionWithConstraintCheckingDeferred.ts(16,27): error TS2769: No overload matches this call. -+ The last overload gave the following error. + overloadresolutionWithConstraintCheckingDeferred.ts(16,23): error TS2769: No overload matches this call. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Type 'G' is not assignable to type 'number'. +@@= skipped -13, +12 lines =@@ Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. @@ -34,15 +18,9 @@ - Property 'x' is missing in type 'D' but required in type 'A'. +overloadresolutionWithConstraintCheckingDeferred.ts(16,38): error TS2741: Property 'x' is missing in type 'D' but required in type 'A'. overloadresolutionWithConstraintCheckingDeferred.ts(18,27): error TS2769: No overload matches this call. -- Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. -- Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. -- Type 'G' is not assignable to type 'number'. -- Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. -- Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. -- Types of parameters 'x' and 'x' are incompatible. -- Property 'q' is missing in type 'C' but required in type 'D'. -- Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -+ The last overload gave the following error. + Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. + Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. +@@= skipped -14, +13 lines =@@ Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. Types of parameters 'x' and 'x' are incompatible. Property 'q' is missing in type 'B' but required in type 'D'. @@ -52,29 +30,9 @@ ==== overloadresolutionWithConstraintCheckingDeferred.ts (6 errors) ==== -@@= skipped -54, +32 lines =@@ - declare function foo(arg: (x: B) => any): number; - - var result: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -- ~~~ -+ ~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. --!!! error TS2769: Type 'G' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. --!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. --!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. --!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. --!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. - !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. --!!! related TS6502 overloadresolutionWithConstraintCheckingDeferred.ts:10:27: The expected type comes from the return type of this signature. --!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. --!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -+!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -+!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. +@@= skipped -35, +34 lines =@@ + !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. + !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. ~ -!!! error TS2345: Argument of type 'D' is not assignable to parameter of type 'A'. -!!! error TS2345: Property 'x' is missing in type 'D' but required in type 'A'. @@ -82,25 +40,9 @@ !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here. var result2: number = foo(x => new G(x)); // x has type D, new G(x) fails, so first overload is picked. -- ~~~ -+ ~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. --!!! error TS2769: Type 'G' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. --!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. --!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. --!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. --!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. - !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. --!!! related TS6502 overloadresolutionWithConstraintCheckingDeferred.ts:10:27: The expected type comes from the return type of this signature. --!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. --!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -+!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -+!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. +@@= skipped -21, +20 lines =@@ + !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. + !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. ~~~~~~~~ -!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. -!!! error TS2344: Property 'x' is missing in type 'D' but required in type 'A'. @@ -108,23 +50,8 @@ !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:1:15: 'x' is declared here. var result3: string = foo(x => { // x has type D - ~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(arg: (x: D) => number): string', gave the following error. --!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: D) => number'. --!!! error TS2769: Type 'G' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 3, '(arg: (x: C) => any): string', gave the following error. --!!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: C) => any'. --!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. --!!! error TS2769: Property 'q' is missing in type 'C' but required in type 'D'. --!!! error TS2769: Overload 3 of 3, '(arg: (x: B) => any): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '(x: D) => G' is not assignable to parameter of type '(x: B) => any'. - !!! error TS2769: Types of parameters 'x' and 'x' are incompatible. - !!! error TS2769: Property 'q' is missing in type 'B' but required in type 'D'. +@@= skipped -22, +21 lines =@@ !!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. --!!! related TS2728 overloadresolutionWithConstraintCheckingDeferred.ts:4:15: 'q' is declared here. -+!!! related TS2771 overloadresolutionWithConstraintCheckingDeferred.ts:12:18: The last overload is declared here. var y: G; // error that D does not satisfy constraint, y is of type G, entire call to foo is an error ~~~~~~~~ -!!! error TS2344: Type 'D' does not satisfy the constraint 'A'. diff --git a/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt b/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt index fd307f3b38..2cbb7768d0 100644 --- a/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt @@ -1,9 +1,13 @@ -overloadsWithProvisionalErrors.ts(6,11): error TS2769: No overload matches this call. - The last overload gave the following error. +overloadsWithProvisionalErrors.ts(6,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. -overloadsWithProvisionalErrors.ts(8,11): error TS2769: No overload matches this call. - The last overload gave the following error. +overloadsWithProvisionalErrors.ts(8,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(s: string): number', gave the following error. + Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. @@ -15,22 +19,24 @@ overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. }; func(s => ({})); // Error for no applicable overload (object type is missing a and b) - ~~~~ + ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2769: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2769: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b !!! related TS6502 overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. -!!! related TS2771 overloadsWithProvisionalErrors.ts:3:5: The last overload is declared here. func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) ~~~~ !!! error TS2304: Cannot find name 'blah'. func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway - ~~~~~~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error. +!!! error TS2769: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. !!! error TS2769: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. !!! related TS2728 overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. !!! related TS6502 overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. -!!! related TS2771 overloadsWithProvisionalErrors.ts:3:5: The last overload is declared here. ~~~~ !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt.diff deleted file mode 100644 index fc3916f599..0000000000 --- a/testdata/baselines/reference/submodule/compiler/overloadsWithProvisionalErrors.errors.txt.diff +++ /dev/null @@ -1,51 +0,0 @@ ---- old.overloadsWithProvisionalErrors.errors.txt -+++ new.overloadsWithProvisionalErrors.errors.txt -@@= skipped -0, +0 lines =@@ --overloadsWithProvisionalErrors.ts(6,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(s: string): number', gave the following error. -- Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -+overloadsWithProvisionalErrors.ts(6,11): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b - overloadsWithProvisionalErrors.ts(7,17): error TS2304: Cannot find name 'blah'. --overloadsWithProvisionalErrors.ts(8,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(s: string): number', gave the following error. -- Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -+overloadsWithProvisionalErrors.ts(8,11): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. - overloadsWithProvisionalErrors.ts(8,17): error TS2304: Cannot find name 'blah'. - -@@= skipped -18, +14 lines =@@ - }; - - func(s => ({})); // Error for no applicable overload (object type is missing a and b) -- ~~~~ -+ ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error. --!!! error TS2769: Argument of type '(s: string) => {}' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{}' is missing the following properties from type '{ a: number; b: number; }': a, b - !!! related TS6502 overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. -+!!! related TS2771 overloadsWithProvisionalErrors.ts:3:5: The last overload is declared here. - func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) - ~~~~ - !!! error TS2304: Cannot find name 'blah'. - func(s => ({ a: blah })); // Two errors here, one for blah not being defined, and one for the overload since it would not be applicable anyway -- ~~~~ -+ ~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(s: string): number', gave the following error. --!!! error TS2769: Argument of type '(s: string) => { a: any; }' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(lambda: (s: string) => { a: number; b: number; }): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Property 'b' is missing in type '{ a: any; }' but required in type '{ a: number; b: number; }'. - !!! related TS2728 overloadsWithProvisionalErrors.ts:3:42: 'b' is declared here. - !!! related TS6502 overloadsWithProvisionalErrors.ts:3:14: The expected type comes from the return type of this signature. -+!!! related TS2771 overloadsWithProvisionalErrors.ts:3:5: The last overload is declared here. - ~~~~ - !!! error TS2304: Cannot find name 'blah'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt index 303478595a..ead6a505fd 100644 --- a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,15 +1,26 @@ reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. + Overload 2 of 2, 'new (props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. @@ -44,12 +55,16 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches const Test2 = () => console.log(value)} />; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedback', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedback', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' !!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. class FieldFeedbackBeta

extends React.Component

{ static defaultProps: BaseProps = { @@ -68,12 +83,16 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches const Test2a = () => console.log(value)} error>Hah; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedbackBeta', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedbackBeta', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! error TS2769: Type 'void' is not assignable to type 'boolean'. !!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. +!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -97,11 +116,14 @@ reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches const Test4 = () => console.log(value)} />; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedback2', gave the following error. +!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2769: Type 'void' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, 'new (props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! error TS2769: Type 'void' is not assignable to type 'boolean'. !!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. +!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' // OK const Test5 = () => ; diff --git a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt.diff index 29f526b4ad..6305491e76 100644 --- a/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/reactDefaultPropsInferenceSuccess.errors.txt.diff @@ -3,96 +3,74 @@ @@= skipped -0, +0 lines =@@ reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. -- Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -- Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -- Type 'void' is not assignable to type 'boolean'. ++ Overload 1 of 2, 'new (props: Readonly): FieldFeedback', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. - Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedback', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. -- Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -- Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -- Type 'void' is not assignable to type 'boolean'. ++ Overload 1 of 2, 'new (props: Readonly): FieldFeedbackBeta', gave the following error. + Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. - Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedbackBeta', gave the following error. Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. -- Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -- Type 'void' is not assignable to type 'boolean'. ++ Overload 1 of 2, 'new (props: Readonly): FieldFeedback2', gave the following error. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. - Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -@@= skipped -54, +43 lines =@@ +@@= skipped -54, +54 lines =@@ const Test2 = () => console.log(value)} />; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedback', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. -!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedback', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -+!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -+!!! error TS2769: Type 'void' is not assignable to type 'boolean'. -+!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. - - class FieldFeedbackBeta

extends React.Component

{ - static defaultProps: BaseProps = { -@@= skipped -28, +24 lines =@@ ++!!! error TS2769: Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedback', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. +@@= skipped -28, +28 lines =@@ const Test2a = () => console.log(value)} error>Hah; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedbackBeta', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedbackBeta', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. -!!! error TS2769: Overload 2 of 2, '(props: Props, context?: any): FieldFeedbackBeta', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. -+!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -+!!! error TS2769: Type 'void' is not assignable to type 'boolean'. -+!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, keyof Props>> & Partial>' -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. - - interface MyPropsProps extends Props { - when: (value: string) => boolean; -@@= skipped -33, +29 lines =@@ ++!!! error TS2769: Overload 2 of 2, 'new (props: Props, context?: any): FieldFeedbackBeta', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. +@@= skipped -33, +33 lines =@@ const Test4 = () => console.log(value)} />; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly): FieldFeedback2', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): FieldFeedback2', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. -!!! error TS2769: Overload 2 of 2, '(props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. --!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. --!!! error TS2769: Type 'void' is not assignable to type 'boolean'. --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' --!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -+!!! error TS2769: Type 'void' is not assignable to type 'boolean'. -+!!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. - - // OK - const Test5 = () => ; \ No newline at end of file ++!!! error TS2769: Overload 2 of 2, 'new (props: MyPropsProps, context?: any): FieldFeedback2', gave the following error. + !!! error TS2769: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + !!! error TS2769: Type 'void' is not assignable to type 'boolean'. + !!! related TS6500 reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt b/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt index 1ca76ef9f4..024ccdcba5 100644 --- a/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt @@ -12,7 +12,11 @@ recursiveFunctionTypes.ts(33,8): error TS2554: Expected 0-1 arguments, but got 2 recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. recursiveFunctionTypes.ts(43,4): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. + Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. + Overload 2 of 4, '(a: number): number', gave the following error. + Argument of type 'string' is not assignable to parameter of type 'number'. + Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. @@ -89,7 +93,10 @@ recursiveFunctionTypes.ts(43,4): error TS2769: No overload matches this call. f7(""); // ok (function takes an any param) ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. +!!! error TS2769: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. +!!! error TS2769: Overload 2 of 4, '(a: number): number', gave the following error. +!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. !!! error TS2769: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -!!! related TS2771 recursiveFunctionTypes.ts:40:18: The last overload is declared here. f7(); // ok \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt.diff deleted file mode 100644 index a6d7e4906a..0000000000 --- a/testdata/baselines/reference/submodule/compiler/recursiveFunctionTypes.errors.txt.diff +++ /dev/null @@ -1,29 +0,0 @@ ---- old.recursiveFunctionTypes.errors.txt -+++ new.recursiveFunctionTypes.errors.txt -@@= skipped -11, +11 lines =@@ - recursiveFunctionTypes.ts(34,4): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f6; (a: typeof f6): () => number; }'. - recursiveFunctionTypes.ts(42,8): error TS2554: Expected 0-1 arguments, but got 2. - recursiveFunctionTypes.ts(43,4): error TS2769: No overload matches this call. -- Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. -- Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -- Overload 2 of 4, '(a: number): number', gave the following error. -- Argument of type 'string' is not assignable to parameter of type 'number'. -- Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. -+ The last overload gave the following error. - Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. - - -@@= skipped -81, +77 lines =@@ - f7(""); // ok (function takes an any param) - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(a: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): () => number', gave the following error. --!!! error TS2769: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. --!!! error TS2769: Overload 2 of 4, '(a: number): number', gave the following error. --!!! error TS2769: Argument of type 'string' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 3 of 4, '(a?: { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }): { (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }', gave the following error. --!!! error TS2769: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type 'string' is not assignable to parameter of type '{ (): typeof f7; (a: typeof f7): () => number; (a: number): number; (a?: typeof f7): typeof f7; }'. -+!!! related TS2771 recursiveFunctionTypes.ts:40:18: The last overload is declared here. - f7(); // ok \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt b/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt index e0e72173ce..9240d3cd51 100644 --- a/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt @@ -1,5 +1,9 @@ signatureLengthMismatchInOverload.ts(5,3): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. + Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. + Types of parameters 'arg' and 'arg' are incompatible. + Type 'string' is not assignable to type 'number'. + Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. Target signature provides too few arguments. Expected 2 or more, but got 1. @@ -12,9 +16,12 @@ signatureLengthMismatchInOverload.ts(5,3): error TS2769: No overload matches thi f((arg: number, arg2: number) => {}); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. +!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. +!!! error TS2769: Types of parameters 'arg' and 'arg' are incompatible. +!!! error TS2769: Type 'string' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. !!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. !!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. -!!! related TS2771 signatureLengthMismatchInOverload.ts:2:10: The last overload is declared here. !!! related TS2793 signatureLengthMismatchInOverload.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt.diff deleted file mode 100644 index 41814ec6b2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/signatureLengthMismatchInOverload.errors.txt.diff +++ /dev/null @@ -1,28 +0,0 @@ ---- old.signatureLengthMismatchInOverload.errors.txt -+++ new.signatureLengthMismatchInOverload.errors.txt -@@= skipped -0, +0 lines =@@ - signatureLengthMismatchInOverload.ts(5,3): error TS2769: No overload matches this call. -- Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. -- Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. -- Types of parameters 'arg' and 'arg' are incompatible. -- Type 'string' is not assignable to type 'number'. -- Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. -+ The last overload gave the following error. - Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. - Target signature provides too few arguments. Expected 2 or more, but got 1. - -@@= skipped -15, +11 lines =@@ - f((arg: number, arg2: number) => {}); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(callback: (arg: string, arg2: string) => void): void', gave the following error. --!!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: string, arg2: string) => void'. --!!! error TS2769: Types of parameters 'arg' and 'arg' are incompatible. --!!! error TS2769: Type 'string' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(callback: (arg: number) => void): void', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '(arg: number, arg2: number) => void' is not assignable to parameter of type '(arg: number) => void'. - !!! error TS2769: Target signature provides too few arguments. Expected 2 or more, but got 1. -+!!! related TS2771 signatureLengthMismatchInOverload.ts:2:10: The last overload is declared here. - !!! related TS2793 signatureLengthMismatchInOverload.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt b/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt index 6b9503e289..234f36b61c 100644 --- a/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt @@ -1,8 +1,16 @@ -specializedSignatureAsCallbackParameter1.ts(7,4): error TS2769: No overload matches this call. - The last overload gave the following error. +specializedSignatureAsCallbackParameter1.ts(7,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. -specializedSignatureAsCallbackParameter1.ts(8,4): error TS2769: No overload matches this call. - The last overload gave the following error. +specializedSignatureAsCallbackParameter1.ts(8,1): error TS2769: No overload matches this call. + Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. + Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. + Types of parameters 'x' and 'x' are incompatible. + Type 'number' is not assignable to type '"hm"'. + Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. Argument of type 'number' is not assignable to parameter of type 'string'. @@ -14,14 +22,20 @@ specializedSignatureAsCallbackParameter1.ts(8,4): error TS2769: No overload matc } // both are errors x3(1, (x: string) => 1); - ~ + ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2769: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! related TS2771 specializedSignatureAsCallbackParameter1.ts:2:10: The last overload is declared here. x3(1, (x: 'hm') => 1); - ~ + ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! related TS2771 specializedSignatureAsCallbackParameter1.ts:2:10: The last overload is declared here. \ No newline at end of file +!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. +!!! error TS2769: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. +!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2769: Type 'number' is not assignable to type '"hm"'. +!!! error TS2769: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. +!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt.diff deleted file mode 100644 index b6425785c4..0000000000 --- a/testdata/baselines/reference/submodule/compiler/specializedSignatureAsCallbackParameter1.errors.txt.diff +++ /dev/null @@ -1,50 +0,0 @@ ---- old.specializedSignatureAsCallbackParameter1.errors.txt -+++ new.specializedSignatureAsCallbackParameter1.errors.txt -@@= skipped -0, +0 lines =@@ --specializedSignatureAsCallbackParameter1.ts(7,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -- Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. -- Types of parameters 'x' and 'x' are incompatible. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -+specializedSignatureAsCallbackParameter1.ts(7,4): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. --specializedSignatureAsCallbackParameter1.ts(8,1): error TS2769: No overload matches this call. -- Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. -- Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. -- Types of parameters 'x' and 'x' are incompatible. -- Type 'number' is not assignable to type '"hm"'. -- Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -+specializedSignatureAsCallbackParameter1.ts(8,4): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. - - -@@= skipped -21, +13 lines =@@ - } - // both are errors - x3(1, (x: string) => 1); -- ~~ -+ ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. --!!! error TS2769: Argument of type '(x: string) => number' is not assignable to parameter of type '(x: number) => number'. --!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! related TS2771 specializedSignatureAsCallbackParameter1.ts:2:10: The last overload is declared here. - x3(1, (x: 'hm') => 1); -- ~~ -+ ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(a: number, cb: (x: number) => number): any', gave the following error. --!!! error TS2769: Argument of type '(x: "hm") => number' is not assignable to parameter of type '(x: number) => number'. --!!! error TS2769: Types of parameters 'x' and 'x' are incompatible. --!!! error TS2769: Type 'number' is not assignable to type '"hm"'. --!!! error TS2769: Overload 2 of 2, '(a: string, cb: (x: number) => number): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -+!!! related TS2771 specializedSignatureAsCallbackParameter1.ts:2:10: The last overload is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt index 2c5fe38ca6..bed92fd941 100644 --- a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt @@ -7,13 +7,19 @@ spellingSuggestionJSXAttribute.tsx(10,8): error TS2322: Type '{ for: string; }' spellingSuggestionJSXAttribute.tsx(11,8): error TS2322: Type '{ for: string; class: string; }' is not assignable to type 'DetailedHTMLProps, HTMLLabelElement>'. Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? spellingSuggestionJSXAttribute.tsx(12,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? + Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? spellingSuggestionJSXAttribute.tsx(13,10): error TS2322: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Property 'class' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'className'? spellingSuggestionJSXAttribute.tsx(14,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? + Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. @@ -47,10 +53,12 @@ spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' ; ~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. +!!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. +!!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? +!!! error TS2769: Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. !!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. !!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. ; ~~~~~ !!! error TS2322: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. @@ -58,10 +66,12 @@ spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' ; ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. +!!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. +!!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? +!!! error TS2769: Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. !!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. !!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. ; ~~~ !!! error TS2322: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. diff --git a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt.diff index 4acf06f412..4820f90af7 100644 --- a/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/spellingSuggestionJSXAttribute.errors.txt.diff @@ -5,54 +5,48 @@ Property 'for' does not exist on type 'DetailedHTMLProps, HTMLLabelElement>'. Did you mean 'htmlFor'? spellingSuggestionJSXAttribute.tsx(12,9): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. -- Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. -- Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? ++ Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? - Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? spellingSuggestionJSXAttribute.tsx(13,10): error TS2322: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Property 'class' does not exist on type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. Did you mean 'className'? spellingSuggestionJSXAttribute.tsx(14,9): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. -- Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. -- Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? ++ Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? - Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? spellingSuggestionJSXAttribute.tsx(15,10): error TS2322: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. -@@= skipped -46, +40 lines =@@ +@@= skipped -46, +46 lines =@@ ; ~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. --!!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. --!!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + !!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + !!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? -!!! error TS2769: Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. --!!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. --!!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. -+!!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. ++!!! error TS2769: Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. + !!! error TS2769: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + !!! error TS2769: Property 'class' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'className'? ; - ~~~~~ - !!! error TS2322: Type '{ class: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. -@@= skipped -13, +11 lines =@@ +@@= skipped -13, +13 lines =@@ ; ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. --!!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. --!!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly<{ className?: string; htmlFor?: string; }>): MyComp', gave the following error. + !!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + !!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? -!!! error TS2769: Overload 2 of 2, '(props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. --!!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. --!!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. -+!!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. - ; - ~~~ - !!! error TS2322: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & { className?: string; htmlFor?: string; }'. \ No newline at end of file ++!!! error TS2769: Overload 2 of 2, 'new (props: { className?: string; htmlFor?: string; }, context?: any): MyComp', gave the following error. + !!! error TS2769: Type '{ for: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. + !!! error TS2769: Property 'for' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ className?: string; htmlFor?: string; }>'. Did you mean 'htmlFor'? + ; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt index d24ac87a03..63d40fdc1e 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -1,12 +1,17 @@ tsxNotUsingApparentTypeOfSFC.tsx(14,14): error TS2322: Type '{}' is not assignable to type 'P'. 'P' could be instantiated with an arbitrary type which could be unrelated to '{}'. tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. + Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. tsxNotUsingApparentTypeOfSFC.tsx(17,14): error TS2322: Type 'P' is not assignable to type 'IntrinsicAttributes & P'. Type 'P' is not assignable to type 'IntrinsicAttributes'. tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. + Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. + Type 'P' is not assignable to type 'IntrinsicAttributes'. + Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. Type 'P' is not assignable to type 'IntrinsicAttributes'. @@ -32,9 +37,10 @@ tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this let y = ; // should error ~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. +!!! error TS2769: Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. let z = // should work ~~~~~ @@ -44,10 +50,14 @@ tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this let q = // should work ~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. !!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. !!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. +!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. +!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'. +!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes` constraint. +!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

` constraint. !!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes` constraint. !!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

` constraint. -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt.diff index eb638913f4..b072eb38a3 100644 --- a/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/tsxNotUsingApparentTypeOfSFC.errors.txt.diff @@ -5,32 +5,33 @@ 'P' could be instantiated with an arbitrary type which could be unrelated to '{}'. tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. -- Type '{}' is not assignable to type 'Readonly

'. ++ Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. + Type '{}' is not assignable to type 'Readonly

'. - Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. tsxNotUsingApparentTypeOfSFC.tsx(17,14): error TS2322: Type 'P' is not assignable to type 'IntrinsicAttributes & P'. Type 'P' is not assignable to type 'IntrinsicAttributes'. tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. -- Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. -- Type 'P' is not assignable to type 'IntrinsicAttributes'. ++ Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. + Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. + Type 'P' is not assignable to type 'IntrinsicAttributes'. - Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. Type 'P' is not assignable to type 'IntrinsicAttributes'. -@@= skipped -36, +31 lines =@@ +@@= skipped -36, +36 lines =@@ let y = ; // should error ~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. --!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. + !!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. -!!! error TS2769: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. --!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. ++!!! error TS2769: Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. + !!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. let z = // should work ~~~~~ @@ -51,10 +52,14 @@ -!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes & JSX.IntrinsicClassAttributes & Readonly<{ children?: React.ReactNode; }> & Readonly

` constraint. -!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes` constraint. -!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends JSX.IntrinsicAttributes & JSX.IntrinsicClassAttributes & Readonly<{ children?: React.ReactNode; }> & Readonly

` constraint. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly

): MyComponent', gave the following error. +!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. +!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'. ++!!! error TS2769: Overload 2 of 2, 'new (props: P, context?: any): MyComponent', gave the following error. ++!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. ++!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'. ++!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes` constraint. ++!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

` constraint. +!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes` constraint. +!!! related TS2208 tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter might need an `extends IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

` constraint. -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt b/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt index dc754dd839..f3070567b8 100644 --- a/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt @@ -1,5 +1,9 @@ -underscoreTest1_underscoreTests.ts(26,7): error TS2769: No overload matches this call. - The last overload gave the following error. +underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this call. + Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. + Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. + Type 'string | number | boolean' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. + Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. Index signature for type 'string' is missing in type '(string | number | boolean)[]'. @@ -31,12 +35,15 @@ underscoreTest1_underscoreTests.ts(26,7): error TS2769: No overload matches this var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); _.all([true, 1, null, 'yes'], _.identity); - ~~~~~~~~~~~~~~~~~~~~~~ + ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. +!!! error TS2769: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. +!!! error TS2769: Type 'string | number | boolean' is not assignable to type 'boolean'. +!!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. !!! error TS2769: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. !!! error TS2769: Index signature for type 'string' is missing in type '(string | number | boolean)[]'. -!!! related TS2771 underscoreTest1_underscore.ts:452:9: The last overload is declared here. _.any([null, 0, 'yes', false]); diff --git a/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt.diff deleted file mode 100644 index ecd9b662a2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/underscoreTest1.errors.txt.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- old.underscoreTest1.errors.txt -+++ new.underscoreTest1.errors.txt -@@= skipped -0, +0 lines =@@ --underscoreTest1_underscoreTests.ts(26,3): error TS2769: No overload matches this call. -- Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. -- Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. -- Type 'string | number | boolean' is not assignable to type 'boolean'. -- Type 'string' is not assignable to type 'boolean'. -- Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. -+underscoreTest1_underscoreTests.ts(26,7): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. - Index signature for type 'string' is missing in type '(string | number | boolean)[]'. - -@@= skipped -34, +30 lines =@@ - var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); - - _.all([true, 1, null, 'yes'], _.identity); -- ~~~ -+ ~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(list: (string | number | boolean)[], iterator?: Iterator_, context?: any): boolean', gave the following error. --!!! error TS2769: Argument of type '(value: T) => T' is not assignable to parameter of type 'Iterator_'. --!!! error TS2769: Type 'string | number | boolean' is not assignable to type 'boolean'. --!!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! error TS2769: Overload 2 of 2, '(list: Dictionary, iterator?: Iterator_, context?: any): boolean', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type 'Dictionary'. - !!! error TS2769: Index signature for type 'string' is missing in type '(string | number | boolean)[]'. -+!!! related TS2771 underscoreTest1_underscore.ts:452:9: The last overload is declared here. - - _.any([null, 0, 'yes', false]); - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt index 34e2b2bb7d..080ef43a70 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt @@ -1,5 +1,10 @@ checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (props: Readonly): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. + Source has 3 element(s) but target allows only 2. + Overload 2 of 2, 'new (props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. @@ -26,12 +31,16 @@ checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches thi const testErr = ~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): ResizablePanel', gave the following error. +!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. +!!! error TS2769: Types of property 'children' are incompatible. +!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. +!!! error TS2769: Source has 3 element(s) but target allows only 2. +!!! error TS2769: Overload 2 of 2, 'new (props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. !!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. !!! error TS2769: Types of property 'children' are incompatible. !!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. !!! error TS2769: Source has 3 element(s) but target allows only 2. -!!! related TS2771 react16.d.ts:357:13: The last overload is declared here.

diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt.diff index 72b946597e..0b3d22e2e6 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenCanBeTupleType.errors.txt.diff @@ -3,35 +3,28 @@ @@= skipped -0, +0 lines =@@ checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. -- Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -- Types of property 'children' are incompatible. -- Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -- Source has 3 element(s) but target allows only 2. ++ Overload 1 of 2, 'new (props: Readonly): ResizablePanel', gave the following error. + Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + Types of property 'children' are incompatible. + Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. + Source has 3 element(s) but target allows only 2. - Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. Types of property 'children' are incompatible. Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -@@= skipped -30, +25 lines =@@ +@@= skipped -30, +30 lines =@@ const testErr = ~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly): ResizablePanel', gave the following error. --!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. --!!! error TS2769: Types of property 'children' are incompatible. --!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. --!!! error TS2769: Source has 3 element(s) but target allows only 2. ++!!! error TS2769: Overload 1 of 2, 'new (props: Readonly): ResizablePanel', gave the following error. + !!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + !!! error TS2769: Types of property 'children' are incompatible. + !!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. + !!! error TS2769: Source has 3 element(s) but target allows only 2. -!!! error TS2769: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. --!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. --!!! error TS2769: Types of property 'children' are incompatible. --!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. --!!! error TS2769: Source has 3 element(s) but target allows only 2. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. -+!!! error TS2769: Types of property 'children' are incompatible. -+!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. -+!!! error TS2769: Source has 3 element(s) but target allows only 2. -+!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. -
-
-
\ No newline at end of file ++!!! error TS2769: Overload 2 of 2, 'new (props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error. + !!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly'. + !!! error TS2769: Types of property 'children' are incompatible. + !!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt b/testdata/baselines/reference/submodule/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt index 93bce755b0..2747fbf3e9 100644 --- a/testdata/baselines/reference/submodule/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt @@ -1,17 +1,29 @@ file.tsx(27,64): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -file.tsx(28,24): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(28,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. file.tsx(29,43): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -file.tsx(30,36): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(30,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. file.tsx(33,65): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. @@ -50,31 +62,39 @@ file.tsx(36,44): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assi const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" ~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2771 file.tsx:17:17: The last overload is declared here. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" - ~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2771 file.tsx:17:17: The last overload is declared here. const b3 = ; // goTo has type"home" | "contact" ~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2771 file.tsx:17:17: The last overload is declared here. const b4 = ; // goTo has type "home" | "contact" - ~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. !!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -!!! related TS2771 file.tsx:17:17: The last overload is declared here. export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } const c1 = {console.log(k)}}} extra />; // k has type any diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt index d4714e8fd9..86a61d69ea 100644 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt @@ -3,11 +3,17 @@ controlFlowIterationErrors.ts(11,17): error TS2345: Argument of type 'string | n controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. controlFlowIterationErrors.ts(34,17): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. controlFlowIterationErrors.ts(45,17): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(x: string): number', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): string', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. @@ -55,10 +61,12 @@ controlFlowIterationErrors.ts(45,17): error TS2769: No overload matches this cal x = foo(x); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. !!! error TS2769: Type 'string' is not assignable to type 'number'. -!!! related TS2771 controlFlowIterationErrors.ts:28:18: The last overload is declared here. x; } x; @@ -72,10 +80,12 @@ controlFlowIterationErrors.ts(45,17): error TS2769: No overload matches this cal x = foo(x); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. +!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. !!! error TS2769: Type 'string' is not assignable to type 'number'. -!!! related TS2771 controlFlowIterationErrors.ts:28:18: The last overload is declared here. } x; } diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt.diff deleted file mode 100644 index fdf82697bc..0000000000 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrors.errors.txt.diff +++ /dev/null @@ -1,52 +0,0 @@ ---- old.controlFlowIterationErrors.errors.txt -+++ new.controlFlowIterationErrors.errors.txt -@@= skipped -2, +2 lines =@@ - controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. - Type 'number' is not assignable to type 'string'. - controlFlowIterationErrors.ts(34,17): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: string): number', gave the following error. -- Argument of type 'string | number' is not assignable to parameter of type 'string'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(x: number): string', gave the following error. -+ The last overload gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. - controlFlowIterationErrors.ts(45,17): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: string): number', gave the following error. -- Argument of type 'string | number' is not assignable to parameter of type 'string'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(x: number): string', gave the following error. -+ The last overload gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. - -@@= skipped -58, +52 lines =@@ - x = foo(x); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. --!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. - !!! error TS2769: Type 'string' is not assignable to type 'number'. -+!!! related TS2771 controlFlowIterationErrors.ts:28:18: The last overload is declared here. - x; - } - x; -@@= skipped -19, +17 lines =@@ - x = foo(x); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error. --!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. - !!! error TS2769: Type 'string' is not assignable to type 'number'. -+!!! related TS2771 controlFlowIterationErrors.ts:28:18: The last overload is declared here. - } - x; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt index 1146f72171..95ca9d9385 100644 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt @@ -3,11 +3,17 @@ controlFlowIterationErrorsAsync.ts(11,23): error TS2345: Argument of type 'strin controlFlowIterationErrorsAsync.ts(22,23): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. controlFlowIterationErrorsAsync.ts(34,23): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(x: string): Promise', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): Promise', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. controlFlowIterationErrorsAsync.ts(45,23): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(x: string): Promise', gave the following error. + Argument of type 'string | number' is not assignable to parameter of type 'string'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(x: number): Promise', gave the following error. Argument of type 'string | number' is not assignable to parameter of type 'number'. Type 'string' is not assignable to type 'number'. @@ -55,10 +61,12 @@ controlFlowIterationErrorsAsync.ts(45,23): error TS2769: No overload matches thi x = await foo(x); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: string): Promise', gave the following error. +!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(x: number): Promise', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. !!! error TS2769: Type 'string' is not assignable to type 'number'. -!!! related TS2771 controlFlowIterationErrorsAsync.ts:28:18: The last overload is declared here. x; } x; @@ -72,10 +80,12 @@ controlFlowIterationErrorsAsync.ts(45,23): error TS2769: No overload matches thi x = await foo(x); ~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(x: string): Promise', gave the following error. +!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(x: number): Promise', gave the following error. !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. !!! error TS2769: Type 'string' is not assignable to type 'number'. -!!! related TS2771 controlFlowIterationErrorsAsync.ts:28:18: The last overload is declared here. } x; } diff --git a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt.diff deleted file mode 100644 index 818f87c8e4..0000000000 --- a/testdata/baselines/reference/submodule/conformance/controlFlowIterationErrorsAsync.errors.txt.diff +++ /dev/null @@ -1,52 +0,0 @@ ---- old.controlFlowIterationErrorsAsync.errors.txt -+++ new.controlFlowIterationErrorsAsync.errors.txt -@@= skipped -2, +2 lines =@@ - controlFlowIterationErrorsAsync.ts(22,23): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. - Type 'number' is not assignable to type 'string'. - controlFlowIterationErrorsAsync.ts(34,23): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: string): Promise', gave the following error. -- Argument of type 'string | number' is not assignable to parameter of type 'string'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(x: number): Promise', gave the following error. -+ The last overload gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. - controlFlowIterationErrorsAsync.ts(45,23): error TS2769: No overload matches this call. -- Overload 1 of 2, '(x: string): Promise', gave the following error. -- Argument of type 'string | number' is not assignable to parameter of type 'string'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(x: number): Promise', gave the following error. -+ The last overload gave the following error. - Argument of type 'string | number' is not assignable to parameter of type 'number'. - Type 'string' is not assignable to type 'number'. - -@@= skipped -58, +52 lines =@@ - x = await foo(x); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: string): Promise', gave the following error. --!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(x: number): Promise', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. - !!! error TS2769: Type 'string' is not assignable to type 'number'. -+!!! related TS2771 controlFlowIterationErrorsAsync.ts:28:18: The last overload is declared here. - x; - } - x; -@@= skipped -19, +17 lines =@@ - x = await foo(x); - ~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(x: string): Promise', gave the following error. --!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(x: number): Promise', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'. - !!! error TS2769: Type 'string' is not assignable to type 'number'. -+!!! related TS2771 controlFlowIterationErrorsAsync.ts:28:18: The last overload is declared here. - } - x; - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt b/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt index 9b25b5eb78..b8b768d49f 100644 --- a/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt @@ -1,15 +1,34 @@ -for-of39.ts(1,25): error TS2769: No overload matches this call. - The last overload gave the following error. +for-of39.ts(1,11): error TS2769: No overload matches this call. + Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type 'boolean' is not assignable to type 'number'. + Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'boolean' is not assignable to type 'number'. ==== for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); - ~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. +!!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. +!!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. +!!! error TS2769: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. +!!! error TS2769: Type 'boolean' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. for (var [k, v] of map) { k; v; diff --git a/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt.diff index f627715623..0c80ca8ae3 100644 --- a/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/for-of39.errors.txt.diff @@ -3,40 +3,36 @@ @@= skipped -0, +0 lines =@@ -for-of39.ts(1,15): error TS2769: No overload matches this call. - Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. -- Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. -- The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -- Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. -- Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. -- Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. -- Type at position 1 in source is not compatible with type at position 1 in target. -- Type 'boolean' is not assignable to type 'number'. ++for-of39.ts(1,11): error TS2769: No overload matches this call. ++ Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +@@= skipped -8, +8 lines =@@ + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type 'boolean' is not assignable to type 'number'. - Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -+for-of39.ts(1,25): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'boolean' is not assignable to type 'number'. ==== for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); - ~~~ -+ ~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. --!!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. --!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. --!!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. --!!! error TS2769: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. --!!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. --!!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. --!!! error TS2769: Type 'boolean' is not assignable to type 'number'. ++!!! error TS2769: Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + !!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + !!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + !!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +@@= skipped -18, +18 lines =@@ + !!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + !!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. + !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -!!! error TS2769: Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -+!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. for (var [k, v] of map) { - k; - v; \ No newline at end of file + k; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt b/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt index 8471e197a2..653b071b3b 100644 --- a/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt @@ -2,17 +2,33 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(23,38): error TS2345: Ar Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'string'. genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. + Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. + Type 'Promise' is not assignable to type 'Promise'. + Type 'number' is not assignable to type 'boolean'. + Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. Type 'Promise' is not assignable to type 'Promise'. Type 'number' is not assignable to type 'boolean'. @@ -77,11 +93,14 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. !!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:45:9: The last overload is declared here. } ////////////////////////////////////// @@ -100,11 +119,18 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. +!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. !!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:61:9: The last overload is declared here. } ////////////////////////////////////// @@ -123,10 +149,13 @@ genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No var newPromise = numPromise.then(testFunction); ~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. +!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. +!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. +!!! error TS2769: Type 'number' is not assignable to type 'boolean'. +!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. !!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. !!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. !!! error TS2769: Type 'number' is not assignable to type 'boolean'. -!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:76:9: The last overload is declared here. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt.diff deleted file mode 100644 index 0ff2dbd899..0000000000 --- a/testdata/baselines/reference/submodule/conformance/genericCallToOverloadedMethodWithOverloadedArguments.errors.txt.diff +++ /dev/null @@ -1,102 +0,0 @@ ---- old.genericCallToOverloadedMethodWithOverloadedArguments.errors.txt -+++ new.genericCallToOverloadedMethodWithOverloadedArguments.errors.txt -@@= skipped -1, +1 lines =@@ - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. - genericCallToOverloadedMethodWithOverloadedArguments.ts(52,38): error TS2769: No overload matches this call. -- Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -- Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -- Type 'Promise' is not assignable to type 'Promise'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -+ The last overload gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. - genericCallToOverloadedMethodWithOverloadedArguments.ts(68,38): error TS2769: No overload matches this call. -- Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. -- Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -- Type 'Promise' is not assignable to type 'Promise'. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -- Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -- Type 'Promise' is not assignable to type 'Promise'. -- Type 'number' is not assignable to type 'string'. -- Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. -+ The last overload gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'string'. - genericCallToOverloadedMethodWithOverloadedArguments.ts(84,38): error TS2769: No overload matches this call. -- Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. -- Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -- Type 'Promise' is not assignable to type 'Promise'. -- Type 'number' is not assignable to type 'boolean'. -- Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. -+ The last overload gave the following error. - Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'number' is not assignable to type 'boolean'. -@@= skipped -91, +75 lines =@@ - var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -+!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:45:9: The last overload is declared here. - } - - ////////////////////////////////////// -@@= skipped -26, +23 lines =@@ - var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(cb: (x: number) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 3, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 3 of 3, '(cb: (x: number) => Promise, error?: (error: any) => string, progress?: (preservation: any) => void): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -+!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. -+!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:61:9: The last overload is declared here. - } - - ////////////////////////////////////// -@@= skipped -30, +23 lines =@@ - var newPromise = numPromise.then(testFunction); - ~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(cb: (x: number) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'boolean'. --!!! error TS2769: Overload 2 of 2, '(cb: (x: number) => Promise, error?: (error: any) => Promise): Promise', gave the following error. --!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. --!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. --!!! error TS2769: Type 'number' is not assignable to type 'boolean'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type '{ (n: number): Promise; (s: string): Promise; (b: boolean): Promise; }' is not assignable to parameter of type '(x: number) => Promise'. -+!!! error TS2769: Type 'Promise' is not assignable to type 'Promise'. -+!!! error TS2769: Type 'number' is not assignable to type 'boolean'. -+!!! related TS2771 genericCallToOverloadedMethodWithOverloadedArguments.ts:76:9: The last overload is declared here. - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt b/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt index 23d0eab3af..005ec38537 100644 --- a/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt @@ -1,13 +1,32 @@ -iterableArrayPattern28.ts(2,52): error TS2769: No overload matches this call. - The last overload gave the following error. +iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call. + Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. + Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. + Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type 'boolean' is not assignable to type 'number'. + Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'boolean' is not assignable to type 'number'. ==== iterableArrayPattern28.ts (1 errors) ==== function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); - ~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. -!!! error TS2769: Type 'boolean' is not assignable to type 'number'. -!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. \ No newline at end of file +!!! error TS2769: Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. +!!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. +!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. +!!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. +!!! error TS2769: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. +!!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. +!!! error TS2769: Type 'boolean' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt.diff index 6f2faf2178..1638032b56 100644 --- a/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/iterableArrayPattern28.errors.txt.diff @@ -3,18 +3,17 @@ @@= skipped -0, +0 lines =@@ -iterableArrayPattern28.ts(2,28): error TS2769: No overload matches this call. - Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. -- Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. -- The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -- Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. -- Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. -- Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. -- Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. -- Type at position 1 in source is not compatible with type at position 1 in target. -- Type 'boolean' is not assignable to type 'number'. ++iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call. ++ Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +@@= skipped -8, +8 lines =@@ + Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + Type at position 1 in source is not compatible with type at position 1 in target. + Type 'boolean' is not assignable to type 'number'. - Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -+iterableArrayPattern28.ts(2,52): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++ Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. Type 'boolean' is not assignable to type 'number'. @@ -22,19 +21,17 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); - ~~~ -+ ~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. --!!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. --!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. --!!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. --!!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. --!!! error TS2769: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. --!!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. --!!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. --!!! error TS2769: Type 'boolean' is not assignable to type 'number'. ++!!! error TS2769: Overload 1 of 4, 'new (iterable?: Iterable): Map', gave the following error. + !!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. + !!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. + !!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +@@= skipped -19, +19 lines =@@ + !!! error TS2769: Type '[string, boolean]' is not assignable to type 'readonly [string, number]'. + !!! error TS2769: Type at position 1 in source is not compatible with type at position 1 in target. + !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -!!! error TS2769: Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -+!!! related TS2771 lib.es2015.collection.d.ts:--:--: The last overload is declared here. \ No newline at end of file ++!!! error TS2769: Overload 2 of 4, 'new (entries?: readonly (readonly [string, number])[]): Map', gave the following error. + !!! error TS2769: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt b/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt index cd64200a52..310b446568 100644 --- a/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt @@ -1,5 +1,10 @@ iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. + Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. + The types returned by 'slice(...)' are incompatible between these types. + Type 'symbol[]' is not assignable to type 'number[]'. + Type 'symbol' is not assignable to type 'number'. + Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. Type 'symbol[]' is not assignable to type 'ConcatArray'. The types returned by 'slice(...)' are incompatible between these types. @@ -25,10 +30,14 @@ iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call. array.concat([...new SymbolIterator]); ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. +!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. +!!! error TS2769: The types returned by 'slice(...)' are incompatible between these types. +!!! error TS2769: Type 'symbol[]' is not assignable to type 'number[]'. +!!! error TS2769: Type 'symbol' is not assignable to type 'number'. +!!! error TS2769: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. !!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. !!! error TS2769: Type 'symbol[]' is not assignable to type 'ConcatArray'. !!! error TS2769: The types returned by 'slice(...)' are incompatible between these types. !!! error TS2769: Type 'symbol[]' is not assignable to type 'number[]'. -!!! error TS2769: Type 'symbol' is not assignable to type 'number'. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. \ No newline at end of file +!!! error TS2769: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt.diff deleted file mode 100644 index 284138a742..0000000000 --- a/testdata/baselines/reference/submodule/conformance/iteratorSpreadInArray6.errors.txt.diff +++ /dev/null @@ -1,31 +0,0 @@ ---- old.iteratorSpreadInArray6.errors.txt -+++ new.iteratorSpreadInArray6.errors.txt -@@= skipped -0, +0 lines =@@ - iteratorSpreadInArray6.ts(15,14): error TS2769: No overload matches this call. -- Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. -- Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. -- The types returned by 'slice(...)' are incompatible between these types. -- Type 'symbol[]' is not assignable to type 'number[]'. -- Type 'symbol' is not assignable to type 'number'. -- Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. -+ The last overload gave the following error. - Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - Type 'symbol[]' is not assignable to type 'ConcatArray'. - The types returned by 'slice(...)' are incompatible between these types. -@@= skipped -29, +24 lines =@@ - array.concat([...new SymbolIterator]); - ~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): number[]', gave the following error. --!!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'ConcatArray'. --!!! error TS2769: The types returned by 'slice(...)' are incompatible between these types. --!!! error TS2769: Type 'symbol[]' is not assignable to type 'number[]'. --!!! error TS2769: Type 'symbol' is not assignable to type 'number'. --!!! error TS2769: Overload 2 of 2, '(...items: (number | ConcatArray)[]): number[]', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'symbol[]' is not assignable to parameter of type 'number | ConcatArray'. - !!! error TS2769: Type 'symbol[]' is not assignable to type 'ConcatArray'. - !!! error TS2769: The types returned by 'slice(...)' are incompatible between these types. - !!! error TS2769: Type 'symbol[]' is not assignable to type 'number[]'. - !!! error TS2769: Type 'symbol' is not assignable to type 'number'. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt b/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt index 3663e4b3f6..117b926f23 100644 --- a/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt @@ -1,5 +1,7 @@ overloadResolution.ts(27,5): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(s: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. @@ -7,10 +9,14 @@ overloadResolution.ts(70,21): error TS2345: Argument of type 'number' is not ass overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. overloadResolution.ts(84,5): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(n: string, m: any): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(n: number, m: any): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. overloadResolution.ts(85,11): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(n: any, m: number): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(n: any, m: string): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -46,9 +52,10 @@ overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on fn1({}); // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error. +!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(s: number): number', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -!!! related TS2771 overloadResolution.ts:19:10: The last overload is declared here. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments function fn2(s: string, n: number): number; @@ -118,15 +125,17 @@ overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on fn4(true, null); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here. fn4(null, true); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, '(n: any, m: string): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here. // Non - generic overloads where contextual typing of function arguments has errors function fn5(f: (n: string) => void): string; diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt.diff deleted file mode 100644 index b5f320ce5b..0000000000 --- a/testdata/baselines/reference/submodule/conformance/overloadResolution.errors.txt.diff +++ /dev/null @@ -1,63 +0,0 @@ ---- old.overloadResolution.errors.txt -+++ new.overloadResolution.errors.txt -@@= skipped -0, +0 lines =@@ - overloadResolution.ts(27,5): error TS2769: No overload matches this call. -- Overload 1 of 2, '(s: string): string', gave the following error. -- Argument of type '{}' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(s: number): number', gave the following error. -+ The last overload gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. - overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. - overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4. -@@= skipped -8, +6 lines =@@ - overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. - overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. - overloadResolution.ts(84,5): error TS2769: No overload matches this call. -- Overload 1 of 2, '(n: string, m: any): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(n: number, m: any): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'number'. - overloadResolution.ts(85,11): error TS2769: No overload matches this call. -- Overload 1 of 2, '(n: any, m: number): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 2, '(n: any, m: string): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. - overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'. -@@= skipped -43, +39 lines =@@ - fn1({}); // Error - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error. --!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(s: number): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -+!!! related TS2771 overloadResolution.ts:19:10: The last overload is declared here. - - // Generic and non - generic overload where generic overload is the only candidate when called with type arguments - function fn2(s: string, n: number): number; -@@= skipped -73, +72 lines =@@ - fn4(true, null); // Error - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -+!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here. - fn4(null, true); // Error - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here. - - // Non - generic overloads where contextual typing of function arguments has errors - function fn5(f: (n: string) => void): string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt b/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt index 5af47e8da3..ef342b6cda 100644 --- a/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt @@ -1,5 +1,7 @@ overloadResolutionClassConstructors.ts(27,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (s: string): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, 'new (s: number): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. @@ -46,9 +48,10 @@ overloadResolutionClassConstructors.ts(98,18): error TS2339: Property 'blah' doe new fn1({}); // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (s: string): fn1', gave the following error. +!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (s: number): fn1', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -!!! related TS2771 overloadResolutionClassConstructors.ts:20:5: The last overload is declared here. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments class fn2 { diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt.diff index f99fae08cd..1ac40271fc 100644 --- a/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/overloadResolutionClassConstructors.errors.txt.diff @@ -3,22 +3,22 @@ @@= skipped -0, +0 lines =@@ overloadResolutionClassConstructors.ts(27,9): error TS2769: No overload matches this call. - Overload 1 of 2, '(s: string): fn1', gave the following error. -- Argument of type '{}' is not assignable to parameter of type 'string'. ++ Overload 1 of 2, 'new (s: string): fn1', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. - Overload 2 of 2, '(s: number): fn1', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (s: number): fn1', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. overloadResolutionClassConstructors.ts(60,9): error TS2558: Expected 3 type arguments, but got 1. overloadResolutionClassConstructors.ts(61,9): error TS2558: Expected 3 type arguments, but got 2. -@@= skipped -47, +45 lines =@@ +@@= skipped -47, +47 lines =@@ new fn1({}); // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(s: string): fn1', gave the following error. --!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (s: string): fn1', gave the following error. + !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 2, '(s: number): fn1', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (s: number): fn1', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -+!!! related TS2771 overloadResolutionClassConstructors.ts:20:5: The last overload is declared here. - // Generic and non - generic overload where generic overload is the only candidate when called with type arguments - class fn2 { \ No newline at end of file + // Generic and non - generic overload where generic overload is the only candidate when called with type arguments \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt b/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt index 95fb1c01e3..344f5c6333 100644 --- a/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt @@ -1,5 +1,7 @@ overloadResolutionConstructors.ts(27,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, 'new (s: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. @@ -7,10 +9,14 @@ overloadResolutionConstructors.ts(77,25): error TS2345: Argument of type 'number overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. overloadResolutionConstructors.ts(91,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (n: string, m: any): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. + Overload 2 of 2, 'new (n: number, m: any): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(92,15): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (n: any, m: number): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, 'new (n: any, m: string): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -46,9 +52,10 @@ overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does new fn1({}); // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (s: string): string', gave the following error. +!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (s: number): number', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -!!! related TS2771 overloadResolutionConstructors.ts:18:5: The last overload is declared here. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments interface fn2 { @@ -125,15 +132,17 @@ overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does new fn4(true, null); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (n: string, m: any): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! related TS2771 overloadResolutionConstructors.ts:72:5: The last overload is declared here. new fn4(null, true); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (n: any, m: number): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, 'new (n: any, m: string): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 overloadResolutionConstructors.ts:72:5: The last overload is declared here. // Non - generic overloads where contextual typing of function arguments has errors interface fn5 { diff --git a/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt.diff index a37e1ae42d..2a36375ca9 100644 --- a/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/overloadResolutionConstructors.errors.txt.diff @@ -3,61 +3,62 @@ @@= skipped -0, +0 lines =@@ overloadResolutionConstructors.ts(27,9): error TS2769: No overload matches this call. - Overload 1 of 2, '(s: string): string', gave the following error. -- Argument of type '{}' is not assignable to parameter of type 'string'. ++ Overload 1 of 2, 'new (s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. - Overload 2 of 2, '(s: number): number', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (s: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(43,15): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(67,9): error TS2558: Expected 3 type arguments, but got 4. -@@= skipped -8, +6 lines =@@ +@@= skipped -8, +8 lines =@@ overloadResolutionConstructors.ts(78,25): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'. overloadResolutionConstructors.ts(91,9): error TS2769: No overload matches this call. - Overload 1 of 2, '(n: string, m: any): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'string'. ++ Overload 1 of 2, 'new (n: string, m: any): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. - Overload 2 of 2, '(n: number, m: any): any', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (n: number, m: any): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. overloadResolutionConstructors.ts(92,15): error TS2769: No overload matches this call. - Overload 1 of 2, '(n: any, m: number): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. ++ Overload 1 of 2, 'new (n: any, m: number): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. - Overload 2 of 2, '(n: any, m: string): any', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (n: any, m: string): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'. overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'. -@@= skipped -43, +39 lines =@@ +@@= skipped -43, +43 lines =@@ new fn1({}); // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error. --!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (s: string): string', gave the following error. + !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 2, '(s: number): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (s: number): number', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -+!!! related TS2771 overloadResolutionConstructors.ts:18:5: The last overload is declared here. // Generic and non - generic overload where generic overload is the only candidate when called with type arguments - interface fn2 { -@@= skipped -80, +79 lines =@@ +@@= skipped -80, +80 lines =@@ new fn4(true, null); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (n: string, m: any): any', gave the following error. + !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -+!!! related TS2771 overloadResolutionConstructors.ts:72:5: The last overload is declared here. new fn4(null, true); // Error ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. ++!!! error TS2769: Overload 1 of 2, 'new (n: any, m: number): any', gave the following error. + !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 2, '(n: any, m: string): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (n: any, m: string): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 overloadResolutionConstructors.ts:72:5: The last overload is declared here. - // Non - generic overloads where contextual typing of function arguments has errors - interface fn5 { \ No newline at end of file + // Non - generic overloads where contextual typing of function arguments has errors \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt b/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt index f587b62209..63cb4df000 100644 --- a/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt @@ -9,7 +9,9 @@ strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, Source has 3 element(s) but target allows only 2. strictBindCallApply1.ts(41,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. strictBindCallApply1.ts(42,22): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. + Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. strictBindCallApply1.ts(49,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. @@ -30,14 +32,18 @@ strictBindCallApply1.ts(70,12): error TS2345: Argument of type '[number]' is not strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'. strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. Source has 3 element(s) but target allows only 2. -strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call. - The last overload gave the following error. +strictBindCallApply1.ts(76,14): error TS2769: No overload matches this call. + Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. + Argument of type '2' is not assignable to parameter of type '1'. + Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. Types of parameters 'args' and 'args' are incompatible. Type 'unknown[]' is not assignable to type 'T'. 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'. -strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. - The last overload gave the following error. +strictBindCallApply1.ts(81,14): error TS2769: No overload matches this call. + Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. + Argument of type '2' is not assignable to parameter of type '1'. + Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. Types of parameters 'args' and 'args' are incompatible. Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. @@ -106,9 +112,10 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. let f14 = c.foo.bind(undefined); // Error ~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2769: Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. !!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -177,26 +184,28 @@ strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. function bar(callback: (this: 1, ...args: T) => void) { callback.bind(1); callback.bind(2); // Error - ~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. +!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. +!!! error TS2769: Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. !!! error TS2769: The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. !!! error TS2769: Types of parameters 'args' and 'args' are incompatible. !!! error TS2769: Type 'unknown[]' is not assignable to type 'T'. !!! error TS2769: 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. } function baz(callback: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void) { callback.bind(1); callback.bind(2); // Error - ~~~~~~~~ + ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. +!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. +!!! error TS2769: Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. !!! error TS2769: The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. !!! error TS2769: Types of parameters 'args' and 'args' are incompatible. !!! error TS2769: Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. -!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. } // Repro from #32964 diff --git a/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt.diff index 5ce52243fe..363c05605e 100644 --- a/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/strictBindCallApply1.errors.txt.diff @@ -1,89 +1,20 @@ --- old.strictBindCallApply1.errors.txt +++ new.strictBindCallApply1.errors.txt -@@= skipped -8, +8 lines =@@ - Source has 3 element(s) but target allows only 2. - strictBindCallApply1.ts(41,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. - strictBindCallApply1.ts(42,22): error TS2769: No overload matches this call. -- Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. -- Argument of type 'undefined' is not assignable to parameter of type 'C'. -- Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. -+ The last overload gave the following error. - Argument of type 'undefined' is not assignable to parameter of type 'C'. - strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. - strictBindCallApply1.ts(49,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -@@= skipped -23, +21 lines =@@ - strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'. - strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. - Source has 3 element(s) but target allows only 2. --strictBindCallApply1.ts(76,14): error TS2769: No overload matches this call. -- Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. -- Argument of type '2' is not assignable to parameter of type '1'. -- Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. -+strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call. -+ The last overload gave the following error. - The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. - Types of parameters 'args' and 'args' are incompatible. - Type 'unknown[]' is not assignable to type 'T'. - 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'. --strictBindCallApply1.ts(81,14): error TS2769: No overload matches this call. -- Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. -- Argument of type '2' is not assignable to parameter of type '1'. -- Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. -+strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. -+ The last overload gave the following error. +@@= skipped -44, +44 lines =@@ + Argument of type '2' is not assignable to parameter of type '1'. + Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. - Types of parameters 'args' and 'args_0' are incompatible. + Types of parameters 'args' and 'args' are incompatible. Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. -@@= skipped -80, +76 lines =@@ - let f14 = c.foo.bind(undefined); // Error - ~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. --!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. --!!! error TS2769: Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. --!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. - - let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded - let f16 = c.generic.bind(c); // typeof C.prototype.generic -@@= skipped -72, +71 lines =@@ - function bar(callback: (this: 1, ...args: T) => void) { - callback.bind(1); - callback.bind(2); // Error -- ~~~~ -+ ~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. --!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. --!!! error TS2769: Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. - !!! error TS2769: Types of parameters 'args' and 'args' are incompatible. - !!! error TS2769: Type 'unknown[]' is not assignable to type 'T'. - !!! error TS2769: 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. - } - - function baz(callback: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void) { - callback.bind(1); - callback.bind(2); // Error -- ~~~~ -+ ~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. --!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. --!!! error TS2769: Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. -+!!! error TS2769: The last overload gave the following error. +@@= skipped -159, +159 lines =@@ + !!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. + !!! error TS2769: Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. !!! error TS2769: The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. -!!! error TS2769: Types of parameters 'args' and 'args_0' are incompatible. +!!! error TS2769: Types of parameters 'args' and 'args' are incompatible. !!! error TS2769: Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. -+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here. } - - // Repro from #32964 \ No newline at end of file + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt index c7cb2313c1..b33ef59de4 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -1,17 +1,25 @@ taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -38,26 +46,32 @@ taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1 var c = foo([], 1, 2); // boolean ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var d = foo([], 1, true); // boolean (with error) ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var e = foo([], 1, "2"); // {} ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var f = foo([], 1, 2, 3); // any (with error) ~ @@ -69,9 +83,10 @@ taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1 var x = foo `${1}${true}`; // boolean (with error) ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt.diff index 41251d1869..e71397d428 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1.errors.txt.diff @@ -8,42 +8,36 @@ +taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - taggedTemplateStringsWithOverloadResolution1.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. - -@@= skipped -42, +26 lines =@@ + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +@@= skipped -42, +34 lines =@@ var a = foo([]); // number ~~ @@ -62,63 +56,42 @@ var c = foo([], 1, 2); // boolean ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var d = foo([], 1, true); // boolean (with error) +@@= skipped -26, +22 lines =@@ ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var e = foo([], 1, "2"); // {} +@@= skipped -12, +10 lines =@@ ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. - !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var f = foo([], 1, 2, 3); // any (with error) - ~ -@@= skipped -56, +42 lines =@@ - var x = foo `${1}${true}`; // boolean (with error) - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1.ts:4:10: The last overload is declared here. - !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var y = foo `${1}${"2"}`; // {} - var z = foo `${1}${2}${3}`; // any (with error) \ No newline at end of file + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2793 taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 2830a25b8d..b775be44e2 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -1,17 +1,25 @@ taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. @@ -38,26 +46,32 @@ taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expect var c = foo([], 1, 2); // boolean ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var d = foo([], 1, true); // boolean (with error) ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var e = foo([], 1, "2"); // {} ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. !!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var f = foo([], 1, 2, 3); // any (with error) ~ @@ -69,9 +83,10 @@ taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expect var x = foo `${1}${true}`; // boolean (with error) ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var y = foo `${1}${"2"}`; // {} var z = foo `${1}${2}${3}`; // any (with error) diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt.diff index 5e7d12cdf9..051c7f91c3 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt.diff @@ -8,42 +8,36 @@ +taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. +taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2741: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++ Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. - Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. - Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+ The last overload gave the following error. + Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,23): error TS2554: Expected 1-3 arguments, but got 4. taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2769: No overload matches this call. -- Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,24): error TS2554: Expected 1-3 arguments, but got 4. - -@@= skipped -42, +26 lines =@@ + Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. +@@= skipped -42, +34 lines =@@ var a = foo([]); // number ~~ @@ -62,63 +56,42 @@ var c = foo([], 1, 2); // boolean ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var d = foo([], 1, true); // boolean (with error) +@@= skipped -26, +22 lines =@@ ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var e = foo([], 1, "2"); // {} +@@= skipped -12, +10 lines =@@ ~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. + !!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. ++!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. + !!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -!!! error TS2769: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. -!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. --!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -+!!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. - !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var f = foo([], 1, 2, 3); // any (with error) - ~ -@@= skipped -56, +42 lines =@@ - var x = foo `${1}${true}`; // boolean (with error) - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 4, '(strs: TemplateStringsArray, x: number, y: number): boolean', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 4, '(strs: TemplateStringsArray, x: number, y: string): {}', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution1_ES6.ts:4:10: The last overload is declared here. - !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - var y = foo `${1}${"2"}`; // {} - var z = foo `${1}${2}${3}`; // any (with error) \ No newline at end of file + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2728 lib.es5.d.ts:--:--: 'raw' is declared here. + !!! related TS2793 taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt index 677a628572..2d5a21108b 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt @@ -1,13 +1,19 @@ taggedTemplateStringsWithOverloadResolution3.ts(9,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. taggedTemplateStringsWithOverloadResolution3.ts(62,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. taggedTemplateStringsWithOverloadResolution3.ts(63,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. @@ -24,9 +30,10 @@ taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property ' fn1 `${ {} }`; // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:3:10: The last overload is declared here. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -87,15 +94,17 @@ taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property ' fn4 `${ true }${ null }`; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:48:10: The last overload is declared here. fn4 `${ null }${ true }`; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:48:10: The last overload is declared here. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt.diff deleted file mode 100644 index bf19dd7fc3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3.errors.txt.diff +++ /dev/null @@ -1,60 +0,0 @@ ---- old.taggedTemplateStringsWithOverloadResolution3.errors.txt -+++ new.taggedTemplateStringsWithOverloadResolution3.errors.txt -@@= skipped -0, +0 lines =@@ - taggedTemplateStringsWithOverloadResolution3.ts(9,9): error TS2769: No overload matches this call. -- Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -- Argument of type '{}' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -+ The last overload gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. - taggedTemplateStringsWithOverloadResolution3.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. - taggedTemplateStringsWithOverloadResolution3.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. - taggedTemplateStringsWithOverloadResolution3.ts(62,9): error TS2769: No overload matches this call. -- Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'string'. -- Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'number'. - taggedTemplateStringsWithOverloadResolution3.ts(63,18): error TS2769: No overload matches this call. -- Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - taggedTemplateStringsWithOverloadResolution3.ts(69,18): error TS2339: Property 'toFixed' does not exist on type 'string'. - -@@= skipped -29, +23 lines =@@ - fn1 `${ {} }`; // Error - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. --!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:3:10: The last overload is declared here. - - function fn2(strs: TemplateStringsArray, s: string, n: number): number; - function fn2(strs: TemplateStringsArray, n: number, t: T): T; -@@= skipped -64, +63 lines =@@ - fn4 `${ true }${ null }`; - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:48:10: The last overload is declared here. - fn4 `${ null }${ true }`; - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3.ts:48:10: The last overload is declared here. - - // Non - generic overloads where contextual typing of function arguments has errors - function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index a7ef0d07ce..b29d0d7be7 100644 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -1,13 +1,19 @@ taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. + Argument of type '{}' is not assignable to parameter of type 'string'. + Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. Argument of type '{}' is not assignable to parameter of type 'number'. taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'string'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'number'. taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? @@ -24,9 +30,10 @@ taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Proper fn1 `${ {} }`; // Error ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. +!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:3:10: The last overload is declared here. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; @@ -87,15 +94,17 @@ taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Proper fn4 `${ true }${ null }`; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. +!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:48:10: The last overload is declared here. fn4 `${ null }${ true }`; ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:48:10: The last overload is declared here. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; diff --git a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt.diff deleted file mode 100644 index f66f64dbe0..0000000000 --- a/testdata/baselines/reference/submodule/conformance/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt.diff +++ /dev/null @@ -1,60 +0,0 @@ ---- old.taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt -+++ new.taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt -@@= skipped -0, +0 lines =@@ - taggedTemplateStringsWithOverloadResolution3_ES6.ts(9,9): error TS2769: No overload matches this call. -- Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. -- Argument of type '{}' is not assignable to parameter of type 'string'. -- Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -+ The last overload gave the following error. - Argument of type '{}' is not assignable to parameter of type 'number'. - taggedTemplateStringsWithOverloadResolution3_ES6.ts(18,4): error TS2339: Property 'foo' does not exist on type 'Date'. - taggedTemplateStringsWithOverloadResolution3_ES6.ts(44,1): error TS2554: Expected 2-4 arguments, but got 1. - taggedTemplateStringsWithOverloadResolution3_ES6.ts(62,9): error TS2769: No overload matches this call. -- Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'string'. -- Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'number'. - taggedTemplateStringsWithOverloadResolution3_ES6.ts(63,18): error TS2769: No overload matches this call. -- Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - taggedTemplateStringsWithOverloadResolution3_ES6.ts(69,18): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? - -@@= skipped -29, +23 lines =@@ - fn1 `${ {} }`; // Error - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(strs: TemplateStringsArray, s: string): string', gave the following error. --!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 2, '(strs: TemplateStringsArray, n: number): number', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:3:10: The last overload is declared here. - - function fn2(strs: TemplateStringsArray, s: string, n: number): number; - function fn2(strs: TemplateStringsArray, n: number, t: T): T; -@@= skipped -64, +63 lines =@@ - fn4 `${ true }${ null }`; - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: string, m: any): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. --!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: number, m: any): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:48:10: The last overload is declared here. - fn4 `${ null }${ true }`; - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(strs: TemplateStringsArray, n: any, m: number): any', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 3, '(strs: TemplateStringsArray, n: any, m: string): any', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 taggedTemplateStringsWithOverloadResolution3_ES6.ts:48:10: The last overload is declared here. - - // Non - generic overloads where contextual typing of function arguments has errors - function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt b/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt index c8599950dc..68e6a3b328 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt @@ -1,13 +1,19 @@ file.tsx(11,2): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, 'new (n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. file.tsx(18,2): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. file.tsx(18,2): error TS2786: 'Obj2' cannot be used as a JSX component. Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. file.tsx(25,2): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. Type '{ x: number; }' is not assignable to type 'number'. file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. Property 'something' is missing in type '{ x: number; } & { x: number; y: string; }' but required in type 'Element'. @@ -27,9 +33,10 @@ file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. ; // Error, return type is not an object type ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (n: string): { x: number; }', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, 'new (n: number): { y: string; }', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'number'. -!!! related TS2771 file.tsx:8:2: The last overload is declared here. interface Obj2 { (n: string): { x: number }; @@ -39,9 +46,10 @@ file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. ; // Error, return type is not an object type ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2769: Type '{}' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'number'. -!!! related TS2771 file.tsx:15:2: The last overload is declared here. ~~~~ !!! error TS2786: 'Obj2' cannot be used as a JSX component. !!! error TS2786: Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. @@ -55,9 +63,10 @@ file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. ; // OK ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +!!! error TS2769: Type '{ x: number; }' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. !!! error TS2769: Type '{ x: number; }' is not assignable to type 'number'. -!!! related TS2771 file.tsx:22:2: The last overload is declared here. ~~~~ !!! error TS2786: 'Obj3' cannot be used as a JSX component. !!! error TS2786: Property 'something' is missing in type '{ x: number; } & { x: number; y: string; }' but required in type 'Element'. diff --git a/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt.diff index 38c9b03915..d05a1d94d2 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/tsxElementResolution9.errors.txt.diff @@ -3,25 +3,24 @@ @@= skipped -0, +0 lines =@@ file.tsx(11,2): error TS2769: No overload matches this call. - Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -- Type '{}' is not assignable to type 'string'. ++ Overload 1 of 2, 'new (n: string): { x: number; }', gave the following error. + Type '{}' is not assignable to type 'string'. - Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. file.tsx(18,2): error TS2769: No overload matches this call. -- Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -- Type '{}' is not assignable to type 'string'. -- Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -+ The last overload gave the following error. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. +@@= skipped -8, +8 lines =@@ + Overload 2 of 2, '(n: number): { y: string; }', gave the following error. Type '{}' is not assignable to type 'number'. file.tsx(18,2): error TS2786: 'Obj2' cannot be used as a JSX component. - Its return type '{ x: number; } & { y: string; }' is not a valid JSX element. - Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. + Property 'something' is missing in type '{ x: number; } & { y: string; }' but required in type 'Element'. file.tsx(25,2): error TS2769: No overload matches this call. -- Overload 1 of 2, '(n: string): { x: number; }', gave the following error. -- Type '{ x: number; }' is not assignable to type 'string'. -- Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. -+ The last overload gave the following error. + Overload 1 of 2, '(n: string): { x: number; }', gave the following error. + Type '{ x: number; }' is not assignable to type 'string'. + Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. Type '{ x: number; }' is not assignable to type 'number'. file.tsx(25,2): error TS2786: 'Obj3' cannot be used as a JSX component. - Its return type '{ x: number; } & { x: number; y: string; }' is not a valid JSX element. @@ -30,29 +29,20 @@ ==== file.tsx (5 errors) ==== -@@= skipped -34, +26 lines =@@ +@@= skipped -26, +24 lines =@@ ; // Error, return type is not an object type ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. --!!! error TS2769: Type '{}' is not assignable to type 'string'. ++!!! error TS2769: Overload 1 of 2, 'new (n: string): { x: number; }', gave the following error. + !!! error TS2769: Type '{}' is not assignable to type 'string'. -!!! error TS2769: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (n: number): { y: string; }', gave the following error. !!! error TS2769: Type '{}' is not assignable to type 'number'. -+!!! related TS2771 file.tsx:8:2: The last overload is declared here. interface Obj2 { - (n: string): { x: number }; -@@= skipped -13, +12 lines =@@ - ; // Error, return type is not an object type - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. --!!! error TS2769: Type '{}' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(n: number): { y: string; }', gave the following error. -+!!! error TS2769: The last overload gave the following error. +@@= skipped -19, +19 lines =@@ !!! error TS2769: Type '{}' is not assignable to type 'number'. -+!!! related TS2771 file.tsx:15:2: The last overload is declared here. ~~~~ !!! error TS2786: 'Obj2' cannot be used as a JSX component. -!!! error TS2786: Its return type '{ x: number; } & { y: string; }' is not a valid JSX element. @@ -61,16 +51,8 @@ !!! related TS2728 file.tsx:2:22: 'something' is declared here. interface Obj3 { -@@= skipped -18, +16 lines =@@ - ; // OK - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(n: string): { x: number; }', gave the following error. --!!! error TS2769: Type '{ x: number; }' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(n: number): { x: number; y: string; }', gave the following error. -+!!! error TS2769: The last overload gave the following error. +@@= skipped -18, +17 lines =@@ !!! error TS2769: Type '{ x: number; }' is not assignable to type 'number'. -+!!! related TS2771 file.tsx:22:2: The last overload is declared here. ~~~~ !!! error TS2786: 'Obj3' cannot be used as a JSX component. -!!! error TS2786: Its return type '{ x: number; } & { x: number; y: string; }' is not a valid JSX element. diff --git a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload4.errors.txt b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload4.errors.txt index 81a5807ab3..bf3b17f927 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload4.errors.txt @@ -1,39 +1,80 @@ file.tsx(12,22): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'extraProp' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -file.tsx(13,13): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(13,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. file.tsx(14,31): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; yy1: true; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type 'boolean' is not assignable to type 'string'. file.tsx(16,31): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'y1' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. file.tsx(17,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'. Types of property 'yy' are incompatible. Type 'boolean' is not assignable to type 'number'. file.tsx(25,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'. + Types of property '"extra-data"' are incompatible. + Type 'boolean' is not assignable to type 'string'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'. -file.tsx(26,40): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(26,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. -file.tsx(33,32): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(33,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -file.tsx(34,29): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(34,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -file.tsx(35,29): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(35,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'string' is not assignable to type 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. -file.tsx(36,29): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(36,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. @@ -52,40 +93,49 @@ file.tsx(36,29): error TS2769: No overload matches this call. const c0 = ; // extra property; ~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. !!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c1 = ; // missing property; - ~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2769: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. !!! related TS2728 file.tsx:3:43: 'yy1' is declared here. -!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c2 = ; // type incompatible; ~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2769: Type '{ yy: number; yy1: true; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Property 'yy1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2769: Type 'boolean' is not assignable to type 'string'. !!! related TS6500 file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' -!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c3 = ; // This is OK because all attribute are spread const c4 = ; // extra property; ~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. !!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c5 = ; // type incompatible; ~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. +!!! error TS2769: Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. !!! error TS2769: Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'. !!! error TS2769: Types of property 'yy' are incompatible. !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not @@ -96,17 +146,22 @@ file.tsx(36,29): error TS2769: No overload matches this call. const d1 = ~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2769: Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'. +!!! error TS2769: Types of property '"extra-data"' are incompatible. +!!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2769: Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'. !!! related TS2728 file.tsx:22:38: 'yy' is declared here. -!!! related TS2771 file.tsx:22:18: The last overload is declared here. const d2 = - ~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. +!!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. +!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'number'. !!! related TS6500 file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' -!!! related TS2771 file.tsx:22:18: The last overload is declared here. declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; @@ -114,31 +169,51 @@ file.tsx(36,29): error TS2769: No overload matches this call. // Error const e1 = - ~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 file.tsx:28:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; }' +!!! related TS6500 file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' !!! related TS6500 file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e2 = - ~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. +!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e3 = - ~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2769: Type 'string' is not assignable to type 'Element'. +!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e4 = Hi - ~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. +!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. +!!! error TS2769: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. +!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. !!! error TS2769: Type 'string' is not assignable to type 'boolean'. +!!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -!!! related TS2771 file.tsx:30:18: The last overload is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload5.errors.txt b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload5.errors.txt index 1ea47289a5..c9a4cac531 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentOverload5.errors.txt @@ -1,15 +1,33 @@ -file.tsx(48,24): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(48,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. + Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. file.tsx(54,51): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'number' is not assignable to type 'string'. file.tsx(55,68): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type 'boolean' is not assignable to type 'string'. file.tsx(56,13): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Property 'onClick' is missing in type '{ "data-format": true; }' but required in type 'ButtonProps'. + Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. + Property 'to' is missing in type '{ "data-format": true; }' but required in type 'LinkProps'. + Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. Type '{ "data-format": true; }' is not assignable to type 'HyphenProps'. Types of property '"data-format"' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -64,12 +82,17 @@ file.tsx(56,13): error TS2769: No overload matches this call. // Error const b0 = {}}>GO; // extra property; - ~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. +!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. !!! error TS2769: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -!!! related TS2771 file.tsx:37:17: The last overload is declared here. !!! related TS2793 file.tsx:38:17: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. const b1 = {}} {...obj0}>Hello world; // extra property; const b2 = ; // extra property @@ -79,22 +102,37 @@ file.tsx(56,13): error TS2769: No overload matches this call. const b6 = ; // incorrect type for optional attribute ~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. !!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LinkProps' !!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' -!!! related TS2771 file.tsx:37:17: The last overload is declared here. const b7 = ; // incorrect type for optional attribute ~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2769: Type 'boolean' is not assignable to type 'string'. +!!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & ButtonProps' +!!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & LinkProps' !!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' -!!! related TS2771 file.tsx:37:17: The last overload is declared here. const b8 = ; // incorrect type for specified hyphanated name ~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. +!!! error TS2769: Property 'onClick' is missing in type '{ "data-format": true; }' but required in type 'ButtonProps'. +!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. +!!! error TS2769: Property 'to' is missing in type '{ "data-format": true; }' but required in type 'LinkProps'. +!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. !!! error TS2769: Type '{ "data-format": true; }' is not assignable to type 'HyphenProps'. !!! error TS2769: Types of property '"data-format"' are incompatible. !!! error TS2769: Type 'boolean' is not assignable to type 'string'. -!!! related TS2771 file.tsx:37:17: The last overload is declared here. \ No newline at end of file +!!! related TS2728 file.tsx:9:5: 'onClick' is declared here. +!!! related TS2728 file.tsx:13:5: 'to' is declared here. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt index 7c45fd97a1..9013bacb19 100644 --- a/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@ -1,8 +1,19 @@ -file.tsx(9,15): error TS2769: No overload matches this call. - The last overload gave the following error. +file.tsx(9,14): error TS2769: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'number' is not assignable to type 'string'. + Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. file.tsx(10,15): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 3, '(): Element', gave the following error. + Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. + Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: number; a: string; "ignore-prop": boolean; }'. + Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. + Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: unknown; a: unknown; }'. Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: unknown; a: unknown; }'. @@ -18,19 +29,30 @@ file.tsx(10,15): error TS2769: No overload matches this call. // Error function Baz(arg1: T, arg2: U) { let a0 = - ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2769: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +!!! error TS2769: Property 'a' does not exist on type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2769: Type 'number' is not assignable to type 'string'. +!!! error TS2769: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. !!! error TS2769: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. +!!! related TS6500 file.tsx:4:52: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }' !!! related TS2728 file.tsx:5:49: 'b' is declared here. -!!! related TS2771 file.tsx:5:18: The last overload is declared here. let a2 = // missing a ~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. +!!! error TS2769: Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. +!!! error TS2769: Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. +!!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. +!!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: number; a: string; "ignore-prop": boolean; }'. +!!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. +!!! error TS2769: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. !!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. !!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: unknown; a: unknown; }'. !!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: unknown; a: unknown; }'. +!!! related TS2728 file.tsx:4:52: 'a' is declared here. !!! related TS2728 file.tsx:5:55: 'a' is declared here. -!!! related TS2771 file.tsx:5:18: The last overload is declared here. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt b/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt index 10de97bea5..05db312f7c 100644 --- a/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt @@ -2,10 +2,14 @@ unionTypeCallSignatures.ts(9,1): error TS2322: Type 'number | Date' is not assig Type 'number' is not assignable to type 'string | boolean'. unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. unionTypeCallSignatures.ts(10,29): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeCallSignatures.ts(15,29): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, '(a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, '(a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. @@ -51,9 +55,10 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 unionTypeCallSignatures.ts:12:57: The last overload is declared here. var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; numOrDate = unionOfDifferentReturnType1(10); @@ -61,9 +66,10 @@ unionTypeCallSignatures.ts(73,12): error TS2554: Expected 2 arguments, but got 1 unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 unionTypeCallSignatures.ts:12:57: The last overload is declared here. unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt.diff deleted file mode 100644 index 493c9f8f6e..0000000000 --- a/testdata/baselines/reference/submodule/conformance/unionTypeCallSignatures.errors.txt.diff +++ /dev/null @@ -1,45 +0,0 @@ ---- old.unionTypeCallSignatures.errors.txt -+++ new.unionTypeCallSignatures.errors.txt -@@= skipped -1, +1 lines =@@ - Type 'number' is not assignable to type 'string | boolean'. - unionTypeCallSignatures.ts(9,43): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. - unionTypeCallSignatures.ts(10,29): error TS2769: No overload matches this call. -- Overload 1 of 2, '(a: number): number | Date', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - unionTypeCallSignatures.ts(15,29): error TS2769: No overload matches this call. -- Overload 1 of 2, '(a: number): number | Date', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. -- Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+ The last overload gave the following error. - Argument of type 'boolean' is not assignable to parameter of type 'string'. - unionTypeCallSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. - unionTypeCallSignatures.ts(19,32): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. -@@= skipped -53, +49 lines =@@ - unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 unionTypeCallSignatures.ts:12:57: The last overload is declared here. - - var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | { (a: number): Date; (a: string): boolean; }; - numOrDate = unionOfDifferentReturnType1(10); -@@= skipped -11, +10 lines =@@ - unionOfDifferentReturnType1(true); // error in type of parameter - ~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. --!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 unionTypeCallSignatures.ts:12:57: The last overload is declared here. - unionOfDifferentReturnType1(); // error missing parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2554: Expected 1 arguments, but got 0. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt b/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt index 0f2361e7d3..86750b6d19 100644 --- a/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt @@ -2,10 +2,14 @@ unionTypeConstructSignatures.ts(9,1): error TS2322: Type 'number | Date' is not Type 'number' is not assignable to type 'string | boolean'. unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. unionTypeConstructSignatures.ts(10,33): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeConstructSignatures.ts(15,33): error TS2769: No overload matches this call. - The last overload gave the following error. + Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. + Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. @@ -51,9 +55,10 @@ unionTypeConstructSignatures.ts(73,1): error TS2511: Cannot create an instance o new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (a: number): number | Date', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 unionTypeConstructSignatures.ts:12:61: The last overload is declared here. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; numOrDate = new unionOfDifferentReturnType1(10); @@ -61,9 +66,10 @@ unionTypeConstructSignatures.ts(73,1): error TS2511: Cannot create an instance o new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: The last overload gave the following error. +!!! error TS2769: Overload 1 of 2, 'new (a: number): number | Date', gave the following error. +!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. +!!! error TS2769: Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -!!! related TS2771 unionTypeConstructSignatures.ts:12:61: The last overload is declared here. new unionOfDifferentReturnType1(); // error missing parameter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 1 arguments, but got 0. diff --git a/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt.diff index f0226c132b..385f97aaff 100644 --- a/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/unionTypeConstructSignatures.errors.txt.diff @@ -5,41 +5,41 @@ unionTypeConstructSignatures.ts(9,47): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. unionTypeConstructSignatures.ts(10,33): error TS2769: No overload matches this call. - Overload 1 of 2, '(a: number): number | Date', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. ++ Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. - Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeConstructSignatures.ts(15,33): error TS2769: No overload matches this call. - Overload 1 of 2, '(a: number): number | Date', gave the following error. -- Argument of type 'boolean' is not assignable to parameter of type 'number'. ++ Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + Argument of type 'boolean' is not assignable to parameter of type 'number'. - Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+ The last overload gave the following error. ++ Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. Argument of type 'boolean' is not assignable to parameter of type 'string'. unionTypeConstructSignatures.ts(16,1): error TS2554: Expected 1 arguments, but got 0. unionTypeConstructSignatures.ts(19,36): error TS2345: Argument of type '10' is not assignable to parameter of type 'never'. -@@= skipped -53, +49 lines =@@ +@@= skipped -53, +53 lines =@@ new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. ++!!! error TS2769: Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 unionTypeConstructSignatures.ts:12:61: The last overload is declared here. var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): string; } | { new (a: number): Date; new (a: string): boolean; }; - numOrDate = new unionOfDifferentReturnType1(10); -@@= skipped -11, +10 lines =@@ +@@= skipped -11, +11 lines =@@ new unionOfDifferentReturnType1(true); // error in type of parameter ~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(a: number): number | Date', gave the following error. --!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. ++!!! error TS2769: Overload 1 of 2, 'new (a: number): number | Date', gave the following error. + !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 2, '(a: string): string | boolean', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Overload 2 of 2, 'new (a: string): string | boolean', gave the following error. !!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'. -+!!! related TS2771 unionTypeConstructSignatures.ts:12:61: The last overload is declared here. new unionOfDifferentReturnType1(); // error missing parameter - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !!! error TS2554: Expected 1 arguments, but got 0. \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt.diff index 18cc4efdd1..438ee5db44 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt.diff @@ -1,88 +1,38 @@ --- old.contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt +++ new.contextuallyTypedStringLiteralsInJsxAttributes02.errors.txt -@@= skipped -0, +0 lines =@@ - file.tsx(27,64): error TS2769: No overload matches this call. -- Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -- Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -- Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -- Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+ The last overload gave the following error. +@@= skipped -4, +4 lines =@@ + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -file.tsx(28,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -- Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -- Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -- Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+file.tsx(28,24): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. - file.tsx(29,43): error TS2769: No overload matches this call. -- Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -- Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -- Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. -- Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+ The last overload gave the following error. ++file.tsx(28,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. +@@= skipped -14, +14 lines =@@ + Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -file.tsx(30,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. -- Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -- Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. -- Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+file.tsx(30,36): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. - file.tsx(33,65): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -@@= skipped -61, +49 lines =@@ - const b0 = {console.log(k)}}} extra />; // k has type "left" | "right" - ~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++file.tsx(30,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. +@@= skipped -50, +50 lines =@@ !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -+!!! related TS2771 file.tsx:17:17: The last overload is declared here. const b2 = {console.log(k)}} extra />; // k has type "left" | "right" - ~~~~~~~~~~ -+ ~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - !!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -+!!! related TS2771 file.tsx:17:17: The last overload is declared here. - const b3 = ; // goTo has type"home" | "contact" - ~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. + !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + !!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. +@@= skipped -18, +18 lines =@@ !!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -+!!! related TS2771 file.tsx:17:17: The last overload is declared here. const b4 = ; // goTo has type "home" | "contact" - ~~~~~~~~~~ -+ ~~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. - !!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'. -+!!! related TS2771 file.tsx:17:17: The last overload is declared here. - - export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined } - const c1 = {console.log(k)}}} extra />; // k has type any \ No newline at end of file + !!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error. + !!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload4.errors.txt.diff index bdb9658190..838f901ade 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload4.errors.txt.diff @@ -1,254 +1,107 @@ --- old.tsxStatelessFunctionComponentOverload4.errors.txt +++ new.tsxStatelessFunctionComponentOverload4.errors.txt -@@= skipped -0, +0 lines =@@ - file.tsx(12,22): error TS2769: No overload matches this call. -- Overload 1 of 2, '(): Element', gave the following error. -- Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. -- Property 'extraProp' does not exist on type 'IntrinsicAttributes'. -- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+ The last overload gave the following error. +@@= skipped -4, +4 lines =@@ + Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - file.tsx(13,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(): Element', gave the following error. -- Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. -- Property 'yy' does not exist on type 'IntrinsicAttributes'. -- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+ The last overload gave the following error. - Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. - file.tsx(14,31): error TS2769: No overload matches this call. -- Overload 1 of 2, '(): Element', gave the following error. -- Type '{ yy: number; yy1: true; }' is not assignable to type 'IntrinsicAttributes'. -- Property 'yy1' does not exist on type 'IntrinsicAttributes'. -- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+ The last overload gave the following error. - Type 'boolean' is not assignable to type 'string'. - file.tsx(16,31): error TS2769: No overload matches this call. -- Overload 1 of 2, '(): Element', gave the following error. -- Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes'. -- Property 'y1' does not exist on type 'IntrinsicAttributes'. -- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+ The last overload gave the following error. - Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - file.tsx(17,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(): Element', gave the following error. -- Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'. -- Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+ The last overload gave the following error. - Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'. - Types of property 'yy' are incompatible. - Type 'boolean' is not assignable to type 'number'. - file.tsx(25,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -- Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'. -- Types of property '"extra-data"' are incompatible. -- Type 'boolean' is not assignable to type 'string'. -- Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -+ The last overload gave the following error. +-file.tsx(13,13): error TS2769: No overload matches this call. ++file.tsx(13,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(): Element', gave the following error. + Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'yy' does not exist on type 'IntrinsicAttributes'. +@@= skipped -33, +33 lines =@@ + Type 'boolean' is not assignable to type 'string'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'. -file.tsx(26,13): error TS2769: No overload matches this call. -- Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. -- Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. -- Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. -- Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -+file.tsx(26,40): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++file.tsx(26,12): error TS2769: No overload matches this call. + Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. + Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. + Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. Type 'string' is not assignable to type 'number'. -file.tsx(33,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -- Type 'boolean' is not assignable to type 'string'. -- Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -- Type 'boolean' is not assignable to type 'string'. -- Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -- Type 'string' is not assignable to type 'boolean'. ++file.tsx(33,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. + Type 'boolean' is not assignable to type 'string'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. -file.tsx(34,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -- Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -- Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -- Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. -- Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -- Type 'string' is not assignable to type 'boolean'. ++file.tsx(34,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +@@= skipped -22, +22 lines =@@ + Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. + Type 'string' is not assignable to type 'boolean'. -file.tsx(35,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -- Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -- Type 'string' is not assignable to type 'Element'. -- Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -- Type 'string' is not assignable to type 'boolean'. --file.tsx(36,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. -- Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. -- Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. -- 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. -- Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -+file.tsx(33,32): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'string' is not assignable to type 'boolean'. -+file.tsx(34,29): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'string' is not assignable to type 'boolean'. -+file.tsx(35,29): error TS2769: No overload matches this call. -+ The last overload gave the following error. -+ Type 'string' is not assignable to type 'boolean'. -+file.tsx(36,29): error TS2769: No overload matches this call. -+ The last overload gave the following error. ++file.tsx(35,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +@@= skipped -8, +8 lines =@@ + Type 'string' is not assignable to type 'Element'. + Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. Type 'string' is not assignable to type 'boolean'. - - -@@= skipped -92, +51 lines =@@ - const c0 = ; // extra property; - ~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. --!!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes'. --!!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. +-file.tsx(36,13): error TS2769: No overload matches this call. ++file.tsx(36,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. + Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +@@= skipped -32, +32 lines =@@ !!! error TS2769: Type '{ extraProp: true; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. !!! error TS2769: Property 'extraProp' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -+!!! related TS2771 file.tsx:3:18: The last overload is declared here. const c1 = ; // missing property; - ~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. --!!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. --!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Property 'yy1' is missing in type '{ yy: number; }' but required in type '{ yy: number; yy1: string; }'. - !!! related TS2728 file.tsx:3:43: 'yy1' is declared here. -+!!! related TS2771 file.tsx:3:18: The last overload is declared here. - const c2 = ; // type incompatible; - ~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. --!!! error TS2769: Type '{ yy: number; yy1: true; }' is not assignable to type 'IntrinsicAttributes'. --!!! error TS2769: Property 'yy1' does not exist on type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'boolean' is not assignable to type 'string'. - !!! related TS6500 file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }' -+!!! related TS2771 file.tsx:3:18: The last overload is declared here. - const c3 = ; // This is OK because all attribute are spread - const c4 = ; // extra property; - ~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. --!!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes'. --!!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ yy: number; yy1: string; y1: number; }' is not assignable to type 'IntrinsicAttributes & { yy: number; yy1: string; }'. - !!! error TS2769: Property 'y1' does not exist on type 'IntrinsicAttributes & { yy: number; yy1: string; }'. -+!!! related TS2771 file.tsx:3:18: The last overload is declared here. - const c5 = ; // type incompatible; - ~~~~~~~~ +- ~~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. --!!! error TS2769: Type '{ yy1: string; yy: boolean; }' has no properties in common with type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ yy1: string; yy: boolean; }' is not assignable to type '{ yy: number; yy1: string; }'. - !!! error TS2769: Types of property 'yy' are incompatible. - !!! error TS2769: Type 'boolean' is not assignable to type 'number'. -+!!! related TS2771 file.tsx:3:18: The last overload is declared here. - const c6 = ; // Should error as there is extra attribute that doesn't match any. Current it is not - const c7 = ; // Should error as there is extra attribute that doesn't match any. Current it is not - -@@= skipped -53, +44 lines =@@ - const d1 = - ~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. --!!! error TS2769: Type '{ "extra-data": true; }' is not assignable to type '{ "extra-data": string; }'. --!!! error TS2769: Types of property '"extra-data"' are incompatible. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. + !!! error TS2769: Overload 1 of 2, '(): Element', gave the following error. + !!! error TS2769: Type '{ yy: number; }' is not assignable to type 'IntrinsicAttributes'. +@@= skipped -54, +54 lines =@@ !!! error TS2769: Property 'yy' is missing in type '{ "extra-data": true; }' but required in type '{ yy: string; direction?: number; }'. !!! related TS2728 file.tsx:22:38: 'yy' is declared here. -+!!! related TS2771 file.tsx:22:18: The last overload is declared here. const d2 = - ~~~~~~~~~~~~~~~ -+ ~~~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. --!!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. --!!! error TS2769: Property 'yy' does not exist on type 'IntrinsicAttributes & { "extra-data": string; }'. --!!! error TS2769: Overload 2 of 2, '(n: { yy: string; direction?: number; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'number'. - !!! related TS6500 file.tsx:22:50: The expected type comes from property 'direction' which is declared here on type 'IntrinsicAttributes & { yy: string; direction?: number; }' -+!!! related TS2771 file.tsx:22:18: The last overload is declared here. - - declare function TestingOptional(a: {y1?: string, y2?: number}): JSX.Element; - declare function TestingOptional(a: {y1?: string, y2?: number, children: JSX.Element}): JSX.Element; -@@= skipped -23, +18 lines =@@ + !!! error TS2769: Overload 1 of 2, '(j: { "extra-data": string; }): Element', gave the following error. + !!! error TS2769: Type '{ yy: string; direction: string; }' is not assignable to type 'IntrinsicAttributes & { "extra-data": string; }'. +@@= skipped -15, +15 lines =@@ // Error const e1 = - ~~~~~~~~~~~~~~~ -+ ~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 file.tsx:28:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; }' --!!! related TS6500 file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' + !!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + !!! error TS2769: Type 'boolean' is not assignable to type 'string'. +@@= skipped -12, +12 lines =@@ + !!! related TS6500 file.tsx:29:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' !!! related TS6500 file.tsx:30:64: The expected type comes from property 'y3' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -+!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e2 = - ~~~~~~~~~~~~~~~ -+ ~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. --!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. --!!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. --!!! error TS2769: Property 'y3' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }'. --!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. + !!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + !!! error TS2769: Type '{ y1: string; y2: number; y3: true; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +@@= skipped -12, +12 lines =@@ !!! error TS2769: Type 'string' is not assignable to type 'boolean'. !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -+!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e3 = - ~~~~~~~~~~~~~~~ -+ ~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. --!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. --!!! error TS2769: Type 'string' is not assignable to type 'Element'. --!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' + !!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + !!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. +@@= skipped -12, +12 lines =@@ + !!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -+!!! related TS2771 file.tsx:30:18: The last overload is declared here. const e4 = Hi - ~~~~~~~~~~~~~~~ -+ ~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. --!!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Property 'children' does not exist on type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. --!!! error TS2769: Overload 2 of 3, '(a: { y1?: string; y2?: number; children: Element; }): Element', gave the following error. --!!! error TS2769: 'TestingOptional' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of 'children' is 'Element'. --!!! error TS2769: Overload 3 of 3, '(a: { y1: boolean; y2?: number; y3: boolean; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type 'string' is not assignable to type 'boolean'. --!!! related TS6500 file.tsx:29:64: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & { y1?: string; y2?: number; children: Element; }' - !!! related TS6500 file.tsx:30:38: The expected type comes from property 'y1' which is declared here on type 'IntrinsicAttributes & { y1: boolean; y2?: number; y3: boolean; }' -+!!! related TS2771 file.tsx:30:18: The last overload is declared here. - \ No newline at end of file + !!! error TS2769: Overload 1 of 3, '(a: { y1?: string; y2?: number; }): Element', gave the following error. + !!! error TS2769: Type '{ y1: string; y2: number; children: string; }' is not assignable to type 'IntrinsicAttributes & { y1?: string; y2?: number; }'. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload5.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload5.errors.txt.diff index bfe548a208..13418de649 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload5.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentOverload5.errors.txt.diff @@ -2,107 +2,16 @@ +++ new.tsxStatelessFunctionComponentOverload5.errors.txt @@= skipped -0, +0 lines =@@ -file.tsx(48,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -- Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. -- Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. -- Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -- Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. -- Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. -- Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+file.tsx(48,24): error TS2769: No overload matches this call. -+ The last overload gave the following error. - Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. - file.tsx(54,51): error TS2769: No overload matches this call. -- Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -- Type 'number' is not assignable to type 'string'. -- Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -- Type 'number' is not assignable to type 'string'. -- Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+ The last overload gave the following error. - Type 'number' is not assignable to type 'string'. - file.tsx(55,68): error TS2769: No overload matches this call. -- Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -- Type 'boolean' is not assignable to type 'string'. -- Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -- Type 'boolean' is not assignable to type 'string'. -- Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+ The last overload gave the following error. - Type 'boolean' is not assignable to type 'string'. - file.tsx(56,13): error TS2769: No overload matches this call. -- Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. -- Property 'onClick' is missing in type '{ "data-format": true; }' but required in type 'ButtonProps'. -- Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. -- Property 'to' is missing in type '{ "data-format": true; }' but required in type 'LinkProps'. -- Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+ The last overload gave the following error. - Type '{ "data-format": true; }' is not assignable to type 'HyphenProps'. - Types of property '"data-format"' are incompatible. - Type 'boolean' is not assignable to type 'string'. -@@= skipped -81, +63 lines =@@ ++file.tsx(48,12): error TS2769: No overload matches this call. + Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. + Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. +@@= skipped -81, +81 lines =@@ // Error const b0 = {}}>GO; // extra property; - ~~~~~~~~~~ -+ ~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Property 'to' does not exist on type 'IntrinsicAttributes & ButtonProps'. --!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. --!!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & LinkProps'. --!!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'. --!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & HyphenProps'. - !!! error TS2769: Property 'to' does not exist on type 'IntrinsicAttributes & HyphenProps'. -+!!! related TS2771 file.tsx:37:17: The last overload is declared here. - !!! related TS2793 file.tsx:38:17: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. - const b1 = {}} {...obj0}>Hello world; // extra property; - const b2 = ; // extra property -@@= skipped -20, +15 lines =@@ - const b6 = ; // incorrect type for optional attribute - ~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & ButtonProps' --!!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & LinkProps' -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'number' is not assignable to type 'string'. - !!! related TS6500 file.tsx:4:5: The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & HyphenProps' -+!!! related TS2771 file.tsx:37:17: The last overload is declared here. - const b7 = ; // incorrect type for optional attribute - ~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. --!!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & ButtonProps' --!!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & LinkProps' -+!!! error TS2769: The last overload gave the following error. -+!!! error TS2769: Type 'boolean' is not assignable to type 'string'. - !!! related TS6500 file.tsx:5:5: The expected type comes from property 'className' which is declared here on type 'IntrinsicAttributes & HyphenProps' -+!!! related TS2771 file.tsx:37:17: The last overload is declared here. - const b8 = ; // incorrect type for specified hyphanated name - ~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. --!!! error TS2769: Property 'onClick' is missing in type '{ "data-format": true; }' but required in type 'ButtonProps'. --!!! error TS2769: Overload 2 of 3, '(linkProps: LinkProps): Element', gave the following error. --!!! error TS2769: Property 'to' is missing in type '{ "data-format": true; }' but required in type 'LinkProps'. --!!! error TS2769: Overload 3 of 3, '(hyphenProps: HyphenProps): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Type '{ "data-format": true; }' is not assignable to type 'HyphenProps'. - !!! error TS2769: Types of property '"data-format"' are incompatible. - !!! error TS2769: Type 'boolean' is not assignable to type 'string'. --!!! related TS2728 file.tsx:9:5: 'onClick' is declared here. --!!! related TS2728 file.tsx:13:5: 'to' is declared here. -+!!! related TS2771 file.tsx:37:17: The last overload is declared here. \ No newline at end of file + !!! error TS2769: Overload 1 of 3, '(buttonProps: ButtonProps): Element', gave the following error. + !!! error TS2769: Type '{ to: string; onClick: (e: MouseEvent) => void; children: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'. \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt.diff index 853fdcd4c6..099b1ef0ee 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt.diff @@ -1,23 +1,19 @@ --- old.tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt +++ new.tsxStatelessFunctionComponentsWithTypeArguments4.errors.txt @@= skipped -0, +0 lines =@@ - file.tsx(9,15): error TS2769: No overload matches this call. -- Overload 1 of 3, '(): Element', gave the following error. -- Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. -- Property 'a' does not exist on type 'IntrinsicAttributes'. -- Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. -- Type 'number' is not assignable to type 'string'. -- Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. -+ The last overload gave the following error. - Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. - file.tsx(10,15): error TS2769: No overload matches this call. -- Overload 1 of 3, '(): Element', gave the following error. -- Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. -- Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. -- Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. +-file.tsx(9,15): error TS2769: No overload matches this call. ++file.tsx(9,14): error TS2769: No overload matches this call. + Overload 1 of 3, '(): Element', gave the following error. + Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. + Property 'a' does not exist on type 'IntrinsicAttributes'. +@@= skipped -10, +10 lines =@@ + Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. + Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. + Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. - Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. -- Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. -+ The last overload gave the following error. ++ Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: number; a: string; "ignore-prop": boolean; }'. ++ Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. + Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. - Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: unknown; a: unknown; }'. + Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: unknown; a: unknown; }'. @@ -25,36 +21,27 @@ ==== file.tsx (2 errors) ==== -@@= skipped -28, +19 lines =@@ +@@= skipped -16, +18 lines =@@ + // Error + function Baz(arg1: T, arg2: U) { let a0 = - ~~~~~~~~~~~~~~~~~ +- ~~~~~~~~~~~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. --!!! error TS2769: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. --!!! error TS2769: Property 'a' does not exist on type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 3, '(attr: { b: unknown; a: string; "ignore-prop": boolean; }): Element', gave the following error. --!!! error TS2769: Type 'number' is not assignable to type 'string'. --!!! error TS2769: Overload 3 of 3, '(attr: { b: unknown; a: number; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. - !!! error TS2769: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: unknown; a: number; }'. --!!! related TS6500 file.tsx:4:52: The expected type comes from property 'a' which is declared here on type 'IntrinsicAttributes & { b: unknown; a: string; "ignore-prop": boolean; }' - !!! related TS2728 file.tsx:5:49: 'b' is declared here. -+!!! related TS2771 file.tsx:5:18: The last overload is declared here. - let a2 = // missing a - ~~~~~~~~~~~~~~~~~ - !!! error TS2769: No overload matches this call. --!!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. --!!! error TS2769: Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. --!!! error TS2769: Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. --!!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. + !!! error TS2769: Overload 1 of 3, '(): Element', gave the following error. + !!! error TS2769: Type '{ a: number; }' is not assignable to type 'IntrinsicAttributes'. +@@= skipped -18, +18 lines =@@ + !!! error TS2769: Type 'T & { "ignore-prop": true; }' has no properties in common with type 'IntrinsicAttributes'. + !!! error TS2769: Overload 2 of 3, '(attr: { b: number; a: string; "ignore-prop": boolean; }): Element', gave the following error. + !!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: number; a: string; "ignore-prop": boolean; }'. -!!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. --!!! error TS2769: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. -+!!! error TS2769: The last overload gave the following error. ++!!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: number; a: string; "ignore-prop": boolean; }'. ++!!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: number; a: string; "ignore-prop": boolean; }'. + !!! error TS2769: Overload 3 of 3, '(attr: { b: unknown; a: unknown; }): Element', gave the following error. !!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type 'IntrinsicAttributes & { b: unknown; a: unknown; }'. -!!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: unknown; a: unknown; }'. --!!! related TS2728 file.tsx:4:52: 'a' is declared here. +!!! error TS2769: Type 'T & { "ignore-prop": true; }' is not assignable to type '{ b: unknown; a: unknown; }'. +!!! error TS2769: Property 'a' is missing in type '{ b: number; } & { "ignore-prop": true; }' but required in type '{ b: unknown; a: unknown; }'. + !!! related TS2728 file.tsx:4:52: 'a' is declared here. !!! related TS2728 file.tsx:5:55: 'a' is declared here. -+!!! related TS2771 file.tsx:5:18: The last overload is declared here. } \ No newline at end of file