Bug 3773 – Incorrectly returning an enum error, points to enum line iso error line
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2010-02-05T15:48:14Z
Last change time
2019-11-06T14:44:35Z
Assigned to
No Owner
Creator
strtr
Comments
Comment #0 by strtr — 2010-02-05T15:48:14Z
--
1 module test;
2 enum { A = 0, B, C }
3 enum E { A = 0, B, C }
4 void func1(){
5 return A;}
6 void func2(){
7 return E.A;}
8 void func3(){
9 return 0;}
--
test.d(2): Error: long has no effect in expression (0)
// should point to line 5, very annoying to find this kind of bug!
test.d(7): Error: long has no effect in expression (cast(E)0)
// correct line but still incomprehensible
test.d(9): Error: long has no effect in expression (0)
// correct line but say what?
Comment #1 by razvan.nitu1305 — 2019-11-06T14:44:35Z
I cannot reproduce this in git master. I get error for trying to return something from void functions, which is the correct behavior.