----- enum E { a, b, } // L1 void main() { void* a = E.init; // L5 } ----- $ dmd test.d test.d(1): Error: cannot implicitly convert expression (cast(E)0) of type E to void* Should be: test.d(5): Error: cannot implicitly convert expression (cast(E)0) of type E to void*
https://github.com/D-Programming-Language/dmd/pull/3387
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/59cec6087c6b1b95164ba8e6baa35af042ffa57e fix Issue 12380 - Wrong line number for type mismatch with enum .init assignment https://github.com/D-Programming-Language/dmd/commit/f17dfa33873ebc7572d88720657ba3cc8d644d88 Merge pull request #3387 from 9rnsr/fix12380 Issue 12380 - Wrong line number for type mismatch with enum .init assignment
I've found another test-case which wasn't fixed by this pull: ----- struct vec2 { float x, y; } enum winSize = vec2(1024, 768); // L3 void main() { int x = winSize.x; // L7 } ----- test.d(3): Error: cannot implicitly convert expression (1024.00) of type float to int
@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
*** Issue 20718 has been marked as a duplicate of this issue. ***
*** Issue 15867 has been marked as a duplicate of this issue. ***
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
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
@MartinNowak created dlang/dmd pull request #11118 "merge stable" fixing this issue: - Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization - Merge pull request #11002 from BorisCarvajal/fix20718 Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com> - Revert "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization" - Merge pull request #11102 from dlang/revert-11002-fix20718 Revert "Fix Issues 20718, 15867, 12380 - Wrong location errors on const. folding / exp. optimization" merged-on-behalf-of: Florian <moonlightsentinel@disroot.org> https://github.com/dlang/dmd/pull/11118