[Issue 24771] New: apply qualifiers between `ref` and function name to return type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 19 12:32:25 UTC 2024


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

          Issue ID: 24771
           Summary: apply qualifiers between `ref` and function name to
                    return type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: qs.il.paperinik at gmail.com

```d
struct S
{
    int[] x;
    ref const int[] f() => x;
}
```

In the above snipped, `const` applies to the implicit `this` parameter of `f`.
While prefix type qualifiers are widespread, qualifiers between `ref` and the
basic type part of the return type are probably unlikely in both human written
and generated code.

Maybe we could interpret this the same as `ref const(int[])` instead.

--


More information about the Digitalmars-d-bugs mailing list