Created
July 17, 2014 02:04
-
-
Save kongtomorrow/f8d4a485ca4ff53ee728 to your computer and use it in GitHub Desktop.
sekret protocol requirements!
This file contains 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
class FooColl : Swift.Collection { | |
/* Secret protocol conformance requirements! Apparently Collection | |
inherits from a "_Collection" protocol that has more stuff. | |
error: type 'FooColl' does not conform to protocol '_Collection' | |
class FooColl : Swift.Collection { | |
^ | |
Swift._Collection:3:19: note: protocol requires property 'startIndex' with type 'FooColl.IndexType' | |
/*@public*/ var startIndex: IndexType { get } | |
^ | |
Swift._Collection:4:19: note: protocol requires property 'endIndex' with type 'FooColl.IndexType' | |
/*@public*/ var endIndex: IndexType { get } | |
^ | |
*/ | |
// var startIndex : Int { get { return 2 } } | |
// var endIndex : Int { get { return 9 } } | |
func generate() -> GeneratorOf<Int> { | |
var i = 2 | |
return GeneratorOf<Int> { | |
if i < 10 { | |
return i | |
} else { | |
return nil | |
} | |
} | |
} | |
subscript (i: Int) -> Int { | |
get{ | |
return 0 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment