You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the process of migrating from: implementation 'org.jdeferred:jdeferred-android-aar:1.2.6'
to: implementation 'org.jdeferred.v2:jdeferred-android-aar:2.0.0'
After replacing org.jdeferred with org.jdeferred2 everywhere, I got a last issue in a class named DeferredObjectWithExceptions. This extends DeferredObject and overrides the then method but this doesn't work anymore. And the new overridden methods don't work with my PipedPromiseWithExceptions class.
First I get this errror:
Type inference failed: constructor PipedPromiseWithExceptions<D, F, P, D_OUT, F_OUT, P_OUT>(promise: Promise<D#1 (type parameter of PipedPromiseWithExceptions), F#1 (type parameter of PipedPromiseWithExceptions), P#1 (type parameter of PipedPromiseWithExceptions)>, doneFilter: DonePipe<D#1, D_OUT#1 (type parameter of PipedPromiseWithExceptions), F_OUT, P_OUT>?, failFilter: FailPipe<F#1, D_OUT#1, F_OUT, P_OUT>?, progressFilter: ProgressPipe<P#1, D_OUT#1, F_OUT, P_OUT>?)
cannot be applied to
(DeferredObjectWithExceptions<D#2 (type parameter of DeferredObjectWithExceptions), F#2 (type parameter of DeferredObjectWithExceptions), P#2 (type parameter of DeferredObjectWithExceptions)>,DoneFilter<in D#2, out D_OUT#2 (type parameter of DeferredObjectWithExceptions.then)>?,Nothing?,Nothing?)
This is my code file:
import org.jdeferred2.DonePipe
import org.jdeferred2.FailPipe
import org.jdeferred2.ProgressPipe
import org.jdeferred2.Promise
class PipedPromiseWithExceptions<D, F, P, D_OUT, F_OUT, P_OUT>(
promise: Promise<D, F, P>,
doneFilter: DonePipe<D, D_OUT, F_OUT, P_OUT>?,
failFilter: FailPipe<F, D_OUT, F_OUT, P_OUT>?,
progressFilter: ProgressPipe<P, D_OUT, F_OUT, P_OUT>?) : DeferredObjectWithExceptions<D_OUT, F_OUT, P_OUT>(), Promise<D_OUT, F_OUT, P_OUT> {
init {
promise.done { result ->
if (doneFilter != null) {
pipe(doneFilter.pipeDone(result))
} else {
// Unchecked cast... but yea that is how PipedPromise.java normally works.
@Suppress("UNCHECKED_CAST")
resolve(result as D_OUT)
}
}.fail { result ->
if (failFilter != null) {
pipe(failFilter.pipeFail(result))
} else {
// Unchecked cast... but yea that is how PipedPromise.java normally works.
@Suppress("UNCHECKED_CAST")
reject(result as F_OUT)
}
}.progress { progress ->
if (progressFilter != null) {
pipe(progressFilter.pipeProgress(progress))
} else {
// Unchecked cast... but yea that is how PipedPromise.java normally works.
@Suppress("UNCHECKED_CAST")
notify(progress as P_OUT)
}
}
}
protected fun pipe(promise: Promise<D_OUT, F_OUT, P_OUT>): Promise<D_OUT, F_OUT, P_OUT> {
promise.done { result -> resolve(result) }.fail { result -> reject(result) }.progress { progress -> notify(progress) }
return promise
}
}
When changing
DonePipe<D, D_OUT, F_OUT, P_OUT>? -> DoneFilter<in D, out D_OUT>? FailPipe<F, D_OUT, F_OUT, P_OUT>? -> FailFilter<in F, out F_OUT>? ProgressPipe<P, D_OUT, F_OUT, P_OUT>? -> ProgressFilter<in P, out P_OUT>?
I have an error in protected fun pipe(promise: D_OUT)
How can I keep this working the way it was working in the old version?
I'm in the process of migrating from:
implementation 'org.jdeferred:jdeferred-android-aar:1.2.6'
to:
implementation 'org.jdeferred.v2:jdeferred-android-aar:2.0.0'
After replacing
org.jdeferred
withorg.jdeferred2
everywhere, I got a last issue in a class namedDeferredObjectWithExceptions
. This extendsDeferredObject
and overrides thethen
method but this doesn't work anymore. And the new overridden methods don't work with myPipedPromiseWithExceptions
class.First I get this errror:
This is my code file:
When changing
DonePipe<D, D_OUT, F_OUT, P_OUT>?
->DoneFilter<in D, out D_OUT>?
FailPipe<F, D_OUT, F_OUT, P_OUT>?
->FailFilter<in F, out F_OUT>?
ProgressPipe<P, D_OUT, F_OUT, P_OUT>?
->ProgressFilter<in P, out P_OUT>?
I have an error in
protected fun pipe(promise: D_OUT)
How can I keep this working the way it was working in the old version?
The text was updated successfully, but these errors were encountered: