Thread overview
range shortened method not enabled, compile with compiler switch `-preview=shortenedMethods`
Sep 24
Joe
Sep 24
Joe
September 24

For absolutely no reason I started getting this error.

Last night I compiled the project and it worked just fine. This morning I made a single insignificant change and tried to compile and got that error. Only possible thing is that for some reason some change in updating the compiler may have no propagated correctly till after the reboot.

when I add the switch I then get.

function core.time.TickDuration.time_initializer must be extern(C) for pragma(crt_constructor)

dmd-2.105.2

EVERYTHING was working fine yesterday. All I did today was load up the project and change an integer value and I couldn't compile it ;/

Maybe corruption somewhere, I don't know.

Anyways, I added extern(C) to that method in the location it says the file exists but no change. I removed the pragma, no change. Doesn't seem to actually be using that file.

I have no idea what is going on. All I can do is try to reinstall the compiler and maybe redo the dub package. I'm using visual D + vibe.d + dub. Nothing fancy.

September 24

On Sunday, 24 September 2023 at 10:00:31 UTC, Joe wrote:

>

For absolutely no reason I started getting this error.

Last night I compiled the project and it worked just fine. This morning I made a single insignificant change and tried to compile and got that error. Only possible thing is that for some reason some change in updating the compiler may have no propagated correctly till after the reboot.

[...]

This sounds like a compiler issue. Are you on the latest compiler? Which compiler? Is there a set of code you can post or upload which causes the problem?

-Steve

September 24

On Sunday, 24 September 2023 at 12:59:57 UTC, Steven Schveighoffer wrote:

>

On Sunday, 24 September 2023 at 10:00:31 UTC, Joe wrote:

>

For absolutely no reason I started getting this error.

Last night I compiled the project and it worked just fine. This morning I made a single insignificant change and tried to compile and got that error. Only possible thing is that for some reason some change in updating the compiler may have no propagated correctly till after the reboot.

[...]

This sounds like a compiler issue. Are you on the latest compiler? Which compiler? Is there a set of code you can post or upload which causes the problem?

-Steve

I accidentally deleted my D folder containing the compiler and other things. (It as a weird issue where I was trying to add a command to an app and because the %1 parameter didn't have quotes I guess it deleted the D folder as it shortened it to D) I had a backup and didn't change anything since then except for updating the compilers. Still had the same visual D version.

So I copied it over and updated dmd with visual D. Everything worked fine that day and I messed with the code several times. Woke up and wanted to make a simple change and code would not compile. The changes were insignificant. It gave me that error and when I added that switch then I got one about pragma(crt_constuctor) needing extern(C). Anyways, tried adding the extern(C) in the code but it wouldn't accept the changes.

BUT I just tried to compile it again and no issues.

Probably drive corruption issues or possibly some type of caching issue.

But I was able to make changes now and compile it like it should work.

E.g., it's possible that when I copied over the old D directory that it had an old compiler(I think it was from '22). I did update with visual D but maybe there was caching going on that was causing the conflict.

In any case everything seems to be back to normal. I really didn't do much to fix anything so it was probably all caused by deleting that D folder accidentally.