13 lines
335 B
TypeScript
13 lines
335 B
TypeScript
|
function diamondTop<Top>() {
|
||
|
function diamondMiddle<T, U>() {
|
||
|
function diamondBottom<Bottom extends Top | T | U>() {
|
||
|
var top: Top;
|
||
|
var middle: Top | T | U;
|
||
|
var bottom: Bottom;
|
||
|
|
||
|
top = middle;
|
||
|
middle = bottom;
|
||
|
top = bottom;
|
||
|
}
|
||
|
}
|
||
|
}
|