[Issue 23095] New: taggedPointer accessors are not scope
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu May  5 21:33:54 UTC 2022
    
    
  
https://issues.dlang.org/show_bug.cgi?id=23095
          Issue ID: 23095
           Summary: taggedPointer accessors are not scope
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: baiocchi.gabriel at grad.ufsc.br
taggedPointer generates @property accessors for every separate part of the
tagged pointer. However, these don't work on a scope reference when compiling
with -dip1000:
import std.bitmanip : taggedPointer;
struct S {
    mixin(taggedPointer!(
        int*, "ptr",
        bool, "flag", 1
    ));
}
void foo(scope ref S s) @safe
{
    s.flag; // <- error points here
}
// Error: scope variable `s` assigned to non-scope parameter `this` calling
test.S.flag
--
    
    
More information about the Digitalmars-d-bugs
mailing list