Conflicts: tests/baselines/reference/APISample_compile.types tests/baselines/reference/APISample_linter.types tests/baselines/reference/APISample_transform.types tests/baselines/reference/APISample_watcher.types
48 lines
906 B
Text
48 lines
906 B
Text
=== tests/cases/compiler/typeParameterDiamond1.ts ===
|
|
function diamondTop<Top>() {
|
|
>diamondTop : <Top>() => void
|
|
>Top : Top
|
|
|
|
function diamondMiddle<T extends Top, U extends Top>() {
|
|
>diamondMiddle : <T extends Top, U extends Top>() => void
|
|
>T : T
|
|
>Top : Top
|
|
>U : U
|
|
>Top : Top
|
|
|
|
function diamondBottom<Bottom extends T | U>() {
|
|
>diamondBottom : <Bottom extends T | U>() => void
|
|
>Bottom : Bottom
|
|
>T : T
|
|
>U : U
|
|
|
|
var top: Top;
|
|
>top : Top
|
|
>Top : Top
|
|
|
|
var middle: T | U;
|
|
>middle : T | U
|
|
>T : T
|
|
>U : U
|
|
|
|
var bottom: Bottom;
|
|
>bottom : Bottom
|
|
>Bottom : Bottom
|
|
|
|
top = middle;
|
|
>top = middle : T | U
|
|
>top : Top
|
|
>middle : T | U
|
|
|
|
middle = bottom;
|
|
>middle = bottom : Bottom
|
|
>middle : T | U
|
|
>bottom : Bottom
|
|
|
|
top = bottom;
|
|
>top = bottom : Bottom
|
|
>top : Top
|
|
>bottom : Bottom
|
|
}
|
|
}
|
|
}
|