| 1 | /// 泛型: 泛型类与泛型约束 |
| 2 | /// 泛型类 |
| 3 | class Log<T> { |
| 4 | // static run(value: T) { // 泛型不能用于类的静态成员 |
| 5 | run(value: T) { |
| 6 | console.log(value) |
| 7 | return value |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | // let log1 = new Log<number>() |
| 12 | // log1.run(1) |
nothing calls this directly
no outgoing calls
no test coverage detected