Generic classes in Swift

class Size<T> {
    var width: T
    var height: T
    
    init(_ width: T_ height: T) {
        self.width = width
        self.height = height
    }
    
    func asText() -> String {
        return "[\(width); \(height)]"
    }
}

let sizeInt = Size<Int>(58)
let textInt = sizeInt.asText()
//textInt is "[5; 8]"

let sizeFloat = Size<Float>(3.71.58)
let textFloat = sizeFloat.asText()
//textFloat is "[3.7; 1.58]"