Properties with generic type
问题 Is it possible to have properties with generic type? What I am trying to do: Have a base class called Value with the following structure: class Value { var genericProperty: T init<T>(type: T) { switch type.self { case is Int.Type: genericProperty is Int case is [Int.Type]: genericProperty is [Int] default: genericProperty is Any } } } Then have a bunch of subclasses that define what the type of genericProperty should be. Something like this: class IntValue: Value { override init<T>(type: T) {