[Issue 19129] New: std.typecons.scoped crashes when used on classes that have context

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 30 18:22:13 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19129

          Issue ID: 19129
           Summary: std.typecons.scoped crashes when used on classes that
                    have context
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

Example:

  int y;
  class C { this(int x) { y = x; } }
  import std.typecons: scoped;
  scoped!C(1); // crashes, as ctx.y segfaults when ctx remains null

scoped should probably reject classes that have a "this" member (that aren't
`static class`).

--


More information about the Digitalmars-d-bugs mailing list