please help me submit a bug!
workman
workman at gmail.com
Sat Oct 9 05:34:28 UTC 2021
On Friday, 8 October 2021 at 19:21:45 UTC, jfondren wrote:
>
> One of these is probably the case:
>
> 1. workman overlooked the line number in the error
> output--there is no bug
>
> 2. workman did not overlook the line number but thinks it not
> helpful enough. By "I hope compiler can print the lines" he
> means that he wants more verbose output that points to the
> array literal in context and explains why it uses the GC.
>
> 3. there is a bug and the compiler sometimes doesn't print the
> error number.
>
> There are a lot of possibilities but the thread still isn't a
> mystery novel.
Thanks for the list and tips.
It take me a lot time to location the bugs:
```d
struct T {
int b;
ubyte[] a;
}
enum T A = T(3, [1]);
extern(C) int main(int argc, char** argv) @nogc nothrow {
if(argc > 1 && A.b ) {
return 0;
}
return 0;
}
```
```sh
test.d(7): Error: array literal in `@nogc` function `test.main`
may cause a GC allocation
```
I am not able to find it because it not throw by a array literal,
but by call a enum struct int filed(this struct also include a
dynamic array).
In this case I dont get the line number, and this A.b should be
compile time const.
More information about the Digitalmars-d
mailing list