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
root@7093981bc8fc:~/PackageTest# swift build | |
Compiling Swift Module 'SwiftState' (14 sources) | |
swift: /home/buildslave/jenkins/workspace/oss-swift-linux-packages-ubuntu_14_04-one-off-build/swift/lib/SILPasses/IPO/CapturePromotion.cpp:831: swift::SILFunction *constructClonedFunction(swift::PartialApplyInst *, swift::FunctionRefInst *, IndicesSet &): Assertion `!genericSig && "Function type has Unexpected generic signature!"' failed. | |
0 swift 0x0000000002f15268 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 | |
1 swift 0x0000000002f13a36 llvm::sys::RunSignalHandlers() + 54 | |
2 swift 0x0000000002f15d9a | |
3 libpthread.so.0 0x00007f1e39e14340 | |
4 libc.so.6 0x00007f1e3903ccc9 gsignal + 57 | |
5 libc.so.6 0x00007f1e390400d8 abort + 328 | |
6 libc.so.6 0x00007f1e39035b86 |
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
extension String | |
{ | |
// https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm | |
// http://www.cin.br/~paguso/courses/if767/bib/Horspool_1980.pdf | |
public func indexOf_horspool(pattern: String) -> String.Index? | |
{ | |
let patternLength = pattern.characters.count | |
assert(patternLength > 0) | |
assert(patternLength <= self.characters.count) |
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
- (void)testExample { | |
MyObject* obj = [[MyObject alloc] init]; | |
obj.array = @[]; | |
NSMutableArray* array = [obj mutableArrayValueForKey:@"array"]; | |
// NSMutableArray* array = @[].mutableCopy; // using this will pass test | |
__weak NSMutableArray* weakArray = array; | |
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
// # Bug description | |
// `@discardableResult` won't work when: | |
// 1. optional chaining | |
// 2. function returns Optional + non-Void value | |
// | |
// ## See also | |
// - https://bugs.swift.org/browse/SR-1052 | |
// - https://bugs.swift.org/browse/SR-1681 | |
// - https://bugs.swift.org/browse/SR-1929 |
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
diff --git Tests/ReactiveSwiftTests/SignalProducerSpec.swift Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
index 21362e7..a363327 100644 | |
--- Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
+++ Tests/ReactiveSwiftTests/SignalProducerSpec.swift | |
@@ -1413,13 +1413,14 @@ class SignalProducerSpec: QuickSpec { | |
} | |
} | |
- describe("disposal") { | |
+ fdescribe("disposal") { |
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
func test<T>(_ f: (T) -> Void) {} | |
let intF: (Int) -> Void = { _ in } | |
let voidF: () -> Void = { } | |
test(intF) // works | |
//test(voidF) // error: cannot convert value of type '() -> Void' to expected argument type '(_) -> Void' | |
//: # Workaround for zero-argument func to be passed into `test` |
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
import Foundation | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
class A: NSObject { | |
let name: String | |
var callback: (() -> ())? | |
func funcDo() {} |
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 MyObj { | |
let arr1: [Int] = Array(0...100) | |
// Test A: Source Element = Typed | |
// 9.1ms | |
func test1() { | |
let arr = arr1 | |
.filter { $0 % 2 == 0 } |
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
import Foundation | |
struct DebugTimeInterval: ExpressibleByFloatLiteral { | |
let rawValue: TimeInterval | |
public init(floatLiteral value: TimeInterval) { | |
self.rawValue = value | |
} | |
var tweaked: TimeInterval { |