Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the * in DispatchQueue scheduler's SchedulerTimeType gives wrong value #214

Open
ibrahimkteish opened this issue Jul 28, 2021 · 3 comments

Comments

@ibrahimkteish
Copy link

ibrahimkteish commented Jul 28, 2021

Hello,

the SchedulerTimeType of DispatchQueue has a Stride struct, I was wondering why the implementation of this returns Stride(magnitude: 0) not something like return Stride(.nanoseconds(lhs.magnitude * rhs.magnitude))

lets say for some reason you have the following func:

func multiply<S: Scheduler>( lhs: S.SchedulerTimeType.Stride,
                             rhs: S.SchedulerTimeType.Stride,
                             on scheduler: S) -> S.SchedulerTimeType.Stride {
  return lhs * rhs
}

print("<><> \(multiply(lhs: 1, rhs: 10, on: DispatchQueue.main))")

in Combine this prints: <><> Stride(magnitude: 10000000000)
in OpenCombine prints: <><> Stride(magnitude: 0)

@ibrahimkteish ibrahimkteish changed the title Question: the * in DispatchQueue scheduler's SchedulerTimeType the * in DispatchQueue scheduler's SchedulerTimeType Jul 28, 2021
@ibrahimkteish ibrahimkteish changed the title the * in DispatchQueue scheduler's SchedulerTimeType the * in DispatchQueue scheduler's SchedulerTimeType gives wrong value Jul 28, 2021
@broadwaylamb
Copy link
Member

On which OS version are you seeing this?

@ibrahimkteish
Copy link
Author

ibrahimkteish commented Jul 29, 2021

iPhone 11 Pro iOS 14.6

Btw, if I use the same code on iPhone 8 iOS 13.1.1 the I get a crash
Screenshot 2021-07-29 at 11 25 28

also the code works on playground

Xcode Version 12.5.1 (12E507)

@ibrahimkteish
Copy link
Author

@broadwaylamb any updates on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants