-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick PR #33426 into release-3.6
Component commits: 4ae62c3 getConstraintDeclaration gets the first declaration with a constraint, rather than just the first declaration b1ad54b Add type annotation 2232f5e Update comment
- Loading branch information
1 parent
46ccaa2
commit 391a73b
Showing
10 changed files
with
137 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/interfaceMergedUnconstrainedNoErrorIrrespectiveOfOrder.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//// [tests/cases/compiler/interfaceMergedUnconstrainedNoErrorIrrespectiveOfOrder.ts] //// | ||
|
||
//// [working.ts] | ||
// minmal samples from #33395 | ||
export namespace ns { | ||
interface Function<T extends (...args: any) => any> { | ||
throttle(): Function<T>; | ||
} | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
} | ||
} | ||
//// [regression.ts] | ||
export namespace ns { | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
} | ||
interface Function<T extends (...args: any) => any> { | ||
throttle(): Function<T>; | ||
} | ||
} | ||
|
||
//// [working.js] | ||
"use strict"; | ||
exports.__esModule = true; | ||
//// [regression.js] | ||
"use strict"; | ||
exports.__esModule = true; |
51 changes: 51 additions & 0 deletions
51
tests/baselines/reference/interfaceMergedUnconstrainedNoErrorIrrespectiveOfOrder.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
=== tests/cases/compiler/working.ts === | ||
// minmal samples from #33395 | ||
export namespace ns { | ||
>ns : Symbol(ns, Decl(working.ts, 0, 0)) | ||
|
||
interface Function<T extends (...args: any) => any> { | ||
>Function : Symbol(Function, Decl(working.ts, 1, 21), Decl(working.ts, 4, 5)) | ||
>T : Symbol(T, Decl(working.ts, 2, 23), Decl(working.ts, 5, 23)) | ||
>args : Symbol(args, Decl(working.ts, 2, 34)) | ||
|
||
throttle(): Function<T>; | ||
>throttle : Symbol(Function.throttle, Decl(working.ts, 2, 57)) | ||
>Function : Symbol(Function, Decl(working.ts, 1, 21), Decl(working.ts, 4, 5)) | ||
>T : Symbol(T, Decl(working.ts, 2, 23), Decl(working.ts, 5, 23)) | ||
} | ||
interface Function<T> { | ||
>Function : Symbol(Function, Decl(working.ts, 1, 21), Decl(working.ts, 4, 5)) | ||
>T : Symbol(T, Decl(working.ts, 2, 23), Decl(working.ts, 5, 23)) | ||
|
||
unary(): Function<() => ReturnType<T>>; | ||
>unary : Symbol(Function.unary, Decl(working.ts, 5, 27)) | ||
>Function : Symbol(Function, Decl(working.ts, 1, 21), Decl(working.ts, 4, 5)) | ||
>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) | ||
>T : Symbol(T, Decl(working.ts, 2, 23), Decl(working.ts, 5, 23)) | ||
} | ||
} | ||
=== tests/cases/compiler/regression.ts === | ||
export namespace ns { | ||
>ns : Symbol(ns, Decl(regression.ts, 0, 0)) | ||
|
||
interface Function<T> { | ||
>Function : Symbol(Function, Decl(regression.ts, 0, 21), Decl(regression.ts, 3, 5)) | ||
>T : Symbol(T, Decl(regression.ts, 1, 23), Decl(regression.ts, 4, 23)) | ||
|
||
unary(): Function<() => ReturnType<T>>; | ||
>unary : Symbol(Function.unary, Decl(regression.ts, 1, 27)) | ||
>Function : Symbol(Function, Decl(regression.ts, 0, 21), Decl(regression.ts, 3, 5)) | ||
>ReturnType : Symbol(ReturnType, Decl(lib.es5.d.ts, --, --)) | ||
>T : Symbol(T, Decl(regression.ts, 1, 23), Decl(regression.ts, 4, 23)) | ||
} | ||
interface Function<T extends (...args: any) => any> { | ||
>Function : Symbol(Function, Decl(regression.ts, 0, 21), Decl(regression.ts, 3, 5)) | ||
>T : Symbol(T, Decl(regression.ts, 1, 23), Decl(regression.ts, 4, 23)) | ||
>args : Symbol(args, Decl(regression.ts, 4, 34)) | ||
|
||
throttle(): Function<T>; | ||
>throttle : Symbol(Function.throttle, Decl(regression.ts, 4, 57)) | ||
>Function : Symbol(Function, Decl(regression.ts, 0, 21), Decl(regression.ts, 3, 5)) | ||
>T : Symbol(T, Decl(regression.ts, 1, 23), Decl(regression.ts, 4, 23)) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/interfaceMergedUnconstrainedNoErrorIrrespectiveOfOrder.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
=== tests/cases/compiler/working.ts === | ||
// minmal samples from #33395 | ||
export namespace ns { | ||
interface Function<T extends (...args: any) => any> { | ||
>args : any | ||
|
||
throttle(): Function<T>; | ||
>throttle : () => Function<T> | ||
} | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
>unary : () => Function<() => ReturnType<T>> | ||
} | ||
} | ||
=== tests/cases/compiler/regression.ts === | ||
export namespace ns { | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
>unary : () => Function<() => ReturnType<T>> | ||
} | ||
interface Function<T extends (...args: any) => any> { | ||
>args : any | ||
|
||
throttle(): Function<T>; | ||
>throttle : () => Function<T> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/cases/compiler/interfaceMergedUnconstrainedNoErrorIrrespectiveOfOrder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @filename: working.ts | ||
// minmal samples from #33395 | ||
export namespace ns { | ||
interface Function<T extends (...args: any) => any> { | ||
throttle(): Function<T>; | ||
} | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
} | ||
} | ||
// @filename: regression.ts | ||
export namespace ns { | ||
interface Function<T> { | ||
unary(): Function<() => ReturnType<T>>; | ||
} | ||
interface Function<T extends (...args: any) => any> { | ||
throttle(): Function<T>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters