Skip to content

[REG2.111.0] RedBlackTree compile error for structs with move constructor #10811

Description

@s-ludwig
static struct S {
    int i;
    this(S s) { this.i = s.i; }
    this(int i) { this.i = i; }
    int opCmp(ref const S other) const @safe nothrow  { return i - other.i; }
}

auto tree = new RedBlackTree!(S, "a.i < b.i", false);
tree.insert(S(0)); // Error: constructor `std.container.rbtree.RBNode!(S).RBNode.this(inout(RBNode!(S)) p) inout` is not callable using argument types `(typeof(null), typeof(null), typeof(null), S)`

This is caused by a compiler/language regression and also notably affects structs with an implicit move constructor. See dlang/dmd#21476.

Activity

  1. added a commit that references this issue on Jun 29, 2025
    5125f2e
  2. ibuclaw commented on Jul 1, 2025

    @ibuclaw
    Member

    This is caused by a compiler/language regression and also notably affects structs with an implicit move constructor. See dlang/dmd#21476.

    FAOD, dlang/dmd#21476 didn't cause this regression, rather it fixes this regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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