Closed dlangBugzillaToGithub closed 11 months ago
Error message:
errors in imported modules: Error: C:\D\dmd2\src\phobos\std\range\package.d(1028): => shortened method not enabled, compile with compiler switch -preview=shortenedMethods
ArokhSlade reports that…
adding the switch doesn't change a thing
(In reply to Elias Batek (0xEAB) from comment #1)
adding the switch doesn't change a thing
*change anything
Created attachment 1890 screenshot: different error message on dmd 2.102.2
screenshot shows the situation with dmd 2.102.2 a new solution & project in visual studio 2022 (17.7.3) produces different error messages but, i presume, similar issue. even complains about a file that neither was part of the solution nor opened in the workspace at all (but opened previously & closed). also shows compiling from cli works fine.
Created attachment 1891 screenshot: no error message on dmd 2.094.2
this screenshot shows that the issue does not occur on an even older version of dmd (2.094.2). (also shows that compiling still fails, because visual-d doesn't know the right path to link.exe (and i don't know how to tell it) but i understand that's a separate issue.)
The errors shown are from intellisense. This is caused by the fact that the dmd-engine used for intellisense has not been updated in a while, but the imported files from phobos and druntime are newer. So it fails to recognize some constructs introduced by later dmd releases. Unfortunately, this also goes the other way: a newer engine might expect specific declaration/templates in the runtime that older versions don't have.
The compilation is not affected (as long as the command line interface to dmd is not changed), the link error is caused by dmd 2.094 not knowing about VS 2022.
I also have this issue
Should be fixed in https://github.com/dlang/visuald/releases/tag/v1.4.0-beta2 as the semantic engine is based on dmd 2.060.0.
desisma reported this on 2023-09-04T18:03:53Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=24136
CC List
Description
Visual D seems to lack support for the shortened methods syntax.
This prevents a simple Hello World from compiling when the user has a recent copy of the Phobos src installed. That’s because VS doesn’t even to try compiling it when it runs into an error during code analysis, as it seems.
Culprit appears to be Phobos PR #8713[0] which brought short.m.s to std.range.
ArokhSlade from the community Discord reports that their project compiles fine when manually running the compiler via CLI.
[0] https://github.com/dlang/phobos/pull/8713
!!!There are attachements in the bugzilla issue that have not been copied over!!!