Bug 20718 – enum type mismatch causes wrong location on error

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-04-01T17:40:04Z
Last change time
2020-05-06T16:10:28Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Steven Schveighoffer

Comments

Comment #0 by schveiguy — 2020-04-01T17:40:04Z
In diagnosing a bizarre error in druntime for building documentation on macos, I found the following issue: --- importedmod.d enum { foo = 1 } --- main.d import importedmod; struct S { string x; } static immutable S s = {foo}; Error: importedmod.d(3): Error: cannot implicitly convert expression `1` of type `int` to `immutable(string)` The location is the definition, not the usage which causes the error. If I use run.dlang.io, it's reporting that the error location was correct in 2.063.0. It might be related to issue 12380, but I don't want to mark that a regression since it was a reopened issue. also possibly related is issue 15867.
Comment #1 by dlang-bot — 2020-04-03T12:12:41Z
@BorisCarvajal created dlang/dmd pull request #11002 "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization" fixing this issue: - Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization https://github.com/dlang/dmd/pull/11002
Comment #2 by schveiguy — 2020-04-08T15:21:36Z
*** This issue has been marked as a duplicate of issue 12380 ***
Comment #3 by dlang-bot — 2020-05-06T09:48:37Z
dlang/dmd pull request #11002 "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization" was merged into stable: - e9227fc44fdd52e7217d0f72f6fec671f98555f5 by Boris Carvajal: Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization https://github.com/dlang/dmd/pull/11002
Comment #4 by dlang-bot — 2020-05-06T16:08:54Z
dlang/dmd pull request #11102 "Revert "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization"" was merged into stable: - 7199de9b5d0a04bc415ac52d1490c66c92d14508 by Steven Schveighoffer: Revert "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization" https://github.com/dlang/dmd/pull/11102
Comment #5 by schveiguy — 2020-05-06T16:10:28Z
*** This issue has been marked as a duplicate of issue 12380 ***