importC reflection drop const attribute bugs

Danilo codedan at aol.com
Wed Feb 28 05:38:59 UTC 2024


On Wednesday, 28 February 2024 at 05:13:19 UTC, Dave P. wrote:
> On Wednesday, 28 February 2024 at 05:00:32 UTC, Dakota wrote:
>> [...]
>
> I reported this as a bug before: 
> https://issues.dlang.org/show_bug.cgi?id=23926
>
> It’s actually not clear what the solution should be as D const 
> is not the same as C const as D const is transitive. Walter 
> decided to err on the side of accepting more code, so C const 
> is translated to D non-const.

Sounds like just removing const on the D side should work?

```d
import test2i;

void test1() {
     Message* m;
     tryEncode(m);
}

extern(C) void main() {
     test1();
}
```




More information about the Digitalmars-d mailing list