On Sunday, 31 December 2023 at 11:12:23 UTC, Mike Parker wrote:

(__UPDATE__: Both [the Bugzilla issue](https://issues.dlang.org/show_bug.cgi?id=24153) and [the pull request](https://github.com/dlang/dmd/pull/15627) have since been closed, as the issue is no longer reproducible.)


I just tested, and the issue happens again, i don't know what yielded it to disapear previously, maybe a mistake on my end (i probably forgot -inline)

Anyways, here is the code that reproduces the issue:


```D
struct InvBoneBindInfo
{
}


struct Test(Value)
{
    void test()
    {
        auto t = Value.init; // <--- it's because of this
    }
}

extern(C) void main()
{
    Test!(InvBoneBindInfo[32]) test;
    test.test();
}
```

Compile it with:

``dmd -betterC -inline -run test.d``

You will get:

```
test.d(1): Error: `TypeInfo` cannot be used with -betterC
```

The issue remains because of the ``Value.init``, wich is a static array, dmd for some reasons require the typeinfo
  • D Language Fo... Mike Parker via Digitalmars-d-announce
    • Re: D La... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
    • Re: D La... zjh via Digitalmars-d-announce
    • Re: D La... ryuukk_ via Digitalmars-d-announce
    • Re: D La... Konstantin via Digitalmars-d-announce
      • Re: ... ryuukk_ via Digitalmars-d-announce
    • Re: D La... Mike Shah via Digitalmars-d-announce

Reply via email to