   let _: Any? = t.p
 
   // CHECK: witness_method $T, #P.p!getter.1
-  // CHECK: function_ref @$S7ranking7genericyyxlF
-  generic(t.p)
+  // CHECK: function_ref @$S7ranking15genericOverloadyyxlF
+  genericOverload(t.p)
   // CHECK: witness_method $T, #P.q!getter.1
-  // CHECK: function_ref @$S7ranking7genericyyxSglF
-  generic(t.q)
+  // CHECK: function_ref @$S7ranking15genericOverloadyyxSglF
+  genericOverload(t.q)
   // CHECK: witness_method $T, #P.p!getter.1
-  // CHECK: function_ref @$S7ranking10genericOptyyxSglF
-  genericOpt(t.p)
+  // CHECK: function_ref @$S7ranking15genericOptionalyyxSglF
+  genericOptional(t.p)
   // CHECK: witness_method $T, #P.q!getter.1
-  // CHECK: function_ref @$S7ranking10genericOptyyxSglF
-  genericOpt(t.q)
+  // CHECK: function_ref @$S7ranking15genericOptionalyyxSglF
+  genericOptional(t.q)
+  // CHECK: witness_method $T, #P.p!getter.1
+  // CHECK: function_ref @$S7ranking17genericNoOptionalyyxlF
+  genericNoOptional(t.p)
+  // CHECK: witness_method $T, #P.q!getter.1
+  // CHECK: function_ref @$S7ranking17genericNoOptionalyyxlF
+  genericNoOptional(t.q)
 }
 
 extension P {

class Derived : Base {
}

func generic<T>(_: T) {}
func generic<T>(_: T?) {}
func genericOpt<T>(_: T?) {}

// CHECK-LABEL: sil hidden @$S7ranking22propertyVersusFunctionyyAA1P_p_xtAaCRzlF
func propertyVersusFunction<T : P>(_ p: P, _ t: T) {

    let _: Any = self.p
    // CHECK: witness_method $Self, #P.p!getter.1
    let _: Any? = self.p

    // CHECK: witness_method $Self, #P.p!getter.1
    // CHECK: function_ref @$S7ranking15genericOverloadyyxlF
    genericOverload(self.p)
    // CHECK: witness_method $Self, #P.q!getter.1
    // CHECK: function_ref @$S7ranking15genericOverloadyyxSglF
    genericOverload(self.q)
    // CHECK: witness_method $Self, #P.p!getter.1
    // CHECK: function_ref @$S7ranking15genericOptionalyyxSglF
    genericOptional(self.p)
    // CHECK: witness_method $Self, #P.q!getter.1
    // CHECK: function_ref @$S7ranking15genericOptionalyyxSglF
    genericOptional(self.q)
    // CHECK: witness_method $Self, #P.p!getter.1
    // CHECK: function_ref @$S7ranking17genericNoOptionalyyxlF
    genericNoOptional(self.p)
    // CHECK: witness_method $Self, #P.q!getter.1
    // CHECK: function_ref @$S7ranking17genericNoOptionalyyxlF
    genericNoOptional(self.q)
  }
}

