Thread overview
can not find the error: Error: TypeInfo cannot be used with -betterC
Jul 17, 2019
Newbie2019
Jul 17, 2019
aliak
Jul 17, 2019
Sebastiaan Koppe
July 17, 2019
when build my project with -betterC, it throw this error:

Error: TypeInfo cannot be used with -betterC

There is no location information about it,  how can I find what code cause this ?


July 17, 2019
On Wednesday, 17 July 2019 at 15:52:39 UTC, Newbie2019 wrote:
> when build my project with -betterC, it throw this error:
>
> Error: TypeInfo cannot be used with -betterC
>
> There is no location information about it,  how can I find what code cause this ?

You usually get that *extrememly* unhelpful error message when you use anything that uses TypeInfo. So it can be quite hard to figure out.

Did it start happening after you added a class or did something with exceptions? At least those would cause that error.
July 17, 2019
On Wednesday, 17 July 2019 at 15:52:39 UTC, Newbie2019 wrote:
> when build my project with -betterC, it throw this error:
>
> Error: TypeInfo cannot be used with -betterC
>
> There is no location information about it,  how can I find what code cause this ?

With ldc I often use -v to get the verbose output of the compiler. It will output what module it is compiling and in what stage. Often the module right before the error is the one you'll need to examine. I know, it stinks.

Most often it is one of: arrays, ~=, typeid, throw, new, toString.