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

DIP1000-related deprecation with DMD 2.101 #311

Open
Herringway opened this issue Nov 22, 2022 · 0 comments
Open

DIP1000-related deprecation with DMD 2.101 #311

Herringway opened this issue Nov 22, 2022 · 0 comments

Comments

@Herringway
Copy link
Member

This code:

D-YAML/source/dyaml/node.d

Lines 2510 to 2522 in 9456888

this.value_.match!(
(const bool v) => formattedWrite(sink, v ? "true" : "false"),
(const long v) => formattedWrite(sink, "%s", v),
(const Node[] v) => formattedWrite(sink, "[%(%s, %)]", v),
(const ubyte[] v) => formattedWrite(sink, "%s", v),
(const string v) => formattedWrite(sink, `"%s"`, v),
(const Node.Pair[] v) => formattedWrite(sink, "{%(%s, %)}", v),
(const SysTime v) => formattedWrite(sink, "%s", v),
(const YAMLNull v) => formattedWrite(sink, "%s", v),
(const YAMLMerge v) => formattedWrite(sink, "%s", v),
(const real v) => formattedWrite(sink, "%s", v),
(const YAMLInvalid v) => formattedWrite(sink, "%s", v),
);

gives us a deprecation warning - Deprecation: scope variable 'this' assigned to non-scope parameter '_param_0' calling 'match'. There are two problems that I can see here:

  • the delegates handling references's parameters aren't marked scope
    • easy to fix. just add 'scope' to the delegate params
  • formattedWrite's parameters aren't scope
    • needs to be fixed in phobos?
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

No branches or pull requests

1 participant