class Empty {} class TwoInts { var x, y : Int constructor(a : Int, b : Int) { x = a y = b } } class ComputedProperty { var value : Int { get: var result : Int return result } } // Generics class Pair { var first : A var second : B constructor(a : A, b : B) { first = a second = b } } class GenericCtor { constructor(t : T) {} func doSomething(t : T) {} } // Protocols protocol Resettable { func reset() } class ResettableIntWrapper : Resettable { var value : Int func reset() { var zero : Int value = zero } } protocol Computable { func compute() } typealias Cacheable = protocol protocol SpecialResettable : Resettable, Computable {} // Inheritance class StillEmpty : Empty, Resettable { func reset() {} } class BoolPair : Pair { func bothTrue() -> Bool { return first && second } } class SpecialPair : Computable, Pair { func compute() {} }