function getProperty(o: T, name: K): T[K] {
    return o[name]; // o[name] is of type T[K]
}