   if of != nil {
     of!()
   } else {
-    print("Object does not respond to the selector \"f\".\n", terminator: "")
+    print("\(type(of: obj)) does not respond to the selector \"f\"")
+  }
+}
+
+func test_dynamic_lookup_e_unbound(_ obj: AnyObject) {
+  var oe = AnyObject.e(obj)
+  if oe != nil {
+    oe!()
+  } else {
+    print("\(type(of: obj)) does not respond to the selector \"e\"")
   }
 }
 

// REQUIRES: objc_interop

import Foundation

class X {
  init() {}

print(type(of: AnyObject.f))
// CHECK-NEXT: X.f()
test_dynamic_lookup_f_unbound(X())
// CHECK-NEXT: Y does not respond to the selector "f"
test_dynamic_lookup_f_unbound(Y())
// CHECK-NEXT: Z.f()
test_dynamic_lookup_f_unbound(Z())

// CHECK-NEXT: (AnyObject) -> Optional<() -> ()>
print(type(of: AnyObject.e))
// CHECK-NEXT: X.e()
test_dynamic_lookup_e_unbound(X())
// CHECK-NEXT: Y does not respond to the selector "e"
test_dynamic_lookup_e_unbound(Y())
// CHECK-NEXT: Z does not respond to the selector "e"
test_dynamic_lookup_e_unbound(Z())

// CHECK: Class does not respond to the selector "g"
test_dynamic_lookup_g(X())
