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

fix: warning "local var is never updated" for generated instance fixed #267

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

Ilya-Sib
Copy link
Contributor

@Ilya-Sib Ilya-Sib commented Dec 13, 2023

I tried to raise the Scala until 2.13.12, warnings like this started to appear

local var fresh$macro$16 in <$anon: tethys.JsonReader[Example]> is never updated: consider using immutable val

They arise because when generating allocateDefaultValues something like

private[this] var fresh$macro$16: Option[Boolean] = _;
private[this] var fresh$macro$15: Option[String] = _;
private[this] var fresh$macro$14: Int = _;

and then the values do not change. Here minimal example and fix.

@REDNBLACK REDNBLACK self-assigned this Dec 18, 2023
@Ilya-Sib Ilya-Sib force-pushed the fix-reader-instance branch from 0ef87c9 to 3bdb59f Compare December 18, 2023 18:44
@REDNBLACK REDNBLACK merged commit 6955290 into tethys-json:master Dec 19, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants