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

Remove use of deprecated getByte function #3190

Merged
merged 3 commits into from
Jan 14, 2024

Conversation

mattpolzin
Copy link
Collaborator

@mattpolzin mattpolzin commented Jan 7, 2024

Description

In pursuit of being able to eventually remove the deprecated getByte function, remove its use in the bufferData function and all other locations aside from the one test case that specifically exists to test the getByte function.

Then, realizing that the bufferData function has the same problem as getByte, deprecate bufferData in favor of bufferData' with a similar change in the range as to getByte -> getBits8. Along with deprecating bufferData and introducing bufferData', the compiler source gains a duplicate definition of bufferData' so that it both avoids using a deprecated function and also continues to build using the previous version of the base library; that duplicated function can be removed once we release the next version of the compiler.

Should this change go in the CHANGELOG?

  • If this is a fix, user-facing change, a compiler change, or a new paper
    implementation, I have updated CHANGELOG_NEXT.md (and potentially also
    CONTRIBUTORS.md).

@mattpolzin mattpolzin changed the title Remove deprecated use Remove use of deprecated getByte function Jan 7, 2024
@buzden
Copy link
Contributor

buzden commented Jan 8, 2024

You are changing signature of one function from Int to Bits8 and making a copy of another function with the same change in signature. Why not to just change signature in both places? Is it about bootstrapping the compiler? We could move only the old function to src/Libraries instead, couldn't we?

@mattpolzin
Copy link
Collaborator Author

I’ll explain my change by eliminating alternatives.

I couldn’t just leave the compiler using bufferData because I deprecated that function and the compiler as warnings as errors turned on so that would be a compile time error (specifically when self-hosting).

I couldn’t just change the compiler to use buffer data’ because that would be a compiler error when building from the previous version of the base library.

So I could copy either the old bufferData or the new bufferData’ into the compiler to avoid depending on either the old or new base library states. After the next release. I want the compiler to use bufferData’, so that’s the one I copied into the compiler.

@mattpolzin
Copy link
Collaborator Author

Unless your suggestion was to delete base’s bufferData (moving it to the compiler for now). I want to deprecate before removing from base as was done with the getByte function leaving removal for some future release.

@mattpolzin mattpolzin merged commit 073fbef into idris-lang:main Jan 14, 2024
22 checks passed
@mattpolzin mattpolzin deleted the remove-deprecated-use branch January 14, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants