Skip to content

Commit

Permalink
Remove Method of zero_like_rdata_from_type (#279)
Browse files Browse the repository at this point in the history
* Remove method of zero_like_rdata_from_type for TypeVar

* Remove another method and a test

* Bump patch version

* Remove redundant methods

* Remove redundant test

* Formatting
  • Loading branch information
willtebbutt authored Oct 4, 2024
1 parent 02fc1f5 commit 534fc19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Mooncake"
uuid = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
authors = ["Will Tebbutt, Hong Ge, and contributors"]
version = "0.4.7"
version = "0.4.8"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
4 changes: 0 additions & 4 deletions src/interpreter/zero_like_rdata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ function zero_like_rdata_type(::Type{P}) where {P}
return can_produce_zero_rdata_from_type(P) ? R : Union{R, ZeroRData}
end

zero_like_rdata_type(::TypeVar) = NoRData

"""
zero_like_rdata_from_type(::Type{P}) where {P}
Expand All @@ -37,5 +35,3 @@ It is always valid to return a `ZeroRData`,
function zero_like_rdata_from_type(::Type{P}) where {P}
return can_produce_zero_rdata_from_type(P) ? zero_rdata_from_type(P) : ZeroRData()
end

zero_like_rdata_from_type(::TypeVar) = NoRData()
9 changes: 1 addition & 8 deletions test/interpreter/zero_like_rdata.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
@testset "zero_like_rdata" begin
@testset "zero_like_rdata_from_type" begin
@testset "$P" for P in Any[
@NamedTuple{a},
Tuple{Any},
Float64,
Int,
Vector{Float64},
TypeVar(:a),
]
@testset "$P" for P in [@NamedTuple{a}, Tuple{Any}, Float64, Int, Vector{Float64}]
@test Mooncake.zero_like_rdata_from_type(P) isa Mooncake.zero_like_rdata_type(P)
end
end
Expand Down

2 comments on commit 534fc19

@willtebbutt
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/116589

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.8 -m "<description of version>" 534fc19cc9c371ba9505579d5b65b3f159d38615
git push origin v0.4.8

Please sign in to comment.