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

Cyclic reference error when using @with_kw only in v0.16.0 #1459

Closed
mossr opened this issue Sep 11, 2021 · 0 comments · Fixed by #1468
Closed

Cyclic reference error when using @with_kw only in v0.16.0 #1459

mossr opened this issue Sep 11, 2021 · 0 comments · Fixed by #1468
Assignees

Comments

@mossr
Copy link
Contributor

mossr commented Sep 11, 2021

This occurs in Pluto v0.16.0 (and was not a problem in Pluto v0.15.1), both using Julia v1.6.2 on Windows 10.
image
Looks like it is confusing the field name of rewards in the struct with the function of the same name. Note, this does not occur when I drop @with_kw.

Here's the MWE Pluto file:

Click to expand for MWE
### A Pluto.jl notebook ###
# v0.16.0

using Markdown
using InteractiveUtils

# ╔═╡ 9f5cf925-6821-486a-ae17-fe652ec91d16
using Parameters

# ╔═╡ 3a550aa0-9ac6-47f3-9f52-0351a51de8ba
@with_kw struct Structure
    rewards
end

# ╔═╡ 45b6e540-1323-11ec-3ca7-398dec9b5889
function rewards(input::Structure)
    # Cool Julia stuff
end	

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"

[compat]
Parameters = "~0.12.2"
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised

[[OrderedCollections]]
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.4.1"

[[Parameters]]
deps = ["OrderedCollections", "UnPack"]
git-tree-sha1 = "2276ac65f1e236e0a6ea70baff3f62ad4c625345"
uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a"
version = "0.12.2"

[[UnPack]]
git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
version = "1.0.2"
"""

# ╔═╡ Cell order:
# ╠═9f5cf925-6821-486a-ae17-fe652ec91d16
# ╠═45b6e540-1323-11ec-3ca7-398dec9b5889
# ╠═3a550aa0-9ac6-47f3-9f52-0351a51de8ba
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002
@mossr mossr changed the title Cyclic reference error when using @with_kw Cyclic reference error when using @with_kw only in v0.16.0 Sep 11, 2021
@Pangoraw Pangoraw self-assigned this Sep 11, 2021
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 a pull request may close this issue.

2 participants