interface Lengthwise {
    length: number;
}

function loggingIdentity‹T extends Lengthwise›(arg: T): T {
    console.log(arg.length); // Now we know it has a .length property, so no more error
    return arg;
}