Bug 12380 – Wrong line number for type mismatch with enum .init assignment

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-16T01:56:20Z
Last change time
2022-12-10T13:56:37Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2014-03-16T01:56:20Z
----- 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*
Comment #1 by k.hara.pg — 2014-03-17T17:42:00Z
Comment #2 by github-bugzilla — 2014-03-17T18:01:57Z
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
Comment #3 by andrej.mitrovich — 2014-05-22T09:43:52Z
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
Comment #4 by dlang-bot — 2020-04-03T12:12:39Z
@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 #5 by schveiguy — 2020-04-08T15:21:36Z
*** Issue 20718 has been marked as a duplicate of this issue. ***
Comment #6 by schveiguy — 2020-04-08T15:21:56Z
*** Issue 15867 has been marked as a duplicate of this issue. ***
Comment #7 by dlang-bot — 2020-05-06T09:48:35Z
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 #8 by dlang-bot — 2020-05-06T16:08:52Z
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 #9 by schveiguy — 2020-05-06T16:10:28Z
*** Issue 20718 has been marked as a duplicate of this issue. ***
Comment #10 by schveiguy — 2020-05-06T16:10:47Z
*** Issue 15867 has been marked as a duplicate of this issue. ***
Comment #11 by dlang-bot — 2020-05-09T07:14:20Z
@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 <[email protected]> - 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 <[email protected]> https://github.com/dlang/dmd/pull/11118