title: Optional field type doesn't conform protocol in Swift 3
body: <p>I have a class with 1 optional field and 1 non-optional field, both of them with Type <strong>AnotherClass</strong> and also conform <strong><em>CustomProtocol</em></strong>:</p>
  
  <pre><code>protocol CustomProtocol {}
  
  class CustomClass: CustomProtocol {
  
      var nonoptionalField: AnotherClass = AnotherClass()
      var optionalField: AnotherClass?
  
  }
  
  class AnotherClass: CustomProtocol {
  
  }
  </code></pre>
  
  <p>The field <strong>nonoptionalField</strong> is type <strong><em>AnotherClass</em></strong> and conforms <strong><em>CustomProtocol</em></strong>.</p>
  
  <p>On the other hand, <strong>optionalField</strong> is actually <strong><em>Optional&lt; AnotherClass></em></strong> and therefore DOES NOT conform <strong><em>CustomProtocol</em></strong>:</p>
  
  <pre><code>for field in Mirror(reflecting: CustomClass()).children {
      let fieldMirror = Mirror(reflecting: field.value)
      if fieldMirror.subjectType is CustomProtocol.Type {
          print("\(field.label!) is \(fieldMirror.subjectType) and conforms CustomProtocol")
      } else {
          print("\(field.label!) is \(fieldMirror.subjectType) and DOES NOT conform CustomProtocol")
      }
  }
  // nonoptionalField is AnotherClass and conforms CustomProtocol
  // optionalField is Optional&lt;AnotherClass&gt; and DOES NOT conform CustomProtocol
  </code></pre>
  
  <p>How can I unwrap the Type (not the value) of <strong>optionalField</strong> property, so that I can associate it with its protocol <strong><em>CustomProtocol</em></strong>?</p>
  
  <p>In other words, how can I get the wrapped Type <strong><em>AnotherClass</em></strong> from <strong><em>Optional&lt; AnotherClass></em></strong> Type?</p>
  
  <p><strong>LIMITATION:</strong> </p>
  
  <p>I really have to use Swift reflection through Mirror and unfortunately the property <strong>.subjectType</strong> doesn't allow to unwrap the optional wrapped Type of <strong><em>Optional&lt; AnotherClass></em></strong> so far.</p>