diff --git a/Project.toml b/Project.toml index b54e8b122..225897708 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Mooncake" uuid = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6" authors = ["Will Tebbutt, Hong Ge, and contributors"] -version = "0.4.20" +version = "0.4.21" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/rrules/builtins.jl b/src/rrules/builtins.jl index 3e4a101f7..4e0ed19a1 100644 --- a/src/rrules/builtins.jl +++ b/src/rrules/builtins.jl @@ -789,7 +789,7 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins}) # Core._primitivetype -- NEEDS IMPLEMENTING AND TESTING # Core._setsuper! -- NEEDS IMPLEMENTING AND TESTING # Core._structtype -- NEEDS IMPLEMENTING AND TESTING - (false, :none, nothing, Core._svec_ref, svec(5, 4), 2), + (false, :none, _range, Core._svec_ref, svec(5, 4), 2), # Core._typebody! -- NEEDS IMPLEMENTING AND TESTING (false, :stability, nothing, <:, Float64, Int), (false, :stability, nothing, <:, Any, Float64), @@ -799,8 +799,8 @@ function generate_hand_written_rrule!!_test_cases(rng_ctor, ::Val{:builtins}) (false, :stability, nothing, ===, randn(5), randn(3)), (false, :stability, nothing, ===, 5.0, 5.0), (true, :stability, nothing, Core._typevar, :T, Union{}, Any), - (false, :none, (lb=1e-3, ub=100.0), Core.apply_type, Vector, Float64), - (false, :none, (lb=1e-3, ub=100.0), Core.apply_type, Array, Float64, 2), + (false, :none, _range, Core.apply_type, Vector, Float64), + (false, :none, _range, Core.apply_type, Array, Float64, 2), # Core.compilerbarrier -- NEEDS IMPLEMENTING AND TESTING # Core.const_arrayref -- NEEDS IMPLEMENTING AND TESTING # Core.donotdelete -- NEEDS IMPLEMENTING AND TESTING diff --git a/src/test_resources.jl b/src/test_resources.jl index b76222b26..b6f821338 100644 --- a/src/test_resources.jl +++ b/src/test_resources.jl @@ -562,6 +562,10 @@ function non_const_global_ref(y::Float64) return __x_for_non_const_global_ref end +# The inferred type of `TypeVar(...)` is `CC.PartialTypeVar`. Thanks to Jameson Nash for +# pointing out this pleasantly simple test case. +partial_type_var() = TypeVar(:a, Union{}, Any) + function generate_test_functions() return Any[ (false, :allocs, nothing, const_tester), @@ -738,6 +742,7 @@ function generate_test_functions() (false, :allocs, nothing, inlinable_invoke_call, 5.0), (false, :none, nothing, inlinable_vararg_invoke_call, (2, 2), 5.0, 4.0, 3.0, 2.0), (false, :none, nothing, hvcat, (2, 2), 3.0, 2.0, 0.0, 1.0), + (false, :none, nothing, partial_type_var), ] end