Bug 12063 – No line number error on uninitialized enum member if base type is not incrementable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-02T08:58:00Z
Last change time
2014-04-10T06:47:42Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2014-02-02T08:58:29Z
struct Foo {} enum Bar : Foo { a = Foo(), b } void main() {} dmd 2.065.0b2 gives me an error message witn no line number about "max", that is not present in the program, plus this, plus a crash: Error: no property 'max' for type 'Foo' test.d(4): Error: incompatible types for ((Foo()) + (1)): 'Bar' and 'int' Assertion failure: '0' on line 310 in file 'interpret.c'
Comment #1 by k.hara.pg — 2014-04-10T02:59:28Z
With git-head, ICE does not occur. Error: no property 'max' for type 'Foo' test.d(7): Error: incompatible types for ((Foo()) + (1)): 'Bar' and 'int' Change the summary and keywords.
Comment #2 by k.hara.pg — 2014-04-10T03:58:19Z
Comment #3 by github-bugzilla — 2014-04-10T06:47:41Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b28e0d7476731004bc44f455dc5ea0522625df67 fix Issue 12063 - No line number error on uninitialized enum member if base type is not incrementable https://github.com/D-Programming-Language/dmd/commit/776a542fb4cee087f1a12a7873d31fe1e09a1476 Merge pull request #3444 from 9rnsr/fix12063 Issue 12063 - No line number error on uninitialized enum member if base type is not incrementable