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

Change IO::Buffered#peek's return type to Bytes #13863

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Oct 5, 2023

Fixes #8163. Fixes #13720. Fixes #13792. It is marked as a regression because #11242 introduced new code paths on master that call IO::Buffered#peek.

Here Bytes.empty and IO::Buffered#@in_buffer_rem are both Bytes, so indeed the def can never return nil.

The underlying compiler bug is not affected. For an explanation of the bug see #13862.

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🚀

@straight-shoota straight-shoota added this to the 1.10.0 milestone Oct 5, 2023
@straight-shoota straight-shoota merged commit 5ed476a into crystal-lang:master Oct 5, 2023
47 checks passed
@HertzDevil HertzDevil deleted the bug/io-buffered-peek2 branch October 9, 2023 01:26
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug kind:regression Something that used to correctly work but no longer works topic:stdlib:files
Projects
None yet
2 participants