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 scope related deprecation warnings in vibe.data.json #2732

Merged
merged 3 commits into from
Jun 26, 2023

Conversation

s-ludwig
Copy link
Member

Avoids using formattedWrite directly in order to avoid warnings when passing a scope output range.

Also marks the line parameter of parseJson scope (which probably isn't inferred as such due to the recursive nature of parseJson).

See also #2724.

void put(char ch) @trusted { sink((&ch)[0 .. 1]); }
}
auto r = DummyRangeS(sink);
writeJsonString(r, this);
}
/// ditto
void toString(scope void delegate(const(char)[]) @system sink, FormatSpec!char fmt)
void toString(scope void delegate(scope const(char)[]) @system sink, FormatSpec!char fmt)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a breaking change isn't it ? Giving it a non-scope delegate will break.

Copy link
Member Author

Choose a reason for hiding this comment

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

True, I'll add a separate overload. Not sure what the warning here was anyway, at least the method should be @system.

s-ludwig added 3 commits June 26, 2023 12:13
Avoids using formattedWrite directly in order to avoid warnings when passing a scope output range.

Also marks the `line` parameter of `parseJson` `scope` (which probably isn't inferred as such due to the recursive nature of `parseJson`).
@s-ludwig s-ludwig force-pushed the fix_json_scope_warnings branch from b420620 to 0cbfba7 Compare June 26, 2023 10:14
@Geod24 Geod24 merged commit 4c25c08 into master Jun 26, 2023
@Geod24 Geod24 deleted the fix_json_scope_warnings branch June 26, 2023 20:02
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.

2 participants