Skip to content

DIP1000-related deprecation with DMD 2.101 #311

@Herringway

Description

@Herringway

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions