D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3773 - Incorrectly returning an enum error, points to enum line iso error line
Summary: Incorrectly returning an enum error, points to enum line iso error line
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-05 15:48 UTC by strtr
Modified: 2019-11-06 14:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description strtr 2010-02-05 15:48:14 UTC
--
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 RazvanN 2019-11-06 14:44:35 UTC
I cannot reproduce this in git master. I get error for trying to return something from void functions, which is the correct behavior.