[Issue 23570] New: UDAs do not carry over in foreach over tupleof
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Dec 20 11:12:59 UTC 2022
    
    
  
https://issues.dlang.org/show_bug.cgi?id=23570
          Issue ID: 23570
           Summary: UDAs do not carry over in foreach over tupleof
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: zorael at gmail.com
Manjaro/Arch x86_64, dmd 2.101.0
---
import std;
enum UDA;
struct Foo
{
    @UDA int i;
}
void main()
{
    Foo f;
    foreach (i, ref symbol; f.tupleof)
    {
        static assert(hasUDA!(symbol, UDA));  // fails
        static assert(hasUDA!(f.tupleof[i], UDA));  // succeeds
    }
}
---
I understand that it currently doesn't, but shouldn't it?
--
    
    
More information about the Digitalmars-d-bugs
mailing list