Skip to content

Commit

Permalink
Escape information in @not_implemented (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Apr 27, 2021
1 parent ecb0c56 commit fe69977
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRulesCore"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "0.9.39"
version = "0.9.40"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
2 changes: 1 addition & 1 deletion src/differentials/notimplemented.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `info` should be useful information about the missing differential for debug
differential in the debugging information.
"""
macro not_implemented(info)
return :(NotImplemented($__module__, $(QuoteNode(__source__)), $info))
return :(NotImplemented($__module__, $(QuoteNode(__source__)), $(esc(info))))
end

"""
Expand Down
7 changes: 7 additions & 0 deletions test/differentials/notimplemented.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@
@test ni.mod isa Module
@test ni.source isa LineNumberNode
@test ni.info == "myerror"

info = "some info"
ni = @not_implemented(info)
@test ni isa ChainRulesCore.NotImplemented
@test ni.mod isa Module
@test ni.source isa LineNumberNode
@test ni.info === info
end

@testset "NotImplementedException" begin
Expand Down

2 comments on commit fe69977

@devmotion
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/35515

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.9.40 -m "<description of version>" fe69977196b9e274b95bea72f1c00944fe54da6c
git push origin v0.9.40

Please sign in to comment.