Skip to content

Commit

Permalink
Fix 2-arg @inferred (#796)
Browse files Browse the repository at this point in the history
* test 2-arg `@inferred` with kwargs

* fix #795

* bump version to 3.46.2
  • Loading branch information
alyst authored Mar 23, 2023
1 parent 3a03b54 commit 2ad6ee4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Compat"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.46.1"
version = "3.46.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
2 changes: 2 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ end
# https://github.com/JuliaLang/julia/pull/27516
if VERSION < v"1.2.0-DEV.77"
import Test: @inferred
using Test: _args_and_call
using InteractiveUtils: gen_call_with_extracted_types
using Core.Compiler: typesubtract

macro inferred(allow, ex)
Expand Down
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,16 @@ end
@test g(10) == 1
@inferred Missing g(9)
@inferred Missing g(10)

@testset "with kwargs (#795)" begin
h(a; b=1) = a < 10 ? missing : b
@test ismissing(h(9))
@test h(10) == 1
@inferred Missing h(9)
@inferred Missing h(10)
@inferred Missing h(9; b=2)
@inferred Missing h(10; b=2)
end
end

# https://github.com/JuliaLang/julia/pull/36360
Expand Down

2 comments on commit 2ad6ee4

@martinholters
Copy link
Member

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/80164

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 v3.46.2 -m "<description of version>" 2ad6ee4a6e1b294f10d6915295d9c3eae4802307
git push origin v3.46.2

Please sign in to comment.