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

define haskey/hasproperty on Composite #249

Merged
merged 3 commits into from
Nov 16, 2020

Conversation

simeonschaub
Copy link
Member

Just discovered we were missing these, can't think of any reason not to define them.

Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

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

LGTM

test/differentials/composite.jl Outdated Show resolved Hide resolved
Co-authored-by: Lyndon White <oxinabox@ucc.asn.au>
@@ -56,6 +60,10 @@ end
@test getproperty(Composite{Tuple{Float64,}}(@thunk 2.0^2), 1) == 4.0
@test getproperty(Composite{Tuple{Float64,}}(a=(@thunk 2.0^2),), :a) == 4.0

# TODO: uncomment this once https://github.com/JuliaLang/julia/issues/35516
# @test haskey(Composite{Tuple{Float64}}(2.0), 1) == true
# @test hasproperty(Composite{Tuple{Float64}}(2.0), 2) == false
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to use test_broken, so we get notified when this is starts working?

@simeonschaub simeonschaub merged commit 6ed6806 into JuliaDiff:master Nov 16, 2020
@simeonschaub simeonschaub deleted the sds/haskey_composite branch November 16, 2020 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants