Typechecking timeout compiling tests in v7
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start in Tests/Cancel/DispatcherTests.swift at testMapValues(), then compare type-checking with and without the cancellize() calls. Use swift -debug-constraints to inspect the reported 259 type decisions. Done means identifying whether cancellable promises cause the timeout and documenting or addressing the confirmed cause.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With the cancellation code merged into v7, my hamster-wheel-powered Mac Mini is timing out while compiling Tests/Cancel/DispatcherTests.swift -> testMapValues().
func testMapValues() {
let ex1 = expectation(description: "DispatchQueue MapValues compatibility")
Promise.value([42, 52]).cancellize().then(on: .global(qos: .background), flags: .barrier) { v -> Promise<[Int]> in
Promise.value(v)
}.compactMap(on: .global(qos: .background), flags: .barrier) {
$0
}.mapValues(on: .global(qos: .background), flags: .barrier) {
$0 + 10
}.flatMapValues(on: .global(qos: .background), flags: .barrier) {
[$0 + 10]
}.compactMapValues(on: .global(qos: .background), flags: .barrier) {
$0 + 10
}.thenMap(on: .global(qos: .background), flags: .barrier) { v -> CancellablePromise<Int> in
Promise.value(v + 10).cancellize()
}.thenMap(on: .global(qos: .background), flags: .barrier) { v -> Promise<Int> in
Promise.value(v + 10)
}.thenFlatMap(on: .global(qos: .background), flags: .barrier) {
Promise.value([$0 + 10]).cancellize()
}.thenFlatMap(on: .global(qos: .background), flags: .barrier) { v -> Promise<[Int]> in
Promise.value([v + 10])
}.filterValues(on: .global(qos: .background), flags: .barrier) { _ in
true
}.sortedValues(on: .global(qos: .background), flags: .barrier).firstValue(on: .global(qos: .background), flags: .barrier) { _ in
true
}.done(on: .global(qos: .background), flags: .barrier) {
XCTAssertEqual($0, 112)
ex1.fulfill()
}.catch(on: .global(qos: .background), flags: .barrier) { _ in
XCTFail()
}
The error is the usual "The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions".
This is a pretty complicated expression to resolve (259 separate type decisions, according to swift -debug-constraints), but I'm a bit suspicious that the complexity may derive from the use of cancellable promises. If you edit out the calls to cancellize(), it compiles fine.
@dougzilla32, is there some reason why cancellable promises might have a broader API than regular promises?
- Lingua principale
- Swift
- Stelle
- 14.2k
- Fork
- 1.5k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mxcl/PromiseKit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mxcl/PromiseKit#1362 · 1 commento · 1 reazione ·
-
CocoaPods supportAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
mxcl/PromiseKit#1361 · 6 commenti · 2 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
mxcl/PromiseKit#1356 · 3 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
mxcl/PromiseKit#1347 · 5 commenti · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
mxcl/PromiseKit#1244 · 1 commento · 1 reazione ·
Tutte le issue di mxcl/PromiseKit
Issue simili
-
builtin-port enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
cmlarsen/writemorebetter#235 ·
I maintainer di solito rispondono entro 1 giorno
-
bug-pending-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NativeScript/NativeScript#11525 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
callstack/agent-device#3627 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno