Created
August 13, 2015 02:12
-
-
Save brentsimmons/ee9d819e43ca1c9ac001 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Cocoa | |
var str = "Hello, playground" | |
@objc protocol Thing { | |
func doThing(x: String) throws -> String | |
} | |
@objc class RealThing: NSObject, Thing { | |
func doThing(x: String) throws -> String { | |
return "didAThing" | |
} | |
} | |
//Playground execution failed: /var/folders/v2/skmhdwgn26j4xzg89rjnfl7c0000gn/T/./lldb/792/playground36.swift:12:13: error: type 'RealThing' does not conform to protocol 'Thing' | |
//@objc class RealThing: NSObject, Thing { | |
// ^ | |
// /var/folders/v2/skmhdwgn26j4xzg89rjnfl7c0000gn/T/./lldb/792/playground36.swift:9:7: note: protocol requires function 'doThing' with type '(String) throws -> String' | |
// func doThing(x: String) throws -> String | |
// ^ | |
// /var/folders/v2/skmhdwgn26j4xzg89rjnfl7c0000gn/T/./lldb/792/playground36.swift:14:7: note: Objective-C method 'doThing:error:' provided by method 'doThing' does not match the requirement's selector ('doThing:') | |
// func doThing(x: String) throws -> String { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment