mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Add policies for Callable things as a workaround for <rdar://problem/13251236>
(remapping bound function type not implemented yet) Swift SVN r5454
This commit is contained in:
18
test/stdlib/Algorithm.swift
Normal file
18
test/stdlib/Algorithm.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
// RUN: %swift -i %s | FileCheck %s
|
||||
|
||||
struct IsSpace : Predicate {
|
||||
typealias Arguments = CodePoint
|
||||
typealias Result = Bool
|
||||
func __call__(c: CodePoint) -> Result {
|
||||
return c.isSpace()
|
||||
}
|
||||
}
|
||||
|
||||
func testApply() {
|
||||
// CHECK: false
|
||||
println(apply(IsSpace(), 'x'))
|
||||
|
||||
// CHECK: true
|
||||
println(apply(IsSpace(), '\n'))
|
||||
}
|
||||
testApply()
|
||||
Reference in New Issue
Block a user