Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 723 Bytes

File metadata and controls

34 lines (26 loc) · 723 Bytes

5.3.1 RELEASE

public enum AnyStylePropertyValue {
  case inherit
  case value(Any)

  public init?<T>(_ concreteValue: StylePropertyValue<T>?) {
    if let concreteValue = concreteValue {
      self.init(concreteValue)
      return
    }
    return nil
  }

  public init<T>(_ concreteValue: StylePropertyValue<T>) {
    switch concreteValue {
    case .inherit:
      self = .inherit
    case let .value(value):
      self = .value(value)
    }
  }
}

compile in release mode crashes when return statement after self.init is not present, but passes when compiling in debug mode

5.4.1 RELEASE

unnecessary [unowned self] causes compiler crash without appropriate error message

[unowned weak] does not