-
Notifications
You must be signed in to change notification settings - Fork 47
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
Checking type size is not enough #67
Comments
Yes, this is true. There are, at least at the moment, many ways to shoot yourself in the foot, if you really want to. I spent quite some time to come up with an API that uses more strict typing, but it's really not as trivial as it may seem on first sight. If you have concrete suggests, your PR will be very much appreciated. |
no I just started to read the source and stumbled on https://github.com/FutureSDR/FutureSDR/blob/main/src/blocks/fft.rs#L104 which made me take note here. It would be great to at least check that all downstream node's scalar are compatible to the input scalar of current node. |
You can cast the stream inputs and outputs to anything. That's not specific to this mutable reference to the input. It's the case for all stream connections. A runtime check should be rather easy to implement by requiring any item type to implement |
that would definitely be the reasonable way to go 👍 |
Implemented in ba57854. Stream inputs/outputs are created with the actual type This |
There is currently a type size check at runtime, preventing out of array access for input consumers. https://docs.rs/futuresdr/latest/src/futuresdr/runtime/topology.rs.html#199
This does not prevent undefined behaviour, for example it allows to connect
f64
toComplex<f32>
arguments:The text was updated successfully, but these errors were encountered: